Skip to content

Commit

Permalink
1.0.0.5
Browse files Browse the repository at this point in the history
1.0.0.5
  • Loading branch information
ImAiiR committed Nov 2, 2024
1 parent cf9d0b6 commit 83e9ee6
Show file tree
Hide file tree
Showing 6 changed files with 231 additions and 318 deletions.
188 changes: 125 additions & 63 deletions QobuzDownloaderX/Download/RenameTemplates.cs

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions QobuzDownloaderX/Download/TagFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static void WriteToFile(string tempPath, string artworkPath, Album QoAlbu
if (Settings.Default.upcTag == true) { customTagsFLAC.SetField("BARCODE", QoAlbum.UPC); } // UPC / Barcode (FLAC)
if (Settings.Default.labelTag == true) { customTagsFLAC.SetField("LABEL", Regex.Replace(QoAlbum.Label.Name, @"\s+", " ")); } // Record Label (FLAC) [Removing any chance of double spaces]
if (Settings.Default.explicitTag == true) { if (QoItem.ParentalWarning == true) { customTagsFLAC.SetField("ITUNESADVISORY", "1"); } else { customTagsFLAC.SetField("ITUNESADVISORY", "0"); } } // Parental Advisory (FLAC)
if (Settings.Default.commentTag == true && Settings.Default.commentText != string.Empty) { customTagsFLAC.SetField("COMMENT", new string[] { Settings.Default.commentText.Replace("%description%", "%Description%").Replace("%Description%", QoAlbum.Description).Replace("<br/>", System.Environment.NewLine).Replace("<br />", System.Environment.NewLine) }); } // Comment (FLAC)
}
else
{
Expand All @@ -46,10 +47,11 @@ public static void WriteToFile(string tempPath, string artworkPath, Album QoAlbu
if (Settings.Default.isrcTag == true) { mp3Tag.SetTextFrame("TSRC", QoItem.ISRC); } // ISRC (MP3)
if (Settings.Default.labelTag == true) { mp3Tag.SetTextFrame("TPUB", Regex.Replace(QoAlbum.Label.Name, @"\s+", " ")); } // Record Label (MP3) [Removing any chance of double spaces]
if (Settings.Default.typeTag == true) { mp3Tag.SetTextFrame("TMED", QoAlbum.ProductType.ToUpper()); } // Type of release (MP3)
if (Settings.Default.commentTag == true && Settings.Default.commentText != string.Empty) { file.Tag.Comment = Settings.Default.commentText.Replace("%description%", "%Description%").Replace("%Description%", QoAlbum.Description).Replace("<br/>", System.Environment.NewLine).Replace("<br />", System.Environment.NewLine); } // Comment (MP3)
}
qbdlxForm._qbdlxForm.logger.Debug("Writing all other tags");
if (Settings.Default.trackTitleTag == true) { file.Tag.Title = QoItem.Title; } // Track Title
if (Settings.Default.artistTag == true) { file.Tag.Performers = new[] { QoItem.Performer.Name }; } // Track Artist
if (Settings.Default.artistTag == true) { file.Tag.Performers = new[] { QoItem?.Performer?.Name }; } // Track Artist
if (Settings.Default.genreTag == true) { file.Tag.Genres = new[] { QoAlbum.Genre.Name }; } // Genre
if (Settings.Default.albumTag == true) { if (QoAlbum.Version == null) { file.Tag.Album = QoAlbum.Title; } else { file.Tag.Album = QoAlbum.Title.TrimEnd() + " (" + QoAlbum.Version + ")"; } } // Album Title
if (Settings.Default.trackTitleTag == true) { if (QoItem.Version == null) { file.Tag.Title = QoItem.Title; } else { file.Tag.Title = QoItem.Title.TrimEnd() + " (" + QoItem.Version + ")"; } } // Track Title
Expand All @@ -64,9 +66,17 @@ public static void WriteToFile(string tempPath, string artworkPath, Album QoAlbu
if (QoAlbum.Artists.Count > 1)
{
var mainArtists = QoAlbum.Artists.Where(a => a.Roles.Contains("main-artist")).ToList();
string allButLastArtist = string.Join(", ", mainArtists.Take(QoAlbum.Artists.Count - 1).Select(a => a.Name));
string allButLastArtist = string.Join(", ", mainArtists.Take(mainArtists.Count - 1).Select(a => a.Name));
string lastArtist = mainArtists.Last().Name;
if (Settings.Default.albumArtistTag == true) { if (QoAlbum.Artist.Name != null) { file.Tag.AlbumArtists = new[] { allButLastArtist + " & " + lastArtist }; } }

if (mainArtists.Count > 1)
{
if (Settings.Default.albumArtistTag == true) { if (QoAlbum.Artist.Name != null) { file.Tag.AlbumArtists = new[] { allButLastArtist + " & " + lastArtist }; } }
}
else
{
if (Settings.Default.albumArtistTag == true) { if (QoAlbum.Artist.Name != null) { file.Tag.AlbumArtists = new[] { lastArtist }; } }
}
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions QobuzDownloaderX/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.0.0.4")]
[assembly: AssemblyFileVersion("1.0.0.4")]
[assembly: AssemblyVersion("1.0.0.5")]
[assembly: AssemblyFileVersion("1.0.0.5")]
Loading

0 comments on commit 83e9ee6

Please sign in to comment.