Bond_009 4 lat temu
rodzic
commit
441301069e

+ 3 - 2
Emby.Server.Implementations/Library/LibraryManager.cs

@@ -960,8 +960,9 @@ namespace Emby.Server.Implementations.Library
 
 
             var path = getPathFn(name);
             var path = getPathFn(name);
             var id = GetItemByNameId<T>(path);
             var id = GetItemByNameId<T>(path);
+            var item = GetItemById(id) as T;
 
 
-            if (GetItemById(id) is T item)
+            if (item == null)
             {
             {
                 item = new T
                 item = new T
                 {
                 {
@@ -977,7 +978,7 @@ namespace Emby.Server.Implementations.Library
                 return item;
                 return item;
             }
             }
 
 
-            return null;
+            return item;
         }
         }
 
 
         private Guid GetItemByNameId<T>(string path)
         private Guid GetItemByNameId<T>(string path)