From 6316e00f8cba1ae2a02b9d040568449d69e627b2 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Mon, 9 Oct 2023 17:34:07 +0300 Subject: [PATCH] code review add comment regarding -1 fileIndex --- src/types/resource/stream.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/types/resource/stream.rs b/src/types/resource/stream.rs index 71cefb401..ff2d702cb 100644 --- a/src/types/resource/stream.rs +++ b/src/types/resource/stream.rs @@ -180,6 +180,8 @@ impl Stream { match url.path_segments_mut() { Ok(mut path) => { path.push(&hex::encode(info_hash)); + // When fileIndex is not provided use -1, which will tell the + // streaming server to choose the file with the largest size from the torrent path.push( &file_idx.map_or_else(|| "-1".to_string(), |idx| idx.to_string()), );