diff --git a/BasicNodes/BasicNodes.csproj b/BasicNodes/BasicNodes.csproj index fe1f42ea..c9ece637 100644 Binary files a/BasicNodes/BasicNodes.csproj and b/BasicNodes/BasicNodes.csproj differ diff --git a/ChecksumNodes/ChecksumNodes.csproj b/ChecksumNodes/ChecksumNodes.csproj index 17fdac80..e5577fa5 100644 Binary files a/ChecksumNodes/ChecksumNodes.csproj and b/ChecksumNodes/ChecksumNodes.csproj differ diff --git a/CollectionNodes/CollectionNodes.csproj b/CollectionNodes/CollectionNodes.csproj index d4c5d350..e11e6ab4 100644 Binary files a/CollectionNodes/CollectionNodes.csproj and b/CollectionNodes/CollectionNodes.csproj differ diff --git a/EmailNodes/EmailNodes.csproj b/EmailNodes/EmailNodes.csproj index f21efc4f..82889806 100644 Binary files a/EmailNodes/EmailNodes.csproj and b/EmailNodes/EmailNodes.csproj differ diff --git a/FileFlows.Plugin.dll b/FileFlows.Plugin.dll index eeb19645..a6073e53 100644 Binary files a/FileFlows.Plugin.dll and b/FileFlows.Plugin.dll differ diff --git a/FileFlows.Plugin.pdb b/FileFlows.Plugin.pdb index 8191a9bd..f8687446 100644 Binary files a/FileFlows.Plugin.pdb and b/FileFlows.Plugin.pdb differ diff --git a/MetaNodes/MetaNodes.csproj b/MetaNodes/MetaNodes.csproj index ea88c112..ac36980c 100644 Binary files a/MetaNodes/MetaNodes.csproj and b/MetaNodes/MetaNodes.csproj differ diff --git a/MusicNodes/InputNodes/MusicFile.cs b/MusicNodes/InputNodes/MusicFile.cs index f5e3b8fe..f5c1c1b6 100644 --- a/MusicNodes/InputNodes/MusicFile.cs +++ b/MusicNodes/InputNodes/MusicFile.cs @@ -17,10 +17,12 @@ namespace FileFlows.MusicNodes { { "mi.Album", "Album" }, { "mi.Artist", "Artist" }, + { "mi.ArtistThe", "Artist, The" }, { "mi.BitRate", 845 }, { "mi.Channels", 2 }, { "mi.Codec", "flac" }, { "mi.Date", new DateTime(2020, 05, 23) }, + { "mi.Year", 2020 }, { "mi.Duration", 256 }, { "mi.Encoder", "FLAC 1.2.1" }, { "mi.Frequency", 44100 }, @@ -28,9 +30,7 @@ namespace FileFlows.MusicNodes { "mi.Language", "English" }, { "mi.Title", "Song Title" }, { "mi.Track", 2 }, - { "mi.TrackPad", "02" }, { "mi.Disc", 2 }, - { "mi.DiscPad", "02" }, { "mi.TotalDiscs", 2 } }; } diff --git a/MusicNodes/MusicNodes.csproj b/MusicNodes/MusicNodes.csproj index 8b22ca4d..3a4a0315 100644 Binary files a/MusicNodes/MusicNodes.csproj and b/MusicNodes/MusicNodes.csproj differ diff --git a/MusicNodes/Nodes/MusicNode.cs b/MusicNodes/Nodes/MusicNode.cs index 85a8dba7..87db3f9f 100644 --- a/MusicNodes/Nodes/MusicNode.cs +++ b/MusicNodes/Nodes/MusicNode.cs @@ -47,12 +47,22 @@ namespace FileFlows.MusicNodes else args.Parameters.Add(MUSIC_INFO, musicInfo); - variables.AddOrUpdate("mi.Artist", musicInfo.Artist); + if(musicInfo.Artist.EndsWith(", The")) + variables.AddOrUpdate("mi.Artist", "The " + musicInfo.Artist.Substring(0, musicInfo.Artist.Length - ", The".Length).Trim()); + else + variables.AddOrUpdate("mi.Artist", musicInfo.Artist); + + if(musicInfo.Artist?.StartsWith("The ") == true) + variables.AddOrUpdate("mi.ArtistThe", musicInfo.Artist.Substring(4).Trim() + ", The"); + else + variables.AddOrUpdate("mi.ArtistThe", musicInfo.Artist); + variables.AddOrUpdate("mi.Album", musicInfo.Album); variables.AddOrUpdate("mi.BitRate", musicInfo.BitRate); variables.AddOrUpdate("mi.Channels", musicInfo.Channels); variables.AddOrUpdate("mi.Codec", musicInfo.Codec); variables.AddOrUpdate("mi.Date", musicInfo.Date); + variables.AddOrUpdate("mi.Year", musicInfo.Date.Year); variables.AddOrUpdate("mi.Duration", musicInfo.Duration); variables.AddOrUpdate("mi.Encoder", musicInfo.Encoder); variables.AddOrUpdate("mi.Frequency", musicInfo.Frequency); @@ -60,9 +70,7 @@ namespace FileFlows.MusicNodes variables.AddOrUpdate("mi.Language", musicInfo.Language); variables.AddOrUpdate("mi.Title", musicInfo.Title); variables.AddOrUpdate("mi.Track", musicInfo.Track); - variables.AddOrUpdate("mi.TrackPad", musicInfo.Track.ToString("D2")); variables.AddOrUpdate("mi.Disc", musicInfo.Disc < 1 ? 1 : musicInfo.Disc); - variables.AddOrUpdate("mi.DiscPad", musicInfo.Disc.ToString("D2")); variables.AddOrUpdate("mi.TotalDiscs", musicInfo.TotalDiscs < 1 ? 1 : musicInfo.TotalDiscs); args.UpdateVariables(variables); diff --git a/MusicNodes/Tests/MusicInfoTests.cs b/MusicNodes/Tests/MusicInfoTests.cs index 1cc36f53..c82a0224 100644 --- a/MusicNodes/Tests/MusicInfoTests.cs +++ b/MusicNodes/Tests/MusicInfoTests.cs @@ -54,8 +54,18 @@ namespace FileFlows.MusicNodes.Tests foreach (string file in Directory.GetFiles(@"D:\videos\music")) { var args = new FileFlows.Plugin.NodeParameters(file, logger, false, string.Empty); - var info = new MusicInfoHelper(ffmpegExe, logger).Read(file); - Assert.IsNotNull(info); + args.GetToolPathActual = (string tool) => ffmpegExe; + + // laod the variables + Assert.AreEqual(1, new MusicFile().Execute(args)); + + var mi = new MusicInfoHelper(ffmpegExe, args.Logger).Read(args.WorkingFile); + + string folder = args.ReplaceVariables("{mi.ArtistThe} ({mi.Year})"); + Assert.AreEqual($"{mi.Artist} ({mi.Date.Year})", folder); + + string fname = args.ReplaceVariables("{mi.Artist} - {mi.Track:##} - {mi.Title}"); + Assert.AreEqual($"{mi.Artist} - {mi.Track.ToString("00")} - {mi.Title}", fname); } } } diff --git a/VideoNodes/VideoNodes.csproj b/VideoNodes/VideoNodes.csproj index eb77275d..201b4f19 100644 Binary files a/VideoNodes/VideoNodes.csproj and b/VideoNodes/VideoNodes.csproj differ diff --git a/build/utils/PluginInfoGenerator/FileFlows.Plugin.dll b/build/utils/PluginInfoGenerator/FileFlows.Plugin.dll index c5ce0f73..0a88c565 100644 Binary files a/build/utils/PluginInfoGenerator/FileFlows.Plugin.dll and b/build/utils/PluginInfoGenerator/FileFlows.Plugin.dll differ diff --git a/build/utils/PluginInfoGenerator/FileFlows.Plugin.pdb b/build/utils/PluginInfoGenerator/FileFlows.Plugin.pdb index c6d884ba..851cf586 100644 Binary files a/build/utils/PluginInfoGenerator/FileFlows.Plugin.pdb and b/build/utils/PluginInfoGenerator/FileFlows.Plugin.pdb differ