error adding torrent: File exists (os error 17)
adding a torrent with POST /torrents fails
with http status 400 and the response text
{"error_kind":"internal_error","human_readable":"error adding torrent: File exists (os error 17)","status":400,"status_text":"400 Bad Request"}
... when these cache files already exist
~/.cache/rqbit/{btih}.bitv
~/.cache/rqbit/{btih}.torrent
workaround: remove the cache files and retry adding the torrent
@milahu what should be the behavior here?
- Return 200 without reading submitted torrent?
- Merge submitted torrent (eg. new trackers, maybe hybrid infohash) with existing torrent?
- Return a dedicated status code which is not an internal error?
- Something else?
Merge submitted torrent (eg. new trackers, maybe hybrid infohash) with existing torrent?
yes, but this should be optional (default off)
qBittorrent → preferences → downloads → when duplicate torrent is being added
- merge trackers to existing torrent: default off
- ask for merging trackers when torrent is being added manually: default on
so POST /torrents should have a query parameter
merge_trackers=true|false
Return a dedicated status code which is not an internal error?
maybe
with merge_trackers=false
the human_readable message should be
-error adding torrent: File exists (os error 17)
+error adding torrent: torrent exists