aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-02-21 13:04:18 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-02-21 13:04:18 -0500
commitc0e549482500ce4d1f454162175d8c367fcbdf7c (patch)
tree923acdb7fe4823ace4a70768c4d915fde1cba5ef
parent45250b7874f4729fa1b3ac375ed3c848b4172337 (diff)
respect locked fields during media probe
-rw-r--r--MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs24
1 files changed, 14 insertions, 10 deletions
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
index 1bb715866..2270ad65c 100644
--- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
+++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
@@ -348,7 +348,7 @@ namespace MediaBrowser.Providers.MediaInfo
{
var isFullRefresh = options.MetadataRefreshMode == MetadataRefreshMode.FullRefresh;
- if (!video.LockedFields.Contains(MetadataFields.OfficialRating))
+ if (!video.IsLocked && !video.LockedFields.Contains(MetadataFields.OfficialRating))
{
if (!string.IsNullOrWhiteSpace(data.OfficialRating) || isFullRefresh)
{
@@ -361,7 +361,7 @@ namespace MediaBrowser.Providers.MediaInfo
video.OfficialRatingDescription = data.OfficialRatingDescription;
}
- if (!video.LockedFields.Contains(MetadataFields.Genres))
+ if (!video.IsLocked && !video.LockedFields.Contains(MetadataFields.Genres))
{
if (video.Genres.Count == 0 || isFullRefresh)
{
@@ -374,7 +374,7 @@ namespace MediaBrowser.Providers.MediaInfo
}
}
- if (!video.LockedFields.Contains(MetadataFields.Studios))
+ if (!video.IsLocked && !video.LockedFields.Contains(MetadataFields.Studios))
{
if (video.Studios.Count == 0 || isFullRefresh)
{
@@ -415,14 +415,18 @@ namespace MediaBrowser.Providers.MediaInfo
video.ParentIndexNumber = data.ParentIndexNumber;
}
}
- if (!string.IsNullOrWhiteSpace(data.Name))
+
+ if (!video.IsLocked && !video.LockedFields.Contains(MetadataFields.Name))
{
- if (string.IsNullOrWhiteSpace(video.Name) || (string.Equals(video.Name, Path.GetFileNameWithoutExtension(video.Path), StringComparison.OrdinalIgnoreCase) && !video.ProviderIds.Any()))
+ if (!string.IsNullOrWhiteSpace(data.Name))
{
- // Don't use the embedded name for extras because it will often be the same name as the movie
- if (!video.ExtraType.HasValue && !video.IsOwnedItem)
+ if (string.IsNullOrWhiteSpace(video.Name) || (string.Equals(video.Name, Path.GetFileNameWithoutExtension(video.Path), StringComparison.OrdinalIgnoreCase) && !video.ProviderIds.Any()))
{
- video.Name = data.Name;
+ // Don't use the embedded name for extras because it will often be the same name as the movie
+ if (!video.ExtraType.HasValue && !video.IsOwnedItem)
+ {
+ video.Name = data.Name;
+ }
}
}
}
@@ -433,7 +437,7 @@ namespace MediaBrowser.Providers.MediaInfo
video.ProductionYear = video.PremiereDate.Value.ToLocalTime().Year;
}
- if (!video.LockedFields.Contains(MetadataFields.Overview))
+ if (!video.IsLocked && !video.LockedFields.Contains(MetadataFields.Overview))
{
if (string.IsNullOrWhiteSpace(video.Overview) || isFullRefresh)
{
@@ -446,7 +450,7 @@ namespace MediaBrowser.Providers.MediaInfo
{
var isFullRefresh = options.MetadataRefreshMode == MetadataRefreshMode.FullRefresh;
- if (!video.LockedFields.Contains(MetadataFields.Cast))
+ if (!video.IsLocked && !video.LockedFields.Contains(MetadataFields.Cast))
{
if (isFullRefresh || _libraryManager.GetPeople(video).Count == 0)
{