Skip to content

Commit

Permalink
Merge pull request #2799 from InfinityPacer/feature/module
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp authored Oct 2, 2024
2 parents f8149af + fb61eda commit 9dcb28f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/modules/emby/emby.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def get_emby_virtual_folders(self) -> List[dict]:
library_items = res.json().get("Items")
librarys = []
for library_item in library_items:
library_id = library_item.get('ItemId')
library_name = library_item.get('Name')
pathInfos = library_item.get('LibraryOptions', {}).get('PathInfos')
library_paths = []
Expand All @@ -102,6 +103,7 @@ def get_emby_virtual_folders(self) -> List[dict]:

if library_name and library_paths:
librarys.append({
'Id': library_id,
'Name': library_name,
'Path': library_paths
})
Expand Down
2 changes: 2 additions & 0 deletions app/modules/jellyfin/jellyfin.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def get_jellyfin_virtual_folders(self) -> List[dict]:
library_items = res.json()
librarys = []
for library_item in library_items:
library_id = library_item.get('ItemId')
library_name = library_item.get('Name')
pathInfos = library_item.get('LibraryOptions', {}).get('PathInfos')
library_paths = []
Expand All @@ -99,6 +100,7 @@ def get_jellyfin_virtual_folders(self) -> List[dict]:

if library_name and library_paths:
librarys.append({
'Id': library_id,
'Name': library_name,
'Path': library_paths
})
Expand Down
8 changes: 4 additions & 4 deletions app/modules/plex/plex.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def get_librarys(self, hidden: bool = False) -> List[schemas.MediaServerLibrary]
return []
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
match library.type:
case "movie":
Expand Down Expand Up @@ -146,7 +146,7 @@ def get_medias_count(self) -> schemas.Statistic:
sections = self._plex.library.sections()
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:
if str(sec.key) not in allow_library:
continue
Expand Down Expand Up @@ -693,7 +693,7 @@ def get_resume(self, num: int = 12) -> Optional[List[schemas.MediaServerPlayItem
if not self._plex:
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}
items = self._plex.fetchItems("/hubs/continueWatching/items",
container_start=0,
Expand Down Expand Up @@ -729,7 +729,7 @@ def get_latest(self, num: int = 20) -> Optional[List[schemas.MediaServerPlayItem
if not self._plex:
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 = {
"contentDirectoryID": allow_library,
"count": num,
Expand Down

0 comments on commit 9dcb28f

Please sign in to comment.