persist locked fields in xml
This commit is contained in:
parent
f05ec44742
commit
06ec5ebcb9
|
@ -1064,6 +1064,8 @@ namespace MediaBrowser.Controller.Entities
|
|||
{
|
||||
try
|
||||
{
|
||||
Logger.Debug("Found shortcut at {0}", i.FullName);
|
||||
|
||||
return new LinkedChild
|
||||
{
|
||||
Path = FileSystem.ResolveShortcut(i.FullName),
|
||||
|
@ -1082,6 +1084,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
if (!newShortcutLinks.SequenceEqual(currentShortcutLinks))
|
||||
{
|
||||
Logger.Info("Shortcut links have changed for {0}", Path);
|
||||
|
||||
newShortcutLinks.AddRange(currentManualLinks);
|
||||
LinkedChildren = newShortcutLinks;
|
||||
return true;
|
||||
|
|
|
@ -235,6 +235,35 @@ namespace MediaBrowser.Controller.Providers
|
|||
break;
|
||||
}
|
||||
|
||||
case "LockedFields":
|
||||
{
|
||||
var fields = new List<MetadataFields>();
|
||||
|
||||
var val = reader.ReadElementContentAsString();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(val))
|
||||
{
|
||||
var list = val.Split('|').Select(i =>
|
||||
{
|
||||
MetadataFields field;
|
||||
|
||||
if (Enum.TryParse<MetadataFields>(i, true, out field))
|
||||
{
|
||||
return (MetadataFields?)field;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}).Where(i => i.HasValue).Select(i => i.Value);
|
||||
|
||||
fields.AddRange(list);
|
||||
}
|
||||
|
||||
item.LockedFields = fields;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "TagLines":
|
||||
{
|
||||
FetchFromTaglinesNode(reader.ReadSubtree(), item);
|
||||
|
|
|
@ -107,6 +107,8 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||
audio.Name = title;
|
||||
}
|
||||
|
||||
if (!audio.LockedFields.Contains(MetadataFields.Cast))
|
||||
{
|
||||
var composer = GetDictionaryValue(tags, "composer");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(composer))
|
||||
|
@ -121,6 +123,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
audio.Album = GetDictionaryValue(tags, "album");
|
||||
|
||||
|
@ -148,13 +151,19 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||
audio.ProductionYear = audio.PremiereDate.Value.ToLocalTime().Year;
|
||||
}
|
||||
|
||||
if (!audio.LockedFields.Contains(MetadataFields.Genres))
|
||||
{
|
||||
FetchGenres(audio, tags);
|
||||
}
|
||||
|
||||
if (!audio.LockedFields.Contains(MetadataFields.Studios))
|
||||
{
|
||||
// There's several values in tags may or may not be present
|
||||
FetchStudios(audio, tags, "organization");
|
||||
FetchStudios(audio, tags, "ensemble");
|
||||
FetchStudios(audio, tags, "publisher");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Splits the specified val.
|
||||
|
|
|
@ -300,6 +300,8 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||
return;
|
||||
}
|
||||
|
||||
if (!video.LockedFields.Contains(MetadataFields.Genres))
|
||||
{
|
||||
var genres = GetDictionaryValue(data.format.tags, "genre");
|
||||
|
||||
if (!string.IsNullOrEmpty(genres))
|
||||
|
@ -309,6 +311,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||
.Select(i => i.Trim())
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
var overview = GetDictionaryValue(data.format.tags, "WM/SubTitleDescription");
|
||||
|
||||
|
|
|
@ -77,7 +77,8 @@ namespace MediaBrowser.Providers.Savers
|
|||
"CriticRatingSummary",
|
||||
"GamesDbId",
|
||||
"BirthDate",
|
||||
"DeathDate"
|
||||
"DeathDate",
|
||||
"LockedFields"
|
||||
});
|
||||
|
||||
var position = xml.ToString().LastIndexOf("</", StringComparison.OrdinalIgnoreCase);
|
||||
|
@ -166,6 +167,11 @@ namespace MediaBrowser.Providers.Savers
|
|||
|
||||
builder.Append("<LockData>" + item.DontFetchMeta.ToString().ToLower() + "</LockData>");
|
||||
|
||||
if (item.LockedFields.Count > 0)
|
||||
{
|
||||
builder.Append("<LockedFields>" + string.Join("|", item.LockedFields.Select(i => i.ToString()).ToArray()) + "</LockedFields>");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(item.DisplayMediaType))
|
||||
{
|
||||
builder.Append("<Type>" + SecurityElement.Escape(item.DisplayMediaType) + "</Type>");
|
||||
|
|
|
@ -179,16 +179,10 @@ namespace MediaBrowser.Providers.TV
|
|||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
BaseProviderInfo data;
|
||||
|
||||
if (!item.ProviderData.TryGetValue(Id, out data))
|
||||
{
|
||||
data = new BaseProviderInfo();
|
||||
item.ProviderData[Id] = data;
|
||||
}
|
||||
|
||||
var seriesId = item.GetProviderId(MetadataProviders.Tvdb);
|
||||
|
||||
if (!string.IsNullOrEmpty(seriesId))
|
||||
{
|
||||
var seriesDataPath = GetSeriesDataPath(ConfigurationManager.ApplicationPaths, seriesId);
|
||||
var xmlPath = Path.Combine(seriesDataPath, "fanart.xml");
|
||||
|
||||
|
@ -202,6 +196,7 @@ namespace MediaBrowser.Providers.TV
|
|||
{
|
||||
await FetchFromXml(item, xmlPath, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
SetLastRefreshed(item, DateTime.UtcNow);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user