Laura Hausmann 10 months ago
parent
commit
f5df5d6c85
Signed by: zotan GPG Key ID: 5EC1D38FFC321311
  1. 10
      AutoTag.cli/AutoTag.cs

10
AutoTag.cli/AutoTag.cs

@ -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…
Cancel
Save