Merge pull request #17146 from theguymadmax/fix-identify-search
Some checks failed
Format / format-check (push) Has been cancelled
Tests / run-tests (macos-latest) (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Stable Spec (push) Has been cancelled
Tests / run-tests (ubuntu-latest) (push) Has been cancelled
Tests / run-tests (windows-latest) (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Artifact (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Unstable Spec (push) Has been cancelled
Project Automation / Project board (push) Has been cancelled
Merge Conflict Labeler / main (push) Has been cancelled
CodeQL / Analyze (csharp) (push) Has been cancelled

Fix Identify returning wrong results
This commit is contained in:
Bond-009
2026-06-21 19:03:52 +02:00
committed by GitHub

View File

@@ -831,8 +831,16 @@ namespace MediaBrowser.Providers.Manager
var isLocalLocked = temp.Item.IsLocked;
if (!isLocalLocked && (options.ReplaceAllMetadata || options.MetadataRefreshMode > MetadataRefreshMode.ValidationOnly))
{
var remoteResult = await ExecuteRemoteProviders(temp, logName, false, id, providers.OfType<IRemoteMetadataProvider<TItemType, TIdType>>(), cancellationToken)
.ConfigureAwait(false);
var remoteProviders = providers.OfType<IRemoteMetadataProvider<TItemType, TIdType>>();
// When identifying, run the provider the user picked first so the correct IDs are used.
if (!string.IsNullOrEmpty(options.SearchResult?.SearchProviderName))
{
remoteProviders = remoteProviders
.OrderBy(i => string.Equals(i.Name, options.SearchResult.SearchProviderName, StringComparison.OrdinalIgnoreCase) ? 0 : 1);
}
var remoteResult = await ExecuteRemoteProviders(temp, logName, false, id, remoteProviders, cancellationToken).ConfigureAwait(false);
refreshResult.UpdateType |= remoteResult.UpdateType;
refreshResult.ErrorMessage = remoteResult.ErrorMessage;