Pārlūkot izejas kodu

Fix tmdbid not detected in single movie folder (#14955)

theguymadmax 3 nedēļas atpakaļ
vecāks
revīzija
def5956cd1

+ 7 - 4
Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs

@@ -369,13 +369,16 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
                 // We need to only look at the name of this actual item (not parents)
                 var justName = item.IsInMixedFolder ? Path.GetFileName(item.Path.AsSpan()) : Path.GetFileName(item.ContainingFolderPath.AsSpan());
 
-                if (!justName.IsEmpty)
+                var tmdbid = justName.GetAttributeValue("tmdbid");
+
+                // If not in a mixed folder and ID not found in folder path, check filename
+                if (string.IsNullOrEmpty(tmdbid) && !item.IsInMixedFolder)
                 {
-                    // Check for TMDb id
-                    var tmdbid = justName.GetAttributeValue("tmdbid");
-                    item.TrySetProviderId(MetadataProvider.Tmdb, tmdbid);
+                    tmdbid = Path.GetFileName(item.Path.AsSpan()).GetAttributeValue("tmdbid");
                 }
 
+                item.TrySetProviderId(MetadataProvider.Tmdb, tmdbid);
+
                 if (!string.IsNullOrEmpty(item.Path))
                 {
                     // Check for IMDb id - we use full media path, as we can assume that this will match in any use case (whether  id in parent dir or in file name)