Skip to content

Commit

Permalink
feat: [#536] remove always-empty peer list in torrent list item
Browse files Browse the repository at this point in the history
It's unused.
  • Loading branch information
josecelano committed Jan 2, 2024
1 parent 9826400 commit c150db7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/servers/apis/v1/context/torrent/resources/torrent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ pub struct ListItem {
/// The torrent's leechers counter. Active peers that are downloading the
/// torrent.
pub leechers: u64,
/// The torrent's peers. It's always `None` in the struct and `null` in the
/// JSON response.
pub peers: Option<Vec<super::peer::Peer>>, // todo: this is always None. Remove field from endpoint?
}

impl ListItem {
Expand Down Expand Up @@ -90,7 +87,6 @@ impl From<BasicInfo> for ListItem {
seeders: basic_info.seeders,
completed: basic_info.completed,
leechers: basic_info.leechers,
peers: None,
}
}
}
Expand Down Expand Up @@ -156,7 +152,6 @@ mod tests {
seeders: 1,
completed: 2,
leechers: 3,
peers: None,
}
);
}
Expand Down
3 changes: 0 additions & 3 deletions tests/servers/api/v1/contract/context/torrent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ async fn should_allow_getting_torrents() {
seeders: 1,
completed: 0,
leechers: 0,
peers: None, // Torrent list does not include the peer list for each torrent
}],
)
.await;
Expand Down Expand Up @@ -65,7 +64,6 @@ async fn should_allow_limiting_the_torrents_in_the_result() {
seeders: 1,
completed: 0,
leechers: 0,
peers: None, // Torrent list does not include the peer list for each torrent
}],
)
.await;
Expand Down Expand Up @@ -95,7 +93,6 @@ async fn should_allow_the_torrents_result_pagination() {
seeders: 1,
completed: 0,
leechers: 0,
peers: None, // Torrent list does not include the peer list for each torrent
}],
)
.await;
Expand Down

0 comments on commit c150db7

Please sign in to comment.