Merge pull request #3289 from rigtorp/tmdb-comment-fix

Clarify comment and log actual search string in TMDB search provider
This commit is contained in:
Bond-009 2020-06-11 19:12:30 +02:00 committed by GitHub
commit 762e0c8d17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,19 +76,20 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
var tmdbImageUrl = tmdbSettings.images.GetImageUrl("original");
// TODO: Investigate: Does this mean we are reparsing already parsed ItemLookupInfo?
// ParseName is required here.
// Caller provides the filename with extension stripped and NOT the parsed filename
var parsedName = _libraryManager.ParseName(name);
var yearInName = parsedName.Year;
name = parsedName.Name;
year ??= yearInName;
_logger.LogInformation("TmdbSearch: Finding id for item: {0} ({1})", name, year);
var language = idInfo.MetadataLanguage.ToLowerInvariant();
// Replace sequences of non-word characters with space
// TMDB expects a space separated list of words make sure that is the case
name = _cleanNonWord.Replace(name, " ").Trim();
_logger.LogInformation("TmdbSearch: Finding id for item: {0} ({1})", name, year);
var results = await GetSearchResults(name, searchType, year, language, tmdbImageUrl, cancellationToken).ConfigureAwait(false);
if (results.Count == 0)