mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 00:16:57 +08:00
fix(mediaserver): improve data isolation handling
This commit is contained in:
@@ -91,6 +91,7 @@ class Emby:
|
|||||||
library_items = res.json().get("Items")
|
library_items = res.json().get("Items")
|
||||||
librarys = []
|
librarys = []
|
||||||
for library_item in library_items:
|
for library_item in library_items:
|
||||||
|
library_id = library_item.get('ItemId')
|
||||||
library_name = library_item.get('Name')
|
library_name = library_item.get('Name')
|
||||||
pathInfos = library_item.get('LibraryOptions', {}).get('PathInfos')
|
pathInfos = library_item.get('LibraryOptions', {}).get('PathInfos')
|
||||||
library_paths = []
|
library_paths = []
|
||||||
@@ -102,6 +103,7 @@ class Emby:
|
|||||||
|
|
||||||
if library_name and library_paths:
|
if library_name and library_paths:
|
||||||
librarys.append({
|
librarys.append({
|
||||||
|
'Id': library_id,
|
||||||
'Name': library_name,
|
'Name': library_name,
|
||||||
'Path': library_paths
|
'Path': library_paths
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ class Jellyfin:
|
|||||||
library_items = res.json()
|
library_items = res.json()
|
||||||
librarys = []
|
librarys = []
|
||||||
for library_item in library_items:
|
for library_item in library_items:
|
||||||
|
library_id = library_item.get('ItemId')
|
||||||
library_name = library_item.get('Name')
|
library_name = library_item.get('Name')
|
||||||
pathInfos = library_item.get('LibraryOptions', {}).get('PathInfos')
|
pathInfos = library_item.get('LibraryOptions', {}).get('PathInfos')
|
||||||
library_paths = []
|
library_paths = []
|
||||||
@@ -99,6 +100,7 @@ class Jellyfin:
|
|||||||
|
|
||||||
if library_name and library_paths:
|
if library_name and library_paths:
|
||||||
librarys.append({
|
librarys.append({
|
||||||
|
'Id': library_id,
|
||||||
'Name': library_name,
|
'Name': library_name,
|
||||||
'Path': library_paths
|
'Path': library_paths
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ class Plex:
|
|||||||
return []
|
return []
|
||||||
libraries = []
|
libraries = []
|
||||||
for library in self._libraries:
|
for library in self._libraries:
|
||||||
if hidden and self._sync_libraries and library.key not in self._sync_libraries:
|
if hidden and self._sync_libraries and str(library.key) not in self._sync_libraries:
|
||||||
continue
|
continue
|
||||||
match library.type:
|
match library.type:
|
||||||
case "movie":
|
case "movie":
|
||||||
@@ -146,7 +146,7 @@ class Plex:
|
|||||||
sections = self._plex.library.sections()
|
sections = self._plex.library.sections()
|
||||||
MovieCount = SeriesCount = EpisodeCount = 0
|
MovieCount = SeriesCount = EpisodeCount = 0
|
||||||
# 媒体库白名单
|
# 媒体库白名单
|
||||||
allow_library = [lib.id for lib in self.get_librarys()]
|
allow_library = [lib.id for lib in self.get_librarys(hidden=True)]
|
||||||
for sec in sections:
|
for sec in sections:
|
||||||
if str(sec.key) not in allow_library:
|
if str(sec.key) not in allow_library:
|
||||||
continue
|
continue
|
||||||
@@ -693,7 +693,7 @@ class Plex:
|
|||||||
if not self._plex:
|
if not self._plex:
|
||||||
return []
|
return []
|
||||||
# 媒体库白名单
|
# 媒体库白名单
|
||||||
allow_library = ",".join([lib.id for lib in self.get_librarys()])
|
allow_library = ",".join([lib.id for lib in self.get_librarys(hidden=True)])
|
||||||
params = {"contentDirectoryID": allow_library}
|
params = {"contentDirectoryID": allow_library}
|
||||||
items = self._plex.fetchItems("/hubs/continueWatching/items",
|
items = self._plex.fetchItems("/hubs/continueWatching/items",
|
||||||
container_start=0,
|
container_start=0,
|
||||||
@@ -729,7 +729,7 @@ class Plex:
|
|||||||
if not self._plex:
|
if not self._plex:
|
||||||
return None
|
return None
|
||||||
# 请求参数(除黑名单)
|
# 请求参数(除黑名单)
|
||||||
allow_library = ",".join([lib.id for lib in self.get_librarys()])
|
allow_library = ",".join([lib.id for lib in self.get_librarys(hidden=True)])
|
||||||
params = {
|
params = {
|
||||||
"contentDirectoryID": allow_library,
|
"contentDirectoryID": allow_library,
|
||||||
"count": num,
|
"count": num,
|
||||||
|
|||||||
Reference in New Issue
Block a user