update music brainz to fetch overview
This commit is contained in:
parent
5cd3276775
commit
b3595eab6a
|
@ -435,7 +435,8 @@ namespace MediaBrowser.Model.Configuration
|
|||
Limit = 0,
|
||||
Type = ImageType.Disc
|
||||
}
|
||||
}
|
||||
},
|
||||
DisabledMetadataFetchers = new []{ "TheAudioDB" }
|
||||
},
|
||||
|
||||
new MetadataOptions(1, 1280)
|
||||
|
@ -473,7 +474,8 @@ namespace MediaBrowser.Model.Configuration
|
|||
Limit = 0,
|
||||
Type = ImageType.Logo
|
||||
}
|
||||
}
|
||||
},
|
||||
DisabledMetadataFetchers = new []{ "TheAudioDB" }
|
||||
},
|
||||
|
||||
new MetadataOptions(1, 1280)
|
||||
|
|
|
@ -169,6 +169,8 @@ namespace MediaBrowser.Model.Dto
|
|||
/// <value>The game system.</value>
|
||||
public string GameSystem { get; set; }
|
||||
|
||||
public string[] ProductionLocations { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the critic rating summary.
|
||||
/// </summary>
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace MediaBrowser.Model.Providers
|
|||
public string SearchProviderName { get; set; }
|
||||
|
||||
public string GameSystem { get; set; }
|
||||
public string Overview { get; set; }
|
||||
|
||||
public RemoteSearchResult()
|
||||
{
|
||||
|
|
|
@ -85,7 +85,8 @@ namespace MediaBrowser.Providers.Music
|
|||
{
|
||||
var result = new RemoteSearchResult
|
||||
{
|
||||
Name = i.Title
|
||||
Name = i.Title,
|
||||
ProductionYear = i.Year
|
||||
};
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(i.ReleaseId))
|
||||
|
@ -94,7 +95,7 @@ namespace MediaBrowser.Providers.Music
|
|||
}
|
||||
if (!string.IsNullOrWhiteSpace(i.ReleaseGroupId))
|
||||
{
|
||||
result.SetProviderId(MetadataProviders.MusicBrainzAlbum, i.ReleaseGroupId);
|
||||
result.SetProviderId(MetadataProviders.MusicBrainzReleaseGroup, i.ReleaseGroupId);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -117,6 +118,8 @@ namespace MediaBrowser.Providers.Music
|
|||
|
||||
var releaseResult = await GetReleaseResult(artistMusicBrainzId, id.GetAlbumArtist(), id.Name, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (releaseResult != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(releaseResult.ReleaseId))
|
||||
{
|
||||
releaseId = releaseResult.ReleaseId;
|
||||
|
@ -128,6 +131,10 @@ namespace MediaBrowser.Providers.Music
|
|||
releaseGroupId = releaseResult.ReleaseGroupId;
|
||||
result.HasMetadata = true;
|
||||
}
|
||||
|
||||
result.Item.ProductionYear = releaseResult.Year;
|
||||
result.Item.Overview = releaseResult.Overview;
|
||||
}
|
||||
}
|
||||
|
||||
// If we have a release Id but not a release group Id...
|
||||
|
@ -205,6 +212,8 @@ namespace MediaBrowser.Providers.Music
|
|||
public string ReleaseId;
|
||||
public string ReleaseGroupId;
|
||||
public string Title;
|
||||
public string Overview;
|
||||
public int? Year;
|
||||
|
||||
public static List<ReleaseResult> Parse(XmlDocument doc, int? limit = null)
|
||||
{
|
||||
|
@ -237,7 +246,9 @@ namespace MediaBrowser.Providers.Music
|
|||
{
|
||||
ReleaseId = releaseId,
|
||||
ReleaseGroupId = releaseGroupId,
|
||||
Title = GetTitleFromReleaseNode(node)
|
||||
Title = GetValueFromReleaseNode(node, "title"),
|
||||
Overview = GetValueFromReleaseNode(node, "annotation"),
|
||||
Year = GetYearFromReleaseNode(node, "date")
|
||||
});
|
||||
|
||||
if (limit.HasValue && list.Count >= limit.Value)
|
||||
|
@ -251,14 +262,37 @@ namespace MediaBrowser.Providers.Music
|
|||
return list;
|
||||
}
|
||||
|
||||
private static string GetTitleFromReleaseNode(XmlNode node)
|
||||
private static int? GetYearFromReleaseNode(XmlNode node, string name)
|
||||
{
|
||||
var subNodes = node.ChildNodes;
|
||||
if (subNodes != null)
|
||||
{
|
||||
foreach (var subNode in subNodes.Cast<XmlNode>())
|
||||
{
|
||||
if (string.Equals(subNode.Name, "title", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(subNode.Name, name, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
DateTime date;
|
||||
if (DateTime.TryParse(subNode.InnerText, out date))
|
||||
{
|
||||
return date.Year;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static string GetValueFromReleaseNode(XmlNode node, string name)
|
||||
{
|
||||
var subNodes = node.ChildNodes;
|
||||
if (subNodes != null)
|
||||
{
|
||||
foreach (var subNode in subNodes.Cast<XmlNode>())
|
||||
{
|
||||
if (string.Equals(subNode.Name, name, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return subNode.InnerText;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace MediaBrowser.Providers.Music
|
|||
if (node.Attributes != null)
|
||||
{
|
||||
string name = null;
|
||||
|
||||
string overview = null;
|
||||
string mbzId = node.Attributes["id"].Value;
|
||||
|
||||
foreach (var child in node.ChildNodes.Cast<XmlNode>())
|
||||
|
@ -94,7 +94,10 @@ namespace MediaBrowser.Providers.Music
|
|||
if (string.Equals(child.Name, "name", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
name = child.InnerText;
|
||||
break;
|
||||
}
|
||||
if (string.Equals(child.Name, "annotation", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
overview = child.InnerText;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,7 +105,8 @@ namespace MediaBrowser.Providers.Music
|
|||
{
|
||||
var result = new RemoteSearchResult
|
||||
{
|
||||
Name = name
|
||||
Name = name,
|
||||
Overview = overview
|
||||
};
|
||||
|
||||
result.SetProviderId(MetadataProviders.MusicBrainzArtist, mbzId);
|
||||
|
@ -135,6 +139,7 @@ namespace MediaBrowser.Providers.Music
|
|||
{
|
||||
musicBrainzId = singleResult.GetProviderId(MetadataProviders.MusicBrainzArtist);
|
||||
//result.Item.Name = singleResult.Name;
|
||||
result.Item.Overview = singleResult.Overview;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1432,6 +1432,12 @@ namespace MediaBrowser.Server.Implementations.Dto
|
|||
SetBookProperties(dto, book);
|
||||
}
|
||||
|
||||
var movie = item as Movie;
|
||||
if (movie != null)
|
||||
{
|
||||
dto.ProductionLocations = new string[] { };
|
||||
}
|
||||
|
||||
var photo = item as Photo;
|
||||
if (photo != null)
|
||||
{
|
||||
|
|
|
@ -742,7 +742,15 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
|
||||
_saveItemCommand.GetParameter(index++).Value = item.Id;
|
||||
_saveItemCommand.GetParameter(index++).Value = item.GetType().FullName;
|
||||
|
||||
if (TypeRequiresDeserialization(item.GetType()))
|
||||
{
|
||||
_saveItemCommand.GetParameter(index++).Value = _jsonSerializer.SerializeToBytes(item, _memoryStreamProvider);
|
||||
}
|
||||
else
|
||||
{
|
||||
_saveItemCommand.GetParameter(index++).Value = null;
|
||||
}
|
||||
|
||||
_saveItemCommand.GetParameter(index++).Value = item.Path;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user