Skip to content

Commit

Permalink
code review add comment regarding -1 fileIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeastLT committed Oct 9, 2023
1 parent c4bb7cb commit 6316e00
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/types/resource/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
);
Expand Down

0 comments on commit 6316e00

Please sign in to comment.