-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use infohash instead of torrent ID in API URLs #140
Use infohash instead of torrent ID in API URLs #140
Conversation
It does need to be public.
We have to start the test env before the condition to skip the test: ``` if !env.provides_a_tracker() { println!("test skipped. It requires a tracker to be running."); return; } ``` Itherwise the test is never executed, even when you are using the shared env: ``` TORRUST_IDX_BACK_E2E_SHARED=true cargo test ```
They will used in a new struct InfoHash.
…ent/download/{infohash} BREAKING CHANGE: you can not use the odl endpoint enaymore: `GET /torrent/download/{id}`. You have to use the torrent infohash.
Hi @WarmBeer @da2ce7 , I've finished the first endpoint. It should be easy to change the rest of the endpoints. The hardest part is done. Notice that I've copied the whole InfoHash implementation from the Tracker. At some point, we should publish the bit_torrent mod as an independent package. Form the time being, I've just copied it. The |
Since we are going to change those endpoint, it's convenient to add more test. Endpoints starting with `torrent/{id}` will be change to use the infohash instead of the internal torrent id, generated by the database.
BREAKING CHANGE: you cannot use the old endpoints anymore: - `GET /torrent/{id}`. - `PUT /torrent/{id}`. - `DELETE /torrent/{id}`. New endpoints: - `GET /torrent/{infohashi`. - `PUT /torrent/{infohash}`. - `DELETE /torrent/{infohash}`.
Those files are only realted to `tests\database` tests.
ACK de56be0 |
GET /torrent/download/{id}
toGET /torrent/download/{infohash}
GET /torrent/{id}
toGET /torrent/{infohash}
PUT /torrent/{id}
toPUT /torrent/{infohash}
DELETE /torrent/{id}
toDELETE /torrent/{infohash}