You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #498: After uploading a torrent show a message to the user if the torrent info-hash changes
32b07df docs: add Canonical Infohash Group info to user guide (Jose Celano)
4afc1a8 feat: [#242] improve message after uploading when infohash changes (Jose Celano)
Pull request description:
After uploading a torrent show a message to the user if the torrent info-hash changes.
ACKs for top commit:
josecelano:
ACK 32b07df
Tree-SHA512: 07c557d25f90025395726d062ccdb0ca532d15889a5a3e54d682adef7f0a26f1f504f0e2035854791fa66ffe6b2b47a127112b890041a1a2ceb585163ee2488b
Copy file name to clipboardExpand all lines: docs/user_guide.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,33 @@ You can add a PNG image with:
24
24
25
25
The image will be proxied by the backend. This means that the image will be downloaded by the backend and served by the backend itself. The backend will cache the image but you have to make sure that the image is available at the URL you provided.
26
26
27
+
### Canonical Infohash Group
28
+
29
+
We only support standard fields in the torrent info dictionary.
30
+
31
+
```rust
32
+
pubstructTorrentInfoDictionary {
33
+
pubname:String,
34
+
pubpieces:Option<ByteBuf>,
35
+
pubpiece_length:i64,
36
+
pubmd5sum:Option<String>,
37
+
publength:Option<i64>,
38
+
pubfiles:Option<Vec<TorrentFile>>,
39
+
pubprivate:Option<u8>,
40
+
pubpath:Option<Vec<String>>,
41
+
pubroot_hash:Option<String>,
42
+
pubsource:Option<String>,
43
+
}
44
+
```
45
+
46
+
Check the data structure [TorrentInfoDictionary](https://github.com/torrust/torrust-index/blob/develop/src/models/torrent_file.rs) for an updated version of the supported fields.
47
+
48
+
We allow uploading torrents with other custom fields, however those extra fields are removed from the torrent `info` dictionary. That causes the infohash to change. We call the "Canonical Infohash" the resulting infohash after removing the non-standard fields from the `info` dictionary.
49
+
50
+
You can use the original infohash in URLs to navigate to the torrent details and you also have a list of original infohashes belonging to the same infohash group in the torrent details.
51
+
52
+
If you think there is an important field missing in the `info` dictionary, please open an issue.
53
+
27
54
## Categories
28
55
29
56
Torrents can have only one category. You have to assign a category to your torrent when you upload it.
Copy file name to clipboardExpand all lines: pages/upload.vue
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -160,11 +160,17 @@ function submitForm () {
160
160
.then((new_torrent) => {
161
161
uploading.value=false;
162
162
163
+
let text ="Torrent uploaded!";
164
+
165
+
if (new_torrent.canonical_info_hash!==new_torrent.info_hash) {
166
+
text+=` Original infohash ${new_torrent.info_hash} has changed because non-standard info dictionary fields were removed. New infohash is ${new_torrent.canonical_info_hash}`;
0 commit comments