-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Output file to spytify to only transcode to mp3 at the end of the rec…
- Loading branch information
Showing
3 changed files
with
169 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace EspionSpotify.Models | ||
{ | ||
public class OutputFile | ||
{ | ||
private const string SPYTIFY = "spytify"; | ||
private const int FIRST_SONG_NAME_COUNT = 1; | ||
|
||
|
||
public string Path { get; set; } | ||
public string File { get; set; } | ||
public int Count { get; private set; } | ||
public string Separator { get; set; } | ||
public string Extension { get; set; } | ||
|
||
public OutputFile() | ||
{ | ||
Count = FIRST_SONG_NAME_COUNT; | ||
} | ||
|
||
public void Increment() | ||
{ | ||
Count++; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
|
||
return $@"{Path}\{File}{GetAddedCount()}.{Extension}"; | ||
} | ||
|
||
public string ToPendingFileString() | ||
{ | ||
return $@"{Path}\{File}{GetAddedCount()}.{SPYTIFY}"; | ||
} | ||
|
||
public string ToTranscodingToMP3String() | ||
{ | ||
return $@"{Path}\{File}{GetAddedCount()}.{Extension}.{SPYTIFY}"; | ||
} | ||
|
||
private string GetAddedCount() | ||
{ | ||
return Count > FIRST_SONG_NAME_COUNT ? $"{Separator}{Count}" : ""; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters