Feature: inlude the canonical info hash group in the torrent details response#518
Merged
josecelano merged 3 commits intotorrust:developfrom Mar 5, 2024
Conversation
… API response
```json
{
"data": {
"torrent_id": 2,
"uploader": "admin",
"info_hash": "0c90fbf036e28370c1ec773401bc7620146b1d48",
"title": "Test 01",
"description": "Test 01",
"category": {
"id": 5,
"category_id": 5,
"name": "software",
"num_torrents": 1
},
"upload_date": "2024-03-05 16:05:00",
"file_size": 602515,
"seeders": 0,
"leechers": 0,
"files": [
{
"path": [
"mandelbrot_set_01"
],
"length": 602515,
"md5sum": null
}
],
"trackers": [
"udp://localhost:6969"
],
"magnet_link": "magnet:?xt=urn:btih:0c90fbf036e28370c1ec773401bc7620146b1d48&dn=Test%2001&tr=udp%3A%2F%2Flocalhost%3A6969",
"tags": [],
"name": "mandelbrot_set_01",
"comment": "Mandelbrot Set 01",
"creation_date": 1687937540,
"created_by": "Transmission/3.00 (bb6b5a062e)",
"encoding": "UTF-8",
"canonical_info_hash_group": [
"d5eaff5bc75ed274da7c5294de3f6641dc0a90ce",
"e126f473a9dee89217d7ae5982f9b21490ed2c3f"
]
}
}
```
Notice the new field: `canonical_info_hash_group` at the end of the
JSON.
That was fixed.
Member
Author
|
ACK 2abb62a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add to the responses (torrent details and after updating a torrent) the list of info-hashes that belong to the same canonical info-hash. Table
torrust_torrent_info_hashesNew response for torrent details:
{ "data": { "torrent_id": 2, "uploader": "admin", "info_hash": "0c90fbf036e28370c1ec773401bc7620146b1d48", "title": "Test 01", "description": "Test 01", "category": { "id": 5, "category_id": 5, "name": "software", "num_torrents": 1 }, "upload_date": "2024-03-05 16:05:00", "file_size": 602515, "seeders": 0, "leechers": 0, "files": [ { "path": [ "mandelbrot_set_01" ], "length": 602515, "md5sum": null } ], "trackers": [ "udp://localhost:6969" ], "magnet_link": "magnet:?xt=urn:btih:0c90fbf036e28370c1ec773401bc7620146b1d48&dn=Test%2001&tr=udp%3A%2F%2Flocalhost%3A6969", "tags": [], "name": "mandelbrot_set_01", "comment": "Mandelbrot Set 01", "creation_date": 1687937540, "created_by": "Transmission/3.00 (bb6b5a062e)", "encoding": "UTF-8", "canonical_info_hash_group": [ "d5eaff5bc75ed274da7c5294de3f6641dc0a90ce", "e126f473a9dee89217d7ae5982f9b21490ed2c3f" ] } }Notice the new field
canonical_info_hash_group.Both the
d5eaff5bc75ed274da7c5294de3f6641dc0a90ceande126f473a9dee89217d7ae5982f9b21490ed2c3fwere uploaded torrents that produced the same canonical info-hash0c90fbf036e28370c1ec773401bc7620146b1d48