mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-16 02:18:54 -07:00
verify last fm data a little better
This commit is contained in:
parent
e01202030d
commit
e036b2c416
@ -220,7 +220,7 @@ namespace MediaBrowser.Controller.Providers.Music
|
|||||||
{
|
{
|
||||||
Url = url,
|
Url = url,
|
||||||
CancellationToken = cancellationToken,
|
CancellationToken = cancellationToken,
|
||||||
UserAgent = "MediaBrowserServer/www.mediabrowser3.com",
|
UserAgent = Environment.MachineName + "-" + Environment.UserName,
|
||||||
EnableResponseCache = true
|
EnableResponseCache = true
|
||||||
|
|
||||||
}).ConfigureAwait(false))
|
}).ConfigureAwait(false))
|
||||||
|
@ -117,8 +117,13 @@ namespace MediaBrowser.Controller.Providers.Music
|
|||||||
|
|
||||||
if (searchResult != null && searchResult.results != null && searchResult.results.artistmatches != null && searchResult.results.artistmatches.artist.Count > 0)
|
if (searchResult != null && searchResult.results != null && searchResult.results.artistmatches != null && searchResult.results.artistmatches.artist.Count > 0)
|
||||||
{
|
{
|
||||||
var artist = searchResult.results.artistmatches.artist.FirstOrDefault(i => i.name != null && string.Compare(i.name, item.Name, CultureInfo.CurrentCulture, CompareOptions.IgnoreNonSpace) == 0) ??
|
var artist = searchResult.results.artistmatches.artist
|
||||||
searchResult.results.artistmatches.artist.First();
|
.FirstOrDefault(i => i.name != null && string.Compare(i.name, item.Name, CultureInfo.CurrentCulture, CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase | CompareOptions.IgnoreSymbols) == 0);
|
||||||
|
|
||||||
|
if (artist == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return artist.mbid;
|
return artist.mbid;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user