Skip to content

Commit

Permalink
1.0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ImAiiR committed Nov 4, 2024
1 parent 83e9ee6 commit 2ecdc9b
Show file tree
Hide file tree
Showing 5 changed files with 244 additions and 256 deletions.
46 changes: 25 additions & 21 deletions QobuzDownloaderX/Download/RenameTemplates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public string renameTemplates(string template, int paddedTrackLength, int padded
if (QoItem.Version == null) { template = GetSafeFilename(template.Replace("%TrackTitle%", QoItem.Title)); } else { template = GetSafeFilename(template.Replace("%TrackTitle%", QoItem.Title.TrimEnd() + " (" + QoItem.Version + ")")); }
template = GetSafeFilename(template.Replace("%TrackNumber%", QoItem.TrackNumber.ToString().PadLeft(paddedTrackLength, '0')));
template = GetSafeFilename(template.Replace("%ISRC%", QoItem.ISRC.ToString()));
template = GetSafeFilename(template.Replace("%TrackBitDepth%", QoItem.MaximumBitDepth.ToString()));
template = GetSafeFilename(template.Replace("%TrackSampleRate%", QoItem.MaximumSamplingRate.ToString()));

// Track Format Templates
template = GetSafeFilename(template.Replace("%TrackFormat%", fileFormat.ToUpper().TrimStart('.')));
Expand Down Expand Up @@ -112,26 +114,6 @@ public string renameTemplates(string template, int paddedTrackLength, int padded
}

// Album Templates
/* Parental warning tags */
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPA%", "Explicit")); } else { template = GetSafeFilename(template.Replace("%AlbumPA%", "Clean")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAShort%", "E")); } else { template = GetSafeFilename(template.Replace("%AlbumPAShort%", "C")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifEx%", "Explicit")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifEx%", "")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifExShort%", "E")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifExShort%", "")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifCl%", "")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifCl%", "Clean")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifClShort%", "")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifClShort%", "C")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAEnclosed%", "(Explicit)")); } else { template = GetSafeFilename(template.Replace("%AlbumPAEnclosed%", "(Clean)")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAEnclosed[]%", "[Explicit]")); } else { template = GetSafeFilename(template.Replace("%AlbumPAEnclosed[]%", "[Clean]")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAEnclosedShort%", "(E)")); } else { template = GetSafeFilename(template.Replace("%AlbumPAEnclosedShort%", "(C)")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAEnclosedShort[]%", "[E]")); } else { template = GetSafeFilename(template.Replace("%AlbumPAEnclosedShort[]%", "[C]")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosed%", "(Explicit)")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosed%", "")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosed[]%", "[Explicit]")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosed[]%", "")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosedShort%", "(E)")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosedShort%", "")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosedShort[]%", "[E]")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosedShort[]%", "")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosed%", "")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosed%", "(Clean)")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosed[]%", "")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosed[]%", "[Clean]")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosedShort%", "")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosedShort%", "(C)")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosedShort[]%", "")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosedShort[]%", "[C]")); }

if (QoAlbum != null)
{
template = GetSafeFilename(template.Replace("%AlbumID%", QoAlbum.Id.ToString()));
Expand All @@ -145,7 +127,8 @@ public string renameTemplates(string template, int paddedTrackLength, int padded
template = GetSafeFilename(template.Replace("%ReleaseDate%", QoAlbum.ReleaseDateOriginal));
template = GetSafeFilename(template.Replace("%Year%", UInt32.Parse(QoAlbum.ReleaseDateOriginal.Substring(0, 4)).ToString()));
template = GetSafeFilename(template.Replace("%ReleaseType%", char.ToUpper(QoAlbum.ProductType.First()) + QoAlbum.ProductType.Substring(1).ToLower()));

template = GetSafeFilename(template.Replace("%BitDepth%", QoAlbum.MaximumBitDepth.ToString()));
template = GetSafeFilename(template.Replace("%SampleRate%", QoAlbum.MaximumSamplingRate.ToString()));
template = GetSafeFilename(template.Replace("%Format%", fileFormat.ToUpper().TrimStart('.')));

// For albums with multiple main artists listed
Expand All @@ -170,6 +153,27 @@ public string renameTemplates(string template, int paddedTrackLength, int padded
{
template = GetSafeFilename(template.Replace("%ArtistName%", QoAlbum.Artist.Name));
}

/* Parental warning tags */
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPA%", "Explicit")); } else { template = GetSafeFilename(template.Replace("%AlbumPA%", "Clean")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAShort%", "E")); } else { template = GetSafeFilename(template.Replace("%AlbumPAShort%", "C")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifEx%", "Explicit")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifEx%", "")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifExShort%", "E")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifExShort%", "")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifCl%", "")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifCl%", "Clean")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifClShort%", "")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifClShort%", "C")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAEnclosed%", "(Explicit)")); } else { template = GetSafeFilename(template.Replace("%AlbumPAEnclosed%", "(Clean)")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAEnclosed[]%", "[Explicit]")); } else { template = GetSafeFilename(template.Replace("%AlbumPAEnclosed[]%", "[Clean]")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAEnclosedShort%", "(E)")); } else { template = GetSafeFilename(template.Replace("%AlbumPAEnclosedShort%", "(C)")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAEnclosedShort[]%", "[E]")); } else { template = GetSafeFilename(template.Replace("%AlbumPAEnclosedShort[]%", "[C]")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosed%", "(Explicit)")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosed%", "")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosed[]%", "[Explicit]")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosed[]%", "")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosedShort%", "(E)")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosedShort%", "")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosedShort[]%", "[E]")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifExEnclosedShort[]%", "")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosed%", "")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosed%", "(Clean)")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosed[]%", "")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosed[]%", "[Clean]")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosedShort%", "")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosedShort%", "(C)")); }
if (QoAlbum.ParentalWarning == true) { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosedShort[]%", "")); } else { template = GetSafeFilename(template.Replace("%AlbumPAifClEnclosedShort[]%", "[C]")); }

}

// Playlist Templates
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.5")]
[assembly: AssemblyFileVersion("1.0.0.5")]
[assembly: AssemblyVersion("1.0.0.6")]
[assembly: AssemblyFileVersion("1.0.0.6")]
4 changes: 2 additions & 2 deletions QobuzDownloaderX/qbdlxForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions QobuzDownloaderX/qbdlxForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ private void qbdlxForm_Load(object sender, EventArgs e)
upcCheckbox.Checked = Settings.Default.upcTag;
releaseDateCheckbox.Checked = Settings.Default.yearTag;
coverArtCheckbox.Checked = Settings.Default.imageTag;
commentCheckbox.Checked = Settings.Default.commentTag;
commentTextbox.Text = Settings.Default.commentText;
embeddedArtSizeSelect.SelectedIndex = Settings.Default.savedEmbeddedArtSize; embeddedArtSize = embeddedArtSizeSelect.Text;
savedArtSizeSelect.SelectedIndex = Settings.Default.savedSavedArtSize; savedArtSize = savedArtSizeSelect.Text;

Expand Down
Loading

0 comments on commit 2ecdc9b

Please sign in to comment.