flood icon indicating copy to clipboard operation
flood copied to clipboard

Inconsistency in API usage of mixed case info_hash

Open GovanifY opened this issue 3 years ago • 1 comments

Type: Bug Report

  • [X] Try to follow the update procedure described in the README and try again before opening this issue.

Your Environment

NixOS latest flood.

  • Version used:
    • Flood 4.7.0
  • Operating system and version: NixOS
  • Torrent client and version: rtorrent-0.9.8+date=2021-08-07

Summary

Flood's API has inconsistent behaviour towards the capitalization of info_hash. /torrent/tags will happily work with any hash you provide it, capitalized or otherwise, while /torrents/move will return a cryptic b'{"message":"Cannot read property \'status\' of undefined"}' .

Expected Behavior

Have consistent behaviour and/or document the capitalization requirement in the API docs, as the error returned is a bit cryptic especially given some other API calls work.

GovanifY avatar Aug 11 '22 22:08 GovanifY

I'd wager this is caused by this line: https://github.com/jesec/flood/blob/3feb45e9a5fafa9c2bfff47f87d57cb922215f0d/server/services/rTorrent/clientGatewayService.ts#L349

This looks the torrent up in an in-memory dictionary, which presumably only uses uppercase hashes.

winterqt avatar Aug 12 '22 01:08 winterqt