mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-12 07:10:44 +08:00
⚡️ 优化Alist和Emby模块错误处理逻辑
This commit is contained in:
parent
0faf3ec569
commit
bdc9068f3d
@ -39,10 +39,9 @@ class Alist:
|
||||
return True
|
||||
else:
|
||||
print(f"Alist: 连接失败❌ {response.get('message')}")
|
||||
return False
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"获取Alist信息出错: {e}")
|
||||
return False
|
||||
return False
|
||||
|
||||
def refresh(self, path, force_refresh=True):
|
||||
url = f"{self.url}/api/fs/list"
|
||||
@ -74,10 +73,9 @@ class Alist:
|
||||
return self.refresh(parent_path)
|
||||
else:
|
||||
print(f"📁 刷新Alist目录:失败❌ {response.get('message')}")
|
||||
return False
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"刷新Alist目录出错: {e}")
|
||||
return False
|
||||
return False
|
||||
|
||||
def _normalize_path(self, path):
|
||||
"""标准化路径格式"""
|
||||
|
||||
@ -42,10 +42,9 @@ class Emby:
|
||||
return True
|
||||
else:
|
||||
print(f"Emby媒体库: 连接失败❌ {response.text}")
|
||||
return False
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"获取Emby媒体库信息出错: {e}")
|
||||
return False
|
||||
return False
|
||||
|
||||
def refresh(self, emby_id):
|
||||
if not emby_id:
|
||||
@ -68,10 +67,9 @@ class Emby:
|
||||
return True
|
||||
else:
|
||||
print(f"🎞️ 刷新Emby媒体库:{response.text}❌")
|
||||
return False
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"刷新Emby媒体库出错: {e}")
|
||||
return False
|
||||
return False
|
||||
|
||||
def search(self, media_name):
|
||||
if not media_name:
|
||||
@ -102,7 +100,6 @@ class Emby:
|
||||
return item["Id"]
|
||||
else:
|
||||
print(f"🎞️ 搜索Emby媒体库:{response.text}❌")
|
||||
return False
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"搜索Emby媒体库出错: {e}")
|
||||
return False
|
||||
return False
|
||||
|
||||
Loading…
Reference in New Issue
Block a user