mirror of
https://github.com/NohamR/QobuzDownloaderX.git
synced 2026-05-17 12:27:11 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba8b9e3eec | ||
|
|
1ead0ed343 | ||
|
|
3962e0f682 |
@@ -232,22 +232,27 @@ namespace QobuzDownloaderX
|
|||||||
|
|
||||||
// return date.ToString("yyyy-MM-dd");
|
// return date.ToString("yyyy-MM-dd");
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
static string DecodeEncodedNonAsciiCharacters(string value)
|
static string DecodeEncodedNonAsciiCharacters(string value)
|
||||||
{
|
{
|
||||||
return Regex.Replace(
|
if (value != null)
|
||||||
|
{
|
||||||
|
return Regex.Replace(
|
||||||
value,
|
value,
|
||||||
@"\\u(?<Value>[a-zA-Z0-9]{4})",
|
@"\\u(?<Value>[a-zA-Z0-9]{4})",
|
||||||
m =>
|
m =>
|
||||||
{
|
{
|
||||||
return ((char)int.Parse(m.Groups["Value"].Value, NumberStyles.HexNumber)).ToString();
|
return ((char)int.Parse(m.Groups["Value"].Value, NumberStyles.HexNumber)).ToString();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static string GetMd5Hash(MD5 md5Hash, string input)
|
static string GetMd5Hash(MD5 md5Hash, string input)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Convert the input string to a byte array and compute the hash.
|
// Convert the input string to a byte array and compute the hash.
|
||||||
byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input));
|
byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input));
|
||||||
|
|
||||||
@@ -640,7 +645,7 @@ namespace QobuzDownloaderX
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// Grab all Track IDs listed on the API.
|
// Grab all Track IDs listed on the API.
|
||||||
string trackIDsPattern = "\"version\":(?:.*?),\"id\":(?<trackId>.*?),";
|
string trackIDsPattern = "\"isrc\":\"(?:.*?)\"(?:.*?)\"version\":(?:.*?),\"id\":(?<trackId>.*?),";
|
||||||
string trackIDsInput = albumIDResponseString;
|
string trackIDsInput = albumIDResponseString;
|
||||||
RegexOptions trackIDsOptions = RegexOptions.Multiline;
|
RegexOptions trackIDsOptions = RegexOptions.Multiline;
|
||||||
|
|
||||||
@@ -672,8 +677,12 @@ namespace QobuzDownloaderX
|
|||||||
albumArtistPath = GetSafeFilename(albumArtist);
|
albumArtistPath = GetSafeFilename(albumArtist);
|
||||||
albumArtistTextBox.Invoke(new Action(() => albumArtistTextBox.Text = albumArtist));
|
albumArtistTextBox.Invoke(new Action(() => albumArtistTextBox.Text = albumArtist));
|
||||||
|
|
||||||
performerName = (string)joTrackResponse["performer"]["name"]; performerName = DecodeEncodedNonAsciiCharacters(performerName);
|
try
|
||||||
performerNamePath = GetSafeFilename(performerName);
|
{
|
||||||
|
performerName = (string)joTrackResponse["performer"]["name"]; performerName = DecodeEncodedNonAsciiCharacters(performerName);
|
||||||
|
performerNamePath = GetSafeFilename(performerName);
|
||||||
|
}
|
||||||
|
catch { performerName = null; performerNamePath = null; /*Set to null and Ignore if fails*/ }
|
||||||
|
|
||||||
try { composerName = (string)joTrackResponse["composer"]["name"]; composerName = DecodeEncodedNonAsciiCharacters(composerName); } catch { /*Ignore if fails*/ }
|
try { composerName = (string)joTrackResponse["composer"]["name"]; composerName = DecodeEncodedNonAsciiCharacters(composerName); } catch { /*Ignore if fails*/ }
|
||||||
|
|
||||||
@@ -804,9 +813,12 @@ namespace QobuzDownloaderX
|
|||||||
albumArtistPath = albumArtistPath.Substring(0, MaxLength).TrimEnd();
|
albumArtistPath = albumArtistPath.Substring(0, MaxLength).TrimEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (performerNamePath.Length > MaxLength)
|
if (performerName != null)
|
||||||
{
|
{
|
||||||
performerNamePath = performerNamePath.Substring(0, MaxLength).TrimEnd();
|
if (performerNamePath.Length > MaxLength)
|
||||||
|
{
|
||||||
|
performerNamePath = performerNamePath.Substring(0, MaxLength).TrimEnd();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (albumNamePath.Length > MaxLength)
|
if (albumNamePath.Length > MaxLength)
|
||||||
@@ -1438,7 +1450,7 @@ namespace QobuzDownloaderX
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// Grab all Track IDs listed on the API.
|
// Grab all Track IDs listed on the API.
|
||||||
string trackIDsPattern = "\"version\":(?:.*?),\"id\":(?<trackId>.*?),";
|
string trackIDsPattern = "\"isrc\":\"(?:.*?)\"(?:.*?)\"version\":(?:.*?),\"id\":(?<trackId>.*?),";
|
||||||
string trackIDsInput = albumIDResponseString;
|
string trackIDsInput = albumIDResponseString;
|
||||||
RegexOptions trackIDsOptions = RegexOptions.Multiline;
|
RegexOptions trackIDsOptions = RegexOptions.Multiline;
|
||||||
|
|
||||||
@@ -1470,8 +1482,12 @@ namespace QobuzDownloaderX
|
|||||||
albumArtistPath = GetSafeFilename(albumArtist);
|
albumArtistPath = GetSafeFilename(albumArtist);
|
||||||
albumArtistTextBox.Invoke(new Action(() => albumArtistTextBox.Text = albumArtist));
|
albumArtistTextBox.Invoke(new Action(() => albumArtistTextBox.Text = albumArtist));
|
||||||
|
|
||||||
performerName = (string)joTrackResponse["performer"]["name"]; performerName = DecodeEncodedNonAsciiCharacters(performerName);
|
try
|
||||||
performerNamePath = GetSafeFilename(performerName);
|
{
|
||||||
|
performerName = (string)joTrackResponse["performer"]["name"]; performerName = DecodeEncodedNonAsciiCharacters(performerName);
|
||||||
|
performerNamePath = GetSafeFilename(performerName);
|
||||||
|
}
|
||||||
|
catch { performerName = null; performerNamePath = null; /*Set to null and Ignore if fails*/ }
|
||||||
|
|
||||||
try { composerName = (string)joTrackResponse["composer"]["name"]; composerName = DecodeEncodedNonAsciiCharacters(composerName); } catch { /*Ignore if fails*/ }
|
try { composerName = (string)joTrackResponse["composer"]["name"]; composerName = DecodeEncodedNonAsciiCharacters(composerName); } catch { /*Ignore if fails*/ }
|
||||||
|
|
||||||
@@ -1602,9 +1618,12 @@ namespace QobuzDownloaderX
|
|||||||
albumArtistPath = albumArtistPath.Substring(0, MaxLength).TrimEnd();
|
albumArtistPath = albumArtistPath.Substring(0, MaxLength).TrimEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (performerNamePath.Length > MaxLength)
|
if (performerName != null)
|
||||||
{
|
{
|
||||||
performerNamePath = performerNamePath.Substring(0, MaxLength).TrimEnd();
|
if (performerNamePath.Length > MaxLength)
|
||||||
|
{
|
||||||
|
performerNamePath = performerNamePath.Substring(0, MaxLength).TrimEnd();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (albumNamePath.Length > MaxLength)
|
if (albumNamePath.Length > MaxLength)
|
||||||
@@ -2237,7 +2256,7 @@ namespace QobuzDownloaderX
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// Grab all Track IDs listed on the API.
|
// Grab all Track IDs listed on the API.
|
||||||
string trackIDsPattern = "\"version\":(?:.*?),\"id\":(?<trackId>.*?),";
|
string trackIDsPattern = "\"isrc\":\"(?:.*?)\"(?:.*?)\"version\":(?:.*?),\"id\":(?<trackId>.*?),";
|
||||||
string trackIDsInput = albumIDResponseString;
|
string trackIDsInput = albumIDResponseString;
|
||||||
RegexOptions trackIDsOptions = RegexOptions.Multiline;
|
RegexOptions trackIDsOptions = RegexOptions.Multiline;
|
||||||
|
|
||||||
@@ -2269,8 +2288,12 @@ namespace QobuzDownloaderX
|
|||||||
albumArtistPath = GetSafeFilename(albumArtist);
|
albumArtistPath = GetSafeFilename(albumArtist);
|
||||||
albumArtistTextBox.Invoke(new Action(() => albumArtistTextBox.Text = albumArtist));
|
albumArtistTextBox.Invoke(new Action(() => albumArtistTextBox.Text = albumArtist));
|
||||||
|
|
||||||
performerName = (string)joTrackResponse["performer"]["name"]; performerName = DecodeEncodedNonAsciiCharacters(albumArtist);
|
try
|
||||||
performerNamePath = GetSafeFilename(performerName);
|
{
|
||||||
|
performerName = (string)joTrackResponse["performer"]["name"]; performerName = DecodeEncodedNonAsciiCharacters(performerName);
|
||||||
|
performerNamePath = GetSafeFilename(performerName);
|
||||||
|
}
|
||||||
|
catch { performerName = null; performerNamePath = null; /*Set to null and Ignore if fails*/ }
|
||||||
|
|
||||||
try { composerName = (string)joTrackResponse["composer"]["name"]; composerName = DecodeEncodedNonAsciiCharacters(composerName); } catch { /*Ignore if fails*/ }
|
try { composerName = (string)joTrackResponse["composer"]["name"]; composerName = DecodeEncodedNonAsciiCharacters(composerName); } catch { /*Ignore if fails*/ }
|
||||||
|
|
||||||
@@ -2401,9 +2424,12 @@ namespace QobuzDownloaderX
|
|||||||
albumArtistPath = albumArtistPath.Substring(0, MaxLength).TrimEnd();
|
albumArtistPath = albumArtistPath.Substring(0, MaxLength).TrimEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (performerNamePath.Length > MaxLength)
|
if (performerName != null)
|
||||||
{
|
{
|
||||||
performerNamePath = performerNamePath.Substring(0, MaxLength).TrimEnd();
|
if (performerNamePath.Length > MaxLength)
|
||||||
|
{
|
||||||
|
performerNamePath = performerNamePath.Substring(0, MaxLength).TrimEnd();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (albumNamePath.Length > MaxLength)
|
if (albumNamePath.Length > MaxLength)
|
||||||
@@ -3004,7 +3030,7 @@ namespace QobuzDownloaderX
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// Grab all Track IDs listed on the API.
|
// Grab all Track IDs listed on the API.
|
||||||
string trackIDsPattern = "\"version\":(?:.*?),\"id\":(?<trackId>.*?),";
|
string trackIDsPattern = "\"isrc\":\"(?:.*?)\"(?:.*?)\"version\":(?:.*?),\"id\":(?<trackId>.*?),";
|
||||||
string trackIDsInput = albumIDResponseString;
|
string trackIDsInput = albumIDResponseString;
|
||||||
RegexOptions trackIDsOptions = RegexOptions.Multiline;
|
RegexOptions trackIDsOptions = RegexOptions.Multiline;
|
||||||
|
|
||||||
@@ -3035,10 +3061,14 @@ namespace QobuzDownloaderX
|
|||||||
albumArtistPath = GetSafeFilename(albumArtist);
|
albumArtistPath = GetSafeFilename(albumArtist);
|
||||||
albumArtistTextBox.Invoke(new Action(() => albumArtistTextBox.Text = albumArtist));
|
albumArtistTextBox.Invoke(new Action(() => albumArtistTextBox.Text = albumArtist));
|
||||||
|
|
||||||
performerName = (string)joTrackResponse["performer"]["name"]; performerName = DecodeEncodedNonAsciiCharacters(performerName);
|
try
|
||||||
performerNamePath = GetSafeFilename(performerName);
|
{
|
||||||
|
performerName = (string)joTrackResponse["performer"]["name"]; performerName = DecodeEncodedNonAsciiCharacters(performerName);
|
||||||
|
performerNamePath = GetSafeFilename(performerName);
|
||||||
|
}
|
||||||
|
catch { performerName = null; performerNamePath = null; /*Set to null and Ignore if fails*/ }
|
||||||
|
|
||||||
try { composerName = (string)joTrackResponse["composer"]["name"]; composerName = DecodeEncodedNonAsciiCharacters(composerName); } catch { /*Ignore if fails*/ }
|
try { composerName = (string)joTrackResponse["composer"]["name"]; composerName = DecodeEncodedNonAsciiCharacters(composerName); } catch { composerName = null; /*Set to null and Ignore if fails*/ }
|
||||||
|
|
||||||
advisory = (string)joTrackResponse["parental_warning"];
|
advisory = (string)joTrackResponse["parental_warning"];
|
||||||
|
|
||||||
@@ -3167,9 +3197,12 @@ namespace QobuzDownloaderX
|
|||||||
albumArtistPath = albumArtistPath.Substring(0, MaxLength).TrimEnd();
|
albumArtistPath = albumArtistPath.Substring(0, MaxLength).TrimEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (performerNamePath.Length > MaxLength)
|
if (performerName != null)
|
||||||
{
|
{
|
||||||
performerNamePath = performerNamePath.Substring(0, MaxLength).TrimEnd();
|
if (performerNamePath.Length > MaxLength)
|
||||||
|
{
|
||||||
|
performerNamePath = performerNamePath.Substring(0, MaxLength).TrimEnd();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (albumNamePath.Length > MaxLength)
|
if (albumNamePath.Length > MaxLength)
|
||||||
@@ -3748,10 +3781,14 @@ namespace QobuzDownloaderX
|
|||||||
albumArtistPath = GetSafeFilename(albumArtist);
|
albumArtistPath = GetSafeFilename(albumArtist);
|
||||||
albumArtistTextBox.Invoke(new Action(() => albumArtistTextBox.Text = albumArtist));
|
albumArtistTextBox.Invoke(new Action(() => albumArtistTextBox.Text = albumArtist));
|
||||||
|
|
||||||
performerName = (string)joResponse2["performer"]["name"]; performerName = DecodeEncodedNonAsciiCharacters(performerName);
|
try
|
||||||
performerNamePath = GetSafeFilename(performerName);
|
{
|
||||||
|
performerName = (string)joResponse2["performer"]["name"]; performerName = DecodeEncodedNonAsciiCharacters(performerName);
|
||||||
|
performerNamePath = GetSafeFilename(performerName);
|
||||||
|
}
|
||||||
|
catch { performerName = null; performerNamePath = null; /*Set to null and Ignore if fails*/ }
|
||||||
|
|
||||||
try { composerName = (string)joResponse2["composer"]["name"]; composerName = DecodeEncodedNonAsciiCharacters(composerName); } catch { /*Ignore if fails*/ }
|
try { composerName = (string)joResponse2["composer"]["name"]; composerName = DecodeEncodedNonAsciiCharacters(composerName); } catch { composerName = null; /*Set to null and Ignore if fails*/ }
|
||||||
|
|
||||||
advisory = (string)joResponse2["parental_warning"];
|
advisory = (string)joResponse2["parental_warning"];
|
||||||
|
|
||||||
@@ -3880,9 +3917,12 @@ namespace QobuzDownloaderX
|
|||||||
albumArtistPath = albumArtistPath.Substring(0, MaxLength).TrimEnd();
|
albumArtistPath = albumArtistPath.Substring(0, MaxLength).TrimEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (performerNamePath.Length > MaxLength)
|
if (performerName != null)
|
||||||
{
|
{
|
||||||
performerNamePath = performerNamePath.Substring(0, MaxLength).TrimEnd();
|
if (performerNamePath.Length > MaxLength)
|
||||||
|
{
|
||||||
|
performerNamePath = performerNamePath.Substring(0, MaxLength).TrimEnd();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (albumNamePath.Length > MaxLength)
|
if (albumNamePath.Length > MaxLength)
|
||||||
|
|||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.9.9.17")]
|
[assembly: AssemblyVersion("0.9.9.19")]
|
||||||
[assembly: AssemblyFileVersion("0.9.9.17")]
|
[assembly: AssemblyFileVersion("0.9.9.19")]
|
||||||
|
|||||||
Reference in New Issue
Block a user