Update
This commit is contained in:
parent
210958db35
commit
3eec3b5aa4
|
@ -26,8 +26,14 @@ internal static class AutoTag {
|
||||||
var tagFile = TagFile.Create(track);
|
var tagFile = TagFile.Create(track);
|
||||||
if (tagFile.Tag.AlbumArtists.Length == 0)
|
if (tagFile.Tag.AlbumArtists.Length == 0)
|
||||||
tagFile.Tag.AlbumArtists = new[] { tagFile.Tag.Performers[0] };
|
tagFile.Tag.AlbumArtists = new[] { tagFile.Tag.Performers[0] };
|
||||||
|
if (string.IsNullOrWhiteSpace(tagFile.Tag.Album))
|
||||||
|
tagFile.Tag.Album = tagFile.Tag.Title;
|
||||||
var outputFileDirectory = Path.Combine(outputDir, CleanFileName(tagFile.Tag.AlbumArtists[0]), CleanFileName(tagFile.Tag.Album));
|
var outputFileDirectory = Path.Combine(outputDir, CleanFileName(tagFile.Tag.AlbumArtists[0]), CleanFileName(tagFile.Tag.Album));
|
||||||
Directory.CreateDirectory(outputFileDirectory);
|
Directory.CreateDirectory(outputFileDirectory);
|
||||||
|
|
||||||
|
if (tagFile.Tag.Track < 1)
|
||||||
|
tagFile.Tag.Track = 1;
|
||||||
|
|
||||||
var outputFilePath = Path.Combine(outputDir, CleanFileName(tagFile.Tag.AlbumArtists[0]), CleanFileName(tagFile.Tag.Album),
|
var outputFilePath = Path.Combine(outputDir, CleanFileName(tagFile.Tag.AlbumArtists[0]), CleanFileName(tagFile.Tag.Album),
|
||||||
CleanFileName($"{tagFile.Tag.Track}. {tagFile.Tag.Performers[0]} - {tagFile.Tag.Title}{Path.GetExtension(track)}"));
|
CleanFileName($"{tagFile.Tag.Track}. {tagFile.Tag.Performers[0]} - {tagFile.Tag.Title}{Path.GetExtension(track)}"));
|
||||||
|
|
||||||
|
@ -112,7 +118,13 @@ internal enum FolderType {
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static class Helpers {
|
internal static class Helpers {
|
||||||
private static readonly List<string> AllowedFileTypes = new() { ".flac", ".opus", ".mp3", ".m4a" };
|
private static readonly List<string> AllowedFileTypes = new() {
|
||||||
|
".flac",
|
||||||
|
".opus",
|
||||||
|
".ogg",
|
||||||
|
".mp3",
|
||||||
|
".m4a"
|
||||||
|
};
|
||||||
|
|
||||||
internal static bool IsAllowed(string filename) => AllowedFileTypes.Any(filename.EndsWith);
|
internal static bool IsAllowed(string filename) => AllowedFileTypes.Any(filename.EndsWith);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue