fix
This commit is contained in:
parent
475061381b
commit
f5df5d6c85
|
@ -9,7 +9,7 @@ using TagFile = TagLib.File;
|
|||
namespace AutoTag.cli {
|
||||
internal static class AutoTag {
|
||||
private static void Main(string[] args) {
|
||||
if (args.Length != 3 || (args[0] != "albums" && args[0] != "playlists")) {
|
||||
if (args.Length != 3 || args[0] != "albums" && args[0] != "playlists") {
|
||||
Console.WriteLine("Usage: autotag <albums/playlists> <inputfolder> <outputfolder>");
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
@ -70,10 +70,9 @@ namespace AutoTag.cli {
|
|||
Directory.CreateDirectory(outputFileDirectory);
|
||||
|
||||
var outputFilePath = Path.Combine(outputDir, "Various Artists", CleanFileName(playlistName),
|
||||
CleanFileName((tagFile.Tag.Performers.Length == 0
|
||||
CleanFileName(tagFile.Tag.Performers.Length == 0
|
||||
? $"{i}. {tagFile.Tag.Title}{Path.GetExtension(track)}"
|
||||
: $"{i}. {tagFile.Tag.Performers[0]} - {tagFile.Tag.Title}{Path.GetExtension(track)}"
|
||||
)));
|
||||
: $"{i}. {tagFile.Tag.Performers[0]} - {tagFile.Tag.Title}{Path.GetExtension(track)}"));
|
||||
File.Copy(track, outputFilePath, true);
|
||||
var newTagFile = TagFile.Create(outputFilePath);
|
||||
newTagFile.Tag.Comment = null;
|
||||
|
@ -83,6 +82,9 @@ namespace AutoTag.cli {
|
|||
newTagFile.Tag.TrackCount = (uint) trackCount;
|
||||
newTagFile.Tag.AlbumArtists = new[] {"Various Artists"};
|
||||
|
||||
if (newTagFile.Tag.Performers.Length == 0)
|
||||
newTagFile.Tag.Performers = new[] {"Various Artists"};
|
||||
|
||||
newTagFile.Save();
|
||||
Console.WriteLine("-> " + outputFilePath);
|
||||
Console.WriteLine();
|
||||
|
|
Loading…
Reference in New Issue