diff --git a/app/api/endpoints/login.py b/app/api/endpoints/login.py index ef5062c7..00559e1b 100644 --- a/app/api/endpoints/login.py +++ b/app/api/endpoints/login.py @@ -78,4 +78,4 @@ def wallpapers() -> Any: elif settings.WALLPAPER == "mediaserver": return MediaServerChain().get_latest_wallpapers() else: - return TmdbChain().get_trending_wallpapers() \ No newline at end of file + return TmdbChain().get_trending_wallpapers() diff --git a/app/chain/mediaserver.py b/app/chain/mediaserver.py index 9a43904d..fd6ca05b 100644 --- a/app/chain/mediaserver.py +++ b/app/chain/mediaserver.py @@ -93,15 +93,15 @@ class MediaServerChain(ChainBase): 获取媒体服务器最新入库条目 """ return self.run_module("mediaserver_latest", count=count, server=server, username=username) - + @cached(cache=TTLCache(maxsize=1, ttl=3600)) - def get_latest_wallpapers(self, server:str, count=20) -> List[str]: + def get_latest_wallpapers(self, server: str = None, count=20) -> List[str]: """ 获取最新最新入库条目海报作为壁纸,缓存1小时 """ return self.run_module("mediaserver_latest_images", server=server, count=count) - def get_latest_wallpaper(self, server:str) -> Optional[str]: + def get_latest_wallpaper(self, server: str = None) -> Optional[str]: """ 获取最新最新入库条目海报作为壁纸,缓存1小时 """ diff --git a/app/chain/subscribe.py b/app/chain/subscribe.py index e6124f48..8f4c1a0c 100644 --- a/app/chain/subscribe.py +++ b/app/chain/subscribe.py @@ -642,7 +642,7 @@ class SubscribeChain(ChainBase): f'{torrent_info.site_name} - {torrent_info.title} 因订阅存在自定义识别词,重新识别元数据...') # 重新识别元数据 torrent_meta = MetaInfo(title=torrent_info.title, subtitle=torrent_info.description, - custom_words=subscribe.custom_word) + custom_words=subscribe.custom_words) # 媒体信息需要重新识别 torrent_mediainfo = None diff --git a/app/modules/emby/__init__.py b/app/modules/emby/__init__.py index a2061152..c0cf58ab 100644 --- a/app/modules/emby/__init__.py +++ b/app/modules/emby/__init__.py @@ -280,13 +280,13 @@ class EmbyModule(_ModuleBase, _MediaServerBase[Emby]): if not server: return [] return server.get_latest(num=count, username=username) - - def mediaserver_latest_images(self, - server: str, - count: int = 20, - username: str = None, - host_type: bool = True, - ) -> List[str]: + + def mediaserver_latest_images(self, + server: str = None, + count: int = 20, + username: str = None, + host_type: bool = True, + ) -> List[str]: """ 获取媒体服务器最新入库条目的图片 @@ -299,7 +299,7 @@ class EmbyModule(_ModuleBase, _MediaServerBase[Emby]): server: Emby = self.get_instance(server) if not server: return [] - + links = [] items: List[schemas.MediaServerPlayItem] = self.mediaserver_latest(num=count, username=username) for item in items: @@ -311,4 +311,3 @@ class EmbyModule(_ModuleBase, _MediaServerBase[Emby]): links.append(item.image) return links - diff --git a/app/modules/jellyfin/__init__.py b/app/modules/jellyfin/__init__.py index 563870c6..f5f82e33 100644 --- a/app/modules/jellyfin/__init__.py +++ b/app/modules/jellyfin/__init__.py @@ -278,13 +278,13 @@ class JellyfinModule(_ModuleBase, _MediaServerBase[Jellyfin]): if not server: return [] return server.get_latest(num=count, username=username) - - def mediaserver_latest_images(self, - server: str, - count: int = 20, - username: str = None, - host_type: bool = True, - ) -> List[str]: + + def mediaserver_latest_images(self, + server: str = None, + count: int = 20, + username: str = None, + host_type: bool = True, + ) -> List[str]: """ 获取媒体服务器最新入库条目的图片 @@ -297,11 +297,11 @@ class JellyfinModule(_ModuleBase, _MediaServerBase[Jellyfin]): server: Jellyfin = self.get_instance(server) if not server: return [] - + links = [] items: List[schemas.MediaServerPlayItem] = self.mediaserver_latest(num=count, username=username) for item in items: - link = server.generate_image_link(item_id=item.id, image_type="Backdrop",host_type=host_type) + link = server.generate_image_link(item_id=item.id, image_type="Backdrop", host_type=host_type) if link: links.append(link) diff --git a/app/modules/plex/__init__.py b/app/modules/plex/__init__.py index e265779e..179b0dc3 100644 --- a/app/modules/plex/__init__.py +++ b/app/modules/plex/__init__.py @@ -274,11 +274,11 @@ class PlexModule(_ModuleBase, _MediaServerBase[Plex]): return [] return server.get_latest(num=count) - def mediaserver_latest_images(self, - server: str, - count: int = 20, - username: str = None, - ) -> List[str]: + def mediaserver_latest_images(self, + server: str = None, + count: int = 20, + username: str = None, + ) -> List[str]: """ 获取媒体服务器最新入库条目的图片 @@ -290,18 +290,18 @@ class PlexModule(_ModuleBase, _MediaServerBase[Plex]): server: Plex = self.get_instance(server) if not server: return [] - + links = [] items: List[schemas.MediaServerPlayItem] = self.mediaserver_latest(num=count, username=username) for item in items: - link = server.get_remote_image_by_id(item_id=item.id, + link = server.get_remote_image_by_id(item_id=item.id, image_type="Backdrop", plex_url=False) if link: links.append(link) - + return links - + def mediaserver_play_url(self, server: str, item_id: Union[str, int]) -> Optional[str]: """ 获取媒体库播放地址