diff --git a/QobuzDownloaderX/App.config b/QobuzDownloaderX/App.config index e3a200c..f301413 100644 --- a/QobuzDownloaderX/App.config +++ b/QobuzDownloaderX/App.config @@ -153,6 +153,9 @@ True + + True + \ No newline at end of file diff --git a/QobuzDownloaderX/Models/Download/DownloadItemInfo.cs b/QobuzDownloaderX/Models/Download/DownloadItemInfo.cs index e357ae3..8e7f97b 100644 --- a/QobuzDownloaderX/Models/Download/DownloadItemInfo.cs +++ b/QobuzDownloaderX/Models/Download/DownloadItemInfo.cs @@ -42,6 +42,7 @@ public class DownloadItemInfo public string FrontCoverImgTagUrl { get; set; } public string FrontCoverImgBoxUrl { get; set; } public string MediaType { get; set; } + public string Url { get; set; } // Info / Tagging numbers public int DiscNumber { get; set; } @@ -74,6 +75,7 @@ private void ClearAlbumTaggingInfo() ReleaseDate = null; Upc = null; MediaType = null; + Url = null; // Clear tag numbers TrackTotal = 0; @@ -156,6 +158,7 @@ public void SetAlbumTaggingInfo(Album qobuzAlbum) ReleaseDate = StringTools.FormatDateTimeOffset(qobuzAlbum.ReleaseDateStream); Upc = qobuzAlbum.Upc; MediaType = qobuzAlbum.ReleaseType; + Url = qobuzAlbum.Url; // Grab tag ints TrackTotal = qobuzAlbum.TracksCount.GetValueOrDefault(); diff --git a/QobuzDownloaderX/Properties/Settings.Designer.cs b/QobuzDownloaderX/Properties/Settings.Designer.cs index 8257815..8835dfd 100644 --- a/QobuzDownloaderX/Properties/Settings.Designer.cs +++ b/QobuzDownloaderX/Properties/Settings.Designer.cs @@ -606,5 +606,17 @@ public bool releaseDateTag { this["releaseDateTag"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool urlTag { + get { + return ((bool)(this["urlTag"])); + } + set { + this["urlTag"] = value; + } + } } } diff --git a/QobuzDownloaderX/Properties/Settings.settings b/QobuzDownloaderX/Properties/Settings.settings index 31932b9..4580714 100644 --- a/QobuzDownloaderX/Properties/Settings.settings +++ b/QobuzDownloaderX/Properties/Settings.settings @@ -137,5 +137,8 @@ True + + True + \ No newline at end of file diff --git a/QobuzDownloaderX/Shared/TaggingOptions.cs b/QobuzDownloaderX/Shared/TaggingOptions.cs index 43566c1..36ece3d 100644 --- a/QobuzDownloaderX/Shared/TaggingOptions.cs +++ b/QobuzDownloaderX/Shared/TaggingOptions.cs @@ -25,6 +25,7 @@ internal class TaggingOptions public bool WriteLabelTag { get; set; } public bool WriteInvolvedPeopleTag { get; set; } public bool MergePerformers { get; set; } + public bool WriteUrlTag { get; set; } public string CommentTag { get; set; } public string ArtSize { get; set; } public string PrimaryListSeparator { get; set; } diff --git a/QobuzDownloaderX/Shared/Tools/AudioFileTagger.cs b/QobuzDownloaderX/Shared/Tools/AudioFileTagger.cs index 4fc1b08..82e3569 100644 --- a/QobuzDownloaderX/Shared/Tools/AudioFileTagger.cs +++ b/QobuzDownloaderX/Shared/Tools/AudioFileTagger.cs @@ -139,6 +139,9 @@ public static void AddMetaDataTags(DownloadItemInfo fileInfo, string tagFilePath // Release Type tag if (fileInfo.MediaType != null && Globals.TaggingOptions.WriteMediaTypeTag) { customId3v2.SetTextFrame("TMED", fileInfo.MediaType); } + // Album store URL tag + if (fileInfo.Url != null && Globals.TaggingOptions.WriteUrlTag) { customId3v2.SetTextFrame("WCOM", fileInfo.Url); } + // Save all selected tags to file tfile.Save(); @@ -292,6 +295,9 @@ public static void AddMetaDataTags(DownloadItemInfo fileInfo, string tagFilePath if (fileInfo.Advisory == true) { custom.SetField("ITUNESADVISORY", "1"); } else { custom.SetField("ITUNESADVISORY", "0"); } } + // Album store URL tag + if (fileInfo.Url != null && Globals.TaggingOptions.WriteUrlTag) { custom.SetField("URL", fileInfo.Url); } + // Save all selected tags to file tfile.Save(); diff --git a/QobuzDownloaderX/View/MainForm.Designer.cs b/QobuzDownloaderX/View/MainForm.Designer.cs index 9de7235..7c2d87b 100644 --- a/QobuzDownloaderX/View/MainForm.Designer.cs +++ b/QobuzDownloaderX/View/MainForm.Designer.cs @@ -125,6 +125,7 @@ private void InitializeComponent() this.mergePerformersCheckBox = new System.Windows.Forms.CheckBox(); this.mergeListsToolTip = new System.Windows.Forms.ToolTip(this.components); this.releaseDateCheckbox = new System.Windows.Forms.CheckBox(); + this.urlCheckBox = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.albumArtPicBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.logoBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.profilePictureBox)).BeginInit(); @@ -1294,12 +1295,28 @@ private void InitializeComponent() this.releaseDateCheckbox.UseVisualStyleBackColor = true; this.releaseDateCheckbox.CheckedChanged += new System.EventHandler(this.ReleaseDateCheckbox_CheckedChanged); // + // urlCheckBox + // + this.urlCheckBox.AutoSize = true; + this.urlCheckBox.Checked = true; + this.urlCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.urlCheckBox.FlatAppearance.BorderSize = 0; + this.urlCheckBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); + this.urlCheckBox.Location = new System.Drawing.Point(696, 567); + this.urlCheckBox.Name = "urlCheckBox"; + this.urlCheckBox.Size = new System.Drawing.Size(48, 17); + this.urlCheckBox.TabIndex = 120; + this.urlCheckBox.Text = "URL"; + this.urlCheckBox.UseVisualStyleBackColor = true; + this.urlCheckBox.CheckedChanged += new System.EventHandler(this.UrlCheckbox_CheckedChanged); + // // QobuzDownloaderX // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); this.ClientSize = new System.Drawing.Size(938, 660); + this.Controls.Add(this.urlCheckBox); this.Controls.Add(this.mergePerformersCheckBox); this.Controls.Add(this.ListEndSeparatorLabel); this.Controls.Add(this.panel11); @@ -1507,6 +1524,7 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox mergePerformersCheckBox; private System.Windows.Forms.ToolTip mergeListsToolTip; private System.Windows.Forms.CheckBox releaseDateCheckbox; + private System.Windows.Forms.CheckBox urlCheckBox; } } diff --git a/QobuzDownloaderX/View/MainForm.cs b/QobuzDownloaderX/View/MainForm.cs index fafce36..368a2f8 100644 --- a/QobuzDownloaderX/View/MainForm.cs +++ b/QobuzDownloaderX/View/MainForm.cs @@ -124,7 +124,8 @@ private void MainForm_Load(object sender, EventArgs e) WriteUpcTag = Settings.Default.upcTag, WriteReleaseYearTag = Settings.Default.yearTag, WriteReleaseDateTag = Settings.Default.releaseDateTag, - WriteCoverImageTag = Settings.Default.imageTag + WriteCoverImageTag = Settings.Default.imageTag, + WriteUrlTag = Settings.Default.urlTag }; // Set saved settings to correct places. @@ -153,6 +154,7 @@ private void MainForm_Load(object sender, EventArgs e) releasYearCheckbox.Checked = Settings.Default.yearTag; releaseDateCheckbox.Checked = Settings.Default.releaseDateTag; imageCheckbox.Checked = Settings.Default.imageTag; + urlCheckBox.Checked = Settings.Default.urlTag; mp3Checkbox.Checked = Settings.Default.quality1; flacLowCheckbox.Checked = Settings.Default.quality2; flacMidCheckbox.Checked = Settings.Default.quality3; @@ -640,6 +642,13 @@ private void ListEndSeparatorTextbox_TextChanged(object sender, EventArgs e) } } + private void UrlCheckbox_CheckedChanged(object sender, EventArgs e) + { + Settings.Default.urlTag = urlCheckBox.Checked; + Settings.Default.Save(); + Globals.TaggingOptions.WriteUrlTag = urlCheckBox.Checked; + } + private void flacHighCheckbox_CheckedChanged(object sender, EventArgs e) { Settings.Default.quality4 = flacHighCheckbox.Checked;