mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
fixes #397 - WB web client - Missing person metadata field
This commit is contained in:
parent
2646ce696b
commit
f7bce0bc3c
@ -225,6 +225,7 @@ namespace MediaBrowser.Api
|
|||||||
item.EndDate = request.EndDate.HasValue ? request.EndDate.Value.ToUniversalTime() : (DateTime?)null;
|
item.EndDate = request.EndDate.HasValue ? request.EndDate.Value.ToUniversalTime() : (DateTime?)null;
|
||||||
item.PremiereDate = request.PremiereDate.HasValue ? request.PremiereDate.Value.ToUniversalTime() : (DateTime?)null;
|
item.PremiereDate = request.PremiereDate.HasValue ? request.PremiereDate.Value.ToUniversalTime() : (DateTime?)null;
|
||||||
item.ProductionYear = request.ProductionYear;
|
item.ProductionYear = request.ProductionYear;
|
||||||
|
item.ProductionLocations = request.ProductionLocations;
|
||||||
item.AspectRatio = request.AspectRatio;
|
item.AspectRatio = request.AspectRatio;
|
||||||
item.Language = request.Language;
|
item.Language = request.Language;
|
||||||
item.OfficialRating = request.OfficialRating;
|
item.OfficialRating = request.OfficialRating;
|
||||||
|
@ -1279,11 +1279,6 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
throw new ArgumentNullException("location");
|
throw new ArgumentNullException("location");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ProductionLocations == null)
|
|
||||||
{
|
|
||||||
ProductionLocations = new List<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ProductionLocations.Contains(location, StringComparer.OrdinalIgnoreCase))
|
if (!ProductionLocations.Contains(location, StringComparer.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
ProductionLocations.Add(location);
|
ProductionLocations.Add(location);
|
||||||
|
@ -211,6 +211,18 @@ namespace MediaBrowser.Controller.Providers
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "PlaceOfBirth":
|
||||||
|
{
|
||||||
|
var val = reader.ReadElementContentAsString();
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(val))
|
||||||
|
{
|
||||||
|
item.ProductionLocations = new List<string> { val };
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case "Website":
|
case "Website":
|
||||||
{
|
{
|
||||||
var val = reader.ReadElementContentAsString();
|
var val = reader.ReadElementContentAsString();
|
||||||
@ -465,6 +477,24 @@ namespace MediaBrowser.Controller.Providers
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "DeathDate":
|
||||||
|
case "EndDate":
|
||||||
|
{
|
||||||
|
var firstAired = reader.ReadElementContentAsString();
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(firstAired))
|
||||||
|
{
|
||||||
|
DateTime airDate;
|
||||||
|
|
||||||
|
if (DateTime.TryParse(firstAired, out airDate) && airDate.Year > 1850)
|
||||||
|
{
|
||||||
|
item.EndDate = airDate.ToUniversalTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case "TvDbId":
|
case "TvDbId":
|
||||||
var tvdbId = reader.ReadElementContentAsString();
|
var tvdbId = reader.ReadElementContentAsString();
|
||||||
if (!string.IsNullOrWhiteSpace(tvdbId))
|
if (!string.IsNullOrWhiteSpace(tvdbId))
|
||||||
|
@ -233,9 +233,12 @@ namespace MediaBrowser.Providers.Movies
|
|||||||
person.HomePageUrl = searchResult.homepage;
|
person.HomePageUrl = searchResult.homepage;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(searchResult.place_of_birth))
|
if (!person.LockedFields.Contains(MetadataFields.ProductionLocations))
|
||||||
{
|
{
|
||||||
person.AddProductionLocation(searchResult.place_of_birth);
|
if (!string.IsNullOrEmpty(searchResult.place_of_birth))
|
||||||
|
{
|
||||||
|
person.ProductionLocations = new List<string> { searchResult.place_of_birth };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
person.SetProviderId(MetadataProviders.Tmdb, searchResult.id.ToString(UsCulture));
|
person.SetProviderId(MetadataProviders.Tmdb, searchResult.id.ToString(UsCulture));
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using MediaBrowser.Controller.Entities;
|
using System.Security;
|
||||||
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Providers.Movies;
|
using MediaBrowser.Providers.Movies;
|
||||||
using System;
|
using System;
|
||||||
@ -47,11 +48,19 @@ namespace MediaBrowser.Providers.Savers
|
|||||||
|
|
||||||
XmlSaverHelpers.AddCommonNodes(item, builder);
|
XmlSaverHelpers.AddCommonNodes(item, builder);
|
||||||
|
|
||||||
|
if (item.ProductionLocations.Count > 0)
|
||||||
|
{
|
||||||
|
builder.Append("<PlaceOfBirth>" + SecurityElement.Escape(item.ProductionLocations[0]) + "</PlaceOfBirth>");
|
||||||
|
}
|
||||||
|
|
||||||
builder.Append("</Item>");
|
builder.Append("</Item>");
|
||||||
|
|
||||||
var xmlFilePath = GetSavePath(item);
|
var xmlFilePath = GetSavePath(item);
|
||||||
|
|
||||||
XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { });
|
XmlSaverHelpers.Save(builder, xmlFilePath, new[]
|
||||||
|
{
|
||||||
|
"PlaceOfBirth"
|
||||||
|
});
|
||||||
|
|
||||||
// Set last refreshed so that the provider doesn't trigger after the file save
|
// Set last refreshed so that the provider doesn't trigger after the file save
|
||||||
PersonProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow);
|
PersonProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow);
|
||||||
|
@ -47,6 +47,7 @@ namespace MediaBrowser.Providers.Savers
|
|||||||
"LocalTitle",
|
"LocalTitle",
|
||||||
"SortTitle",
|
"SortTitle",
|
||||||
"PremiereDate",
|
"PremiereDate",
|
||||||
|
"EndDate",
|
||||||
"Budget",
|
"Budget",
|
||||||
"Revenue",
|
"Revenue",
|
||||||
"Rating",
|
"Rating",
|
||||||
@ -74,7 +75,9 @@ namespace MediaBrowser.Providers.Savers
|
|||||||
"Trailer",
|
"Trailer",
|
||||||
"CriticRating",
|
"CriticRating",
|
||||||
"CriticRatingSummary",
|
"CriticRatingSummary",
|
||||||
"GamesDbId"
|
"GamesDbId",
|
||||||
|
"BirthDate",
|
||||||
|
"DeathDate"
|
||||||
});
|
});
|
||||||
|
|
||||||
var position = xml.ToString().LastIndexOf("</", StringComparison.OrdinalIgnoreCase);
|
var position = xml.ToString().LastIndexOf("</", StringComparison.OrdinalIgnoreCase);
|
||||||
@ -210,6 +213,18 @@ namespace MediaBrowser.Providers.Savers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.EndDate.HasValue)
|
||||||
|
{
|
||||||
|
if (item is Person)
|
||||||
|
{
|
||||||
|
builder.Append("<DeathDate>" + SecurityElement.Escape(item.EndDate.Value.ToString("yyyy-MM-dd")) + "</DeathDate>");
|
||||||
|
}
|
||||||
|
else if (!(item is Episode))
|
||||||
|
{
|
||||||
|
builder.Append("<EndDate>" + SecurityElement.Escape(item.EndDate.Value.ToString("yyyy-MM-dd")) + "</EndDate>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (item.RemoteTrailers.Count > 0)
|
if (item.RemoteTrailers.Count > 0)
|
||||||
{
|
{
|
||||||
builder.Append("<Trailer>" + SecurityElement.Escape(item.RemoteTrailers[0].Url) + "</Trailer>");
|
builder.Append("<Trailer>" + SecurityElement.Escape(item.RemoteTrailers[0].Url) + "</Trailer>");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user