media info

This commit is contained in:
Mateusz Gruszczyński
2026-05-21 09:49:50 +02:00
parent ac5113055d
commit bd9be0d11c
5 changed files with 277 additions and 2 deletions

View File

@@ -98,6 +98,18 @@ def torrent_files(torrent_hash: str):
@bp.get("/torrents/<torrent_hash>/files/<int:file_index>/mediainfo")
def torrent_file_media_info(torrent_hash: str, file_index: int):
profile = preferences.active_profile()
if not profile:
return jsonify({"ok": False, "error": "No profile"}), 400
try:
# Note: The route is additive and keeps all existing file endpoints unchanged.
return ok({"media_info": rtorrent.torrent_file_media_info(profile, torrent_hash, file_index)})
except Exception as exc:
return jsonify({"ok": False, "error": str(exc)}), 400
@bp.post("/torrents/<torrent_hash>/files/priority")
def torrent_file_priority(torrent_hash: str):
profile = preferences.active_profile()