[fix] qbittorrent: handle existing torrent#2942
[fix] qbittorrent: handle existing torrent#2942gazpachoking merged 4 commits intoFlexget:developfrom
Conversation
| logger.error('Error checking torrent file, file {} does not exist', file_path) | ||
| return False | ||
|
|
||
| hash_torrent = torrent.info_hash |
There was a problem hiding this comment.
We already grab this info from magnets and torrent files, and put it in the torrent_info_hash entry field. I think it would be better to just pull the hash from there rather than repeat that logic.
| return False | ||
|
|
||
| try: | ||
| check_file = loads(respose.text) |
There was a problem hiding this comment.
Probably just use response.json() here rather than explicitly using json.loads?
| ) | ||
| return False | ||
|
|
||
| if len(check_file) > 0: |
There was a problem hiding this comment.
What sort of data does this endpoint return? Normally rather than doing a len(check_file) >0 it would just be if check_file
| if not self.connected: | ||
| raise plugin.PluginError('Not connected.') | ||
|
|
||
| if self.check_torrent_exists(url, verify_cert, hash_torrent): |
There was a problem hiding this comment.
Maybe we could call this earlier, perhaps hereabouts This would have the advantage of only needing to call it once whether file or magnet, and not having to pass info hash through the add_torrent_X functions.
|
@gazpachoking done |
|
LGTM, thanks! |
Motivation for changes:
Handles qbittorrent existing torrent and returns a warning. Avoids plugin crash
Detailed changes:
Please note that this will not work with magnet links, they can be turn off with "magnets: no"Addressed issues:
Implemented feature requests:
Config usage if relevant (new plugin or updated schema):
Log and/or tests output (preferably both):
To Do: