media info
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user