Add missing checks for item locked state in metadata updates

This commit is contained in:
Joe Rogers 2023-02-12 21:59:58 -05:00
parent 1c72a8e006
commit 2d2b0a528c
No known key found for this signature in database
GPG Key ID: 0074AD57B8FDBBB4
3 changed files with 16 additions and 1 deletions

View File

@ -334,6 +334,12 @@ namespace MediaBrowser.Providers.Manager
updateType |= UpdateCumulativeRunTimeTicks(item, children);
updateType |= UpdateDateLastMediaAdded(item, children);
// don't update user-changeable metadata for locked items
if (item.IsLocked)
{
return updateType;
}
if (EnableUpdatingPremiereDateFromChildren)
{
updateType |= UpdatePremiereDate(item, children);

View File

@ -105,7 +105,10 @@ namespace MediaBrowser.Providers.MediaInfo
audio.RunTimeTicks = mediaInfo.RunTimeTicks;
audio.Size = mediaInfo.Size;
FetchDataFromTags(audio);
if (!audio.IsLocked)
{
FetchDataFromTags(audio);
}
_itemRepo.SaveMediaStreams(audio.Id, mediaInfo.MediaStreams, cancellationToken);
}

View File

@ -54,6 +54,12 @@ namespace MediaBrowser.Providers.Music
{
var updateType = base.UpdateMetadataFromChildren(item, children, isFullRefresh, currentUpdateType);
// don't update user-changeable metadata for locked items
if (item.IsLocked)
{
return updateType;
}
if (isFullRefresh || currentUpdateType > ItemUpdateType.None)
{
if (!item.LockedFields.Contains(MetadataField.Name))