Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torrent endpoints for a single torrent are using the infohash instead of the ID #4

Closed
josecelano opened this issue May 8, 2023 · 2 comments

Comments

@josecelano
Copy link
Member

API Issue: torrust/torrust-index#115
API PR: torrust/torrust-index#140

Some endpoints containing information about a single torrent have changed. Now, we use the info hash instead of the torrent ID automatically generated by the database. The endpoints are:

  • GET /torrent/download/{id} -> GET /torrent/download/{infohash}
  • GET /torrent/{id} -> GET /torrent/{infohash}
  • PUT /torrent/{id} -> PUT /torrent/{infohash}
  • DELETE /torrent/{id} -> DELETE /torrent/{infohash}

@WarmBeer @da2ce7

@josecelano
Copy link
Member Author

For example, the endpoint to upload a new torrent: torrust/torrust-index#146. The new response included the info-hash:

pub struct NewTorrentResponseData {
    pub torrent_id: TorrentId,
    pub info_hash: String,
}

See https://github.com/torrust/torrust-index-backend/blob/develop/src/web/api/v1/contexts/torrent/responses.rs#LL11C1-L14C2

We need to change the type for that response here to fix an issue in the frontend repo:

torrust/torrust-index-gui#97

We can change all the endpoints to mirror the current state of the API. That means we could need to change other endpoints too. Review all of them.

@josecelano
Copy link
Member Author

Done in this commit 4f10e04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant