fix personmeta
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
from pathlib import Path
|
||||
from typing import Optional, Tuple, Union, Any, List
|
||||
from typing import Optional, Tuple, Union, Any, List, Generator
|
||||
|
||||
from app import schemas
|
||||
from app.core.context import MediaInfo
|
||||
@ -109,7 +109,7 @@ class JellyfinModule(_ModuleBase):
|
||||
"""
|
||||
media_statistic = self.jellyfin.get_medias_count()
|
||||
media_statistic.user_count = self.jellyfin.get_user_count()
|
||||
return media_statistic
|
||||
return [media_statistic]
|
||||
|
||||
def mediaserver_librarys(self, server: str) -> Optional[List[schemas.MediaServerLibrary]]:
|
||||
"""
|
||||
@ -128,7 +128,7 @@ class JellyfinModule(_ModuleBase):
|
||||
path=library.get("path")
|
||||
) for library in librarys]
|
||||
|
||||
def mediaserver_items(self, server: str, library_id: str) -> Optional[List[schemas.MediaServerItem]]:
|
||||
def mediaserver_items(self, server: str, library_id: str) -> Optional[Generator]:
|
||||
"""
|
||||
媒体库项目列表
|
||||
"""
|
||||
|
@ -561,7 +561,7 @@ class Jellyfin(metaclass=Singleton):
|
||||
.replace("[APIKEY]", self._apikey) \
|
||||
.replace("[USER]", self.user)
|
||||
try:
|
||||
return RequestUtils().get_res(url=url)
|
||||
return RequestUtils(accept_type="application/json").get_res(url=url)
|
||||
except Exception as e:
|
||||
logger.error(f"连接Jellyfin出错:" + str(e))
|
||||
return None
|
||||
@ -578,7 +578,11 @@ class Jellyfin(metaclass=Singleton):
|
||||
.replace("[APIKEY]", self._apikey) \
|
||||
.replace("[USER]", self.user)
|
||||
try:
|
||||
return RequestUtils().post_res(url=url, data=data)
|
||||
return RequestUtils(
|
||||
headers={
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
).post_res(url=url, data=data)
|
||||
except Exception as e:
|
||||
logger.error(f"连接Jellyfin出错:" + str(e))
|
||||
return None
|
||||
|
Reference in New Issue
Block a user