update music brainz album responses

This commit is contained in:
Luke Pulverenti 2016-06-15 16:14:04 -04:00
parent cc2ac9e387
commit 825f0f3507
2 changed files with 31 additions and 4 deletions

View File

@ -293,11 +293,33 @@ namespace MediaBrowser.Providers.Music
var doc = await GetMusicBrainzResponse(url, false, cancellationToken).ConfigureAwait(false);
var ns = new XmlNamespaceManager(doc.NameTable);
ns.AddNamespace("mb", MusicBrainzBaseUrl + "/ns/mmd-2.0#");
var node = doc.SelectSingleNode("//mb:release-group-list/mb:release-group/@id", ns);
var docElem = doc.DocumentElement;
return node != null ? node.Value : null;
if (docElem == null)
{
return null;
}
var releaseList = docElem.FirstChild;
if (releaseList == null)
{
return null;
}
var nodes = releaseList.ChildNodes;
string releaseGroupId = null;
if (nodes != null)
{
foreach (var node in nodes.Cast<XmlNode>())
{
if (string.Equals(node.Name, "release-group", StringComparison.OrdinalIgnoreCase))
{
return node.Attributes["id"].Value;
}
}
}
return null;
}
/// <summary>

View File

@ -44,6 +44,11 @@ namespace MediaBrowser.XbmcMetadata.Savers
}
else
{
//if (item is Movie)
//{
// list.Add(Path.Combine(item.ContainingFolderPath, "movie.nfo"));
//}
list.Add(Path.ChangeExtension(item.Path, ".nfo"));
}