ignore emby and jellyfin path infos with unset network path (#775)
This commit is contained in:
@@ -250,12 +250,7 @@ public class EmbyApiClient : IEmbyApiClient
|
||||
MediaKind = LibraryMediaKind.Shows,
|
||||
ShouldSyncItems = false,
|
||||
Paths = new List<LibraryPath> { new() { Path = $"emby://{response.ItemId}" } },
|
||||
PathInfos = response.LibraryOptions.PathInfos.Map(
|
||||
pi => new EmbyPathInfo
|
||||
{
|
||||
Path = pi.Path,
|
||||
NetworkPath = pi.NetworkPath
|
||||
}).ToList()
|
||||
PathInfos = GetPathInfos(response)
|
||||
},
|
||||
"movies" => new EmbyLibrary
|
||||
{
|
||||
@@ -264,18 +259,23 @@ public class EmbyApiClient : IEmbyApiClient
|
||||
MediaKind = LibraryMediaKind.Movies,
|
||||
ShouldSyncItems = false,
|
||||
Paths = new List<LibraryPath> { new() { Path = $"emby://{response.ItemId}" } },
|
||||
PathInfos = response.LibraryOptions.PathInfos.Map(
|
||||
pi => new EmbyPathInfo
|
||||
{
|
||||
Path = pi.Path,
|
||||
NetworkPath = pi.NetworkPath
|
||||
}).ToList()
|
||||
PathInfos = GetPathInfos(response)
|
||||
},
|
||||
// TODO: ??? for music libraries
|
||||
"boxsets" => CacheCollectionLibraryId(response.ItemId),
|
||||
_ => None
|
||||
};
|
||||
|
||||
private List<EmbyPathInfo> GetPathInfos(EmbyLibraryResponse response) =>
|
||||
response.LibraryOptions.PathInfos
|
||||
.Filter(pi => !string.IsNullOrWhiteSpace(pi.NetworkPath))
|
||||
.Map(
|
||||
pi => new EmbyPathInfo
|
||||
{
|
||||
Path = pi.Path,
|
||||
NetworkPath = pi.NetworkPath
|
||||
}).ToList();
|
||||
|
||||
private Option<EmbyLibrary> CacheCollectionLibraryId(string itemId)
|
||||
{
|
||||
_memoryCache.Set("emby_collections_library_item_id", itemId);
|
||||
|
||||
@@ -303,12 +303,7 @@ public class JellyfinApiClient : IJellyfinApiClient
|
||||
MediaKind = LibraryMediaKind.Shows,
|
||||
ShouldSyncItems = false,
|
||||
Paths = new List<LibraryPath> { new() { Path = $"jellyfin://{response.ItemId}" } },
|
||||
PathInfos = response.LibraryOptions.PathInfos.Map(
|
||||
pi => new JellyfinPathInfo
|
||||
{
|
||||
Path = pi.Path,
|
||||
NetworkPath = pi.NetworkPath
|
||||
}).ToList()
|
||||
PathInfos = GetPathInfos(response)
|
||||
},
|
||||
"movies" => new JellyfinLibrary
|
||||
{
|
||||
@@ -317,18 +312,23 @@ public class JellyfinApiClient : IJellyfinApiClient
|
||||
MediaKind = LibraryMediaKind.Movies,
|
||||
ShouldSyncItems = false,
|
||||
Paths = new List<LibraryPath> { new() { Path = $"jellyfin://{response.ItemId}" } },
|
||||
PathInfos = response.LibraryOptions.PathInfos.Map(
|
||||
pi => new JellyfinPathInfo
|
||||
{
|
||||
Path = pi.Path,
|
||||
NetworkPath = pi.NetworkPath
|
||||
}).ToList()
|
||||
PathInfos = GetPathInfos(response)
|
||||
},
|
||||
// TODO: ??? for music libraries
|
||||
"boxsets" => CacheCollectionLibraryId(response.ItemId),
|
||||
_ => None
|
||||
};
|
||||
|
||||
private List<JellyfinPathInfo> GetPathInfos(JellyfinLibraryResponse response) =>
|
||||
response.LibraryOptions.PathInfos
|
||||
.Filter(pi => !string.IsNullOrWhiteSpace(pi.NetworkPath))
|
||||
.Map(
|
||||
pi => new JellyfinPathInfo
|
||||
{
|
||||
Path = pi.Path,
|
||||
NetworkPath = pi.NetworkPath
|
||||
}).ToList();
|
||||
|
||||
private Option<JellyfinLibrary> CacheCollectionLibraryId(string itemId)
|
||||
{
|
||||
_memoryCache.Set("jellyfin_collections_library_item_id", itemId);
|
||||
|
||||
Reference in New Issue
Block a user