Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[错误报告] 选择删除订阅与文件后 rssqBittorrent 中仍然可见,文件也没有被删除 #281

Closed
ZhangTianrong opened this issue Jun 2, 2023 · 7 comments · Fixed by #282
Labels
bug Something isn't working

Comments

@ZhangTianrong
Copy link
Contributor

ZhangTianrong commented Jun 2, 2023

当前程序版本

DEV_VERSION b5c3be1

问题类型

WebUI

问题描述

在 WebUI 的 Bangumi List 中删除一个番剧并选择删除文件后,该番剧在数据库中被成功删除,但是 qBittorrent 中仍留有对应的 rss, 文件也没有被删除。这导致再次重复添加时会报错。又因为该番剧虽然无法再次添加进 qBittorrent 却可以添加进数据库,导致 Bangumi List 中出现一个没有 rule_name 的番剧,该番剧无法删除。虽然现在解决了 #280 的问题,但如果该规则在被删除前已经被修改过,则新生成的条目的 rule_name 未必会 match 原有 rule_name 导致仍然无法删除。

实际上 src\module\api\bangumi.py#L46 定义的 file 无效,前端中面对 Delete Local File? 的提问选择 Yes 时,该值仍然为 False. HTTP DELETE 一般不包含 entity body, 建议进一步延申 endpoint uri. 而删除时使用的 rule_name 也无法 match qBittorrent 中的 rule_name. 在以下日志有关的操作中,rule_name因为太怕痛就全点防御力了。 S2 但添加订阅时 src\module\downloader\client\qb_downloader.py#L96 使用的则是 item_path, 即 因为太怕痛就全点防御力了。

发生问题时系统日志

删除时:
[2023-06-02 02:11:24] DEBUG:    Authed.
[2023-06-02 02:11:24] INFO:     [Downloader] Delete rule: 因为太怕痛就全点防御力了。 S2
[2023-06-02 02:11:24] DEBUG:    [Database] Delete bangumi id: 22.
[2023-06-02 02:11:24] INFO:     [Manager] Delete rule for 因为太怕痛就全点防御力了。

重复添加时:
[2023-06-02 02:12:00] DEBUG:    Authed.
[2023-06-02 02:12:00] DEBUG:    [Downloader] Start adding rules.
[2023-06-02 02:12:03] INFO:     [Downloader] Add 偶像大师 灰姑娘女孩 U149 Season 1 to auto download rules.
[2023-06-02 02:12:03] DEBUG:    [Downloader] Finished.
[2023-06-02 02:16:25] DEBUG:    RAW:[猎户不鸽压制] 因为太怕痛就全点防御力了。第二季 Itai no wa Iya nano de Bougyoryoku ni Kyokufuri Shitai to Omoimasu S2 [12] [END] [1080p] [简中内
嵌] [2023年1月番] >> Itai no wa Iya nano de Bougyoryoku ni Kyokufuri Shitai to Omoimasu
[2023-06-02 02:16:26] DEBUG:    Authed.
[2023-06-02 02:16:29] DEBUG:    [Database] Insert 因为太怕痛就全点防御力了。 into database.
[2023-06-02 02:16:29] ERROR     Exception in ASGI application
Traceback (most recent call last):
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\uvicorn\middleware\message_logger.py", line 86, in __call__
    raise exc from None
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\uvicorn\middleware\message_logger.py", line 82, in __call__
    await self.app(scope, inner_receive, inner_send)
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\fastapi\applications.py", line 276, in __call__
    await super().__call__(scope, receive, send)
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\starlette\applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__
    raise e
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\starlette\routing.py", line 718, in __call__
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\qbittorrentapi\rss.py", line 176, in rss_add_feed
    self._post(_name=APINames.RSS, _method="addFeed", data=data, **kwargs)
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\qbittorrentapi\request.py", line 390, in _post
    return self._request_manager(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\qbittorrentapi\request.py", line 465, in _request_manager
    return self._request(
           ^^^^^^^^^^^^^^
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\qbittorrentapi\request.py", line 542, in _request
    self._handle_error_responses(data, params, response)
  File "c:\Users\<username>\Tools\Auto_Bangumi\env\Lib\site-packages\qbittorrentapi\request.py", line 782, in _handle_error_responses
    raise Conflict409Error(response.text)
qbittorrentapi.exceptions.Conflict409Error: 该 URL 已在 RSS 订阅源中存在:https://mikanani.me/RSS/Bangumi?bangumiId=2911&subgroupid=574。
@ZhangTianrong ZhangTianrong added the bug Something isn't working label Jun 2, 2023
EstrellaXD added a commit that referenced this issue Jun 2, 2023
@EstrellaXD EstrellaXD mentioned this issue Jun 2, 2023
@EstrellaXD
Copy link
Owner

@Rewrite0

@EstrellaXD
Copy link
Owner

而删除时使用的 rule_name 也无法 match qBittorrent 中的 rule_name. 在以下日志有关的操作中,rule_name 为 因为太怕痛就全点防御力了。 S2 但添加订阅时 src\module\downloader\client\qb_downloader.py#L96 使用的则是 item_path, 即 因为太怕痛就全点防御力了。

这句我没有太理解,rule_name 删除的应该是自动下载规则,item_path 则是 rss_feed,原本程序里面没有设计删除 rss, 这里没有理解想要表达什么

@ZhangTianrong
Copy link
Contributor Author

而删除时使用的 rule_name 也无法 match qBittorrent 中的 rule_name. 在以下日志有关的操作中,rule_name 为 因为太怕痛就全点防御力了。 S2 但添加订阅时 src\module\downloader\client\qb_downloader.py#L96 使用的则是 item_path, 即 因为太怕痛就全点防御力了。

这句我没有太理解,rule_name 删除的应该是自动下载规则,item_path 则是 rss_feed,原本程序里面没有设计删除 rss, 这里没有理解想要表达什么

这个因为我不了解 qBittorrent 的 API 所以也不太确定,简而言之,通过现在的 rule_name 似乎无法移除订阅,我还在继续 debug 看问题出在哪里。

@Rewrite0
Copy link
Collaborator

Rewrite0 commented Jun 2, 2023

前端中面对 Delete Local File? 的提问选择 Yes 时,该值仍然为 False

还有这回事? 等我下班回去看看.

@EstrellaXD
Copy link
Owner

而删除时使用的 rule_name 也无法 match qBittorrent 中的 rule_name. 在以下日志有关的操作中,rule_name 为 因为太怕痛就全点防御力了。 S2 但添加订阅时 src\module\downloader\client\qb_downloader.py#L96 使用的则是 item_path, 即 因为太怕痛就全点防御力了。

这句我没有太理解,rule_name 删除的应该是自动下载规则,item_path 则是 rss_feed,原本程序里面没有设计删除 rss, 这里没有理解想要表达什么

这个因为我不了解 qBittorrent 的 API 所以也不太确定,简而言之,通过现在的 rule_name 似乎无法移除订阅,我还在继续 debug 看问题出在哪里。

如果你指的是 RSS_FEED,那确实目前无法移除,已经在修复了。但是规则是可以正常移除的

@ZhangTianrong
Copy link
Contributor Author

而删除时使用的 rule_name 也无法 match qBittorrent 中的 rule_name. 在以下日志有关的操作中,rule_name 为 因为太怕痛就全点防御力了。 S2 但添加订阅时 src\module\downloader\client\qb_downloader.py#L96 使用的则是 item_path, 即 因为太怕痛就全点防御力了。

这句我没有太理解,rule_name 删除的应该是自动下载规则,item_path 则是 rss_feed,原本程序里面没有设计删除 rss, 这里没有理解想要表达什么

这个因为我不了解 qBittorrent 的 API 所以也不太确定,简而言之,通过现在的 rule_name 似乎无法移除订阅,我还在继续 debug 看问题出在哪里。

如果你指的是 RSS_FEED,那确实目前无法移除,已经在修复了。但是规则是可以正常移除的

那确实,我指的是 qBittorrent 的 RSS 页面中显示的订阅,这也是决定了一个订阅链接是否能被加入的信息。

@EstrellaXD
Copy link
Owner

那确实,我指的是 qBittorrent 的 RSS 页面中显示的订阅,这也是决定了一个订阅链接是否能被加入的信息。

Fix in 7fc349c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants