2 Commits
v1.3 ... main

Author SHA1 Message Date
dnslin
c16213179c fix: 修正从缓存读取token 2025-12-15 17:51:01 +08:00
dnslin
5a505fda66 fix: 修复自动上传需要点击查看详情才能触发的问题
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 17:46:14 +08:00
2 changed files with 6 additions and 2 deletions

View File

@@ -83,6 +83,10 @@ class OneDriveClient(CloudStorageBase):
def _get_account(self) -> Account: def _get_account(self) -> Account:
"""获取或创建 Account 实例""" """获取或创建 Account 实例"""
if self._account is None: if self._account is None:
# 确保 token 已从文件加载到缓存
if not self._token_backend.has_data:
self._token_backend.load_token()
# 公共客户端只需要 client_id不需要 client_secret # 公共客户端只需要 client_id不需要 client_secret
credentials = (self.config.client_id,) credentials = (self.config.client_id,)
self._account = Account( self._account = Account(

View File

@@ -199,8 +199,8 @@ class DownloadHandlersMixin:
text = f"✅ *下载完成*\n📄 {safe_name}\n📦 大小: {task.size_str}\n🆔 GID: `{task.gid}`" text = f"✅ *下载完成*\n📄 {safe_name}\n📦 大小: {task.size_str}\n🆔 GID: `{task.gid}`"
try: try:
await _bot_instance.send_message(chat_id=chat_id, text=text, parse_mode="Markdown") await _bot_instance.send_message(chat_id=chat_id, text=text, parse_mode="Markdown")
# 注意:自动上传已在 _auto_refresh_task 中通过 _coordinated_auto_upload 处理 # 触发自动上传(如果配置了的话)
# 这里不再单独触发,避免重复上传 await self._coordinated_auto_upload(chat_id, task.gid, task, _bot_instance)
except Exception as e: except Exception as e:
logger.warning(f"发送完成通知失败 (GID={task.gid}): {e}") logger.warning(f"发送完成通知失败 (GID={task.gid}): {e}")