This commit is contained in:
jxxghp 2024-02-20 14:41:25 +08:00
parent f43efab831
commit 4183dca80f
4 changed files with 15 additions and 15 deletions

View File

@ -482,7 +482,7 @@ class TransferChain(ChainBase):
return return
@staticmethod @staticmethod
def get_root_path(path: str, type_name: str, category: str) -> Path: def get_root_path(path: str, type_name: str, category: str) -> Optional[Path]:
""" """
计算媒体库目录的根路径 计算媒体库目录的根路径
""" """

View File

@ -10,12 +10,12 @@ class DownloadHistoryOper(DbOper):
下载历史管理 下载历史管理
""" """
def get_by_path(self, path: Path) -> DownloadHistory: def get_by_path(self, path: str) -> DownloadHistory:
""" """
按路径查询下载记录 按路径查询下载记录
:param path: 数据key :param path: 数据key
""" """
return DownloadHistory.get_by_path(self._db, str(path)) return DownloadHistory.get_by_path(self._db, path)
def get_by_hash(self, download_hash: str) -> DownloadHistory: def get_by_hash(self, download_hash: str) -> DownloadHistory:
""" """

View File

@ -932,9 +932,9 @@ class Emby:
""" """
if not self._host or not self._apikey: if not self._host or not self._apikey:
return None return None
url = url.replace("[HOST]", self._host) \ url = url.replace("[HOST]", self._host or '') \
.replace("[APIKEY]", self._apikey) \ .replace("[APIKEY]", self._apikey or '') \
.replace("[USER]", self.user) .replace("[USER]", self.user or '')
try: try:
return RequestUtils(content_type="application/json").get_res(url=url) return RequestUtils(content_type="application/json").get_res(url=url)
except Exception as e: except Exception as e:
@ -950,9 +950,9 @@ class Emby:
""" """
if not self._host or not self._apikey: if not self._host or not self._apikey:
return None return None
url = url.replace("[HOST]", self._host) \ url = url.replace("[HOST]", self._host or '') \
.replace("[APIKEY]", self._apikey) \ .replace("[APIKEY]", self._apikey or '') \
.replace("[USER]", self.user) .replace("[USER]", self.user or '')
try: try:
return RequestUtils( return RequestUtils(
headers=headers, headers=headers,

View File

@ -632,9 +632,9 @@ class Jellyfin:
""" """
if not self._host or not self._apikey: if not self._host or not self._apikey:
return None return None
url = url.replace("[HOST]", self._host) \ url = url.replace("[HOST]", self._host or '') \
.replace("[APIKEY]", self._apikey) \ .replace("[APIKEY]", self._apikey or '') \
.replace("[USER]", self.user) .replace("[USER]", self.user or '')
try: try:
return RequestUtils(accept_type="application/json").get_res(url=url) return RequestUtils(accept_type="application/json").get_res(url=url)
except Exception as e: except Exception as e:
@ -650,9 +650,9 @@ class Jellyfin:
""" """
if not self._host or not self._apikey: if not self._host or not self._apikey:
return None return None
url = url.replace("[HOST]", self._host) \ url = url.replace("[HOST]", self._host or '') \
.replace("[APIKEY]", self._apikey) \ .replace("[APIKEY]", self._apikey or '') \
.replace("[USER]", self.user) .replace("[USER]", self.user or '')
try: try:
return RequestUtils( return RequestUtils(
headers=headers headers=headers