feat: plex媒体数量统计过滤黑名单

This commit is contained in:
zhu0823 2024-04-16 17:42:25 +08:00
parent 423b7cf340
commit c98c8c8836

View File

@ -142,7 +142,11 @@ class Plex:
return schemas.Statistic() return schemas.Statistic()
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()]
for sec in sections: for sec in sections:
if str(sec.key) not in allow_library:
continue
if sec.type == "movie": if sec.type == "movie":
MovieCount += sec.totalSize MovieCount += sec.totalSize
if sec.type == "show": if sec.type == "show":
@ -610,7 +614,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()])
query = {'contentDirectoryID': allow_library} query = {'contentDirectoryID': allow_library}
path = '/hubs/continueWatching/items' + utils.joinArgs(query) path = '/hubs/continueWatching/items' + utils.joinArgs(query)