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

Creating torrent with a name is broken #4674

Open
vi opened this issue Jul 12, 2019 · 14 comments
Open

Creating torrent with a name is broken #4674

vi opened this issue Jul 12, 2019 · 14 comments

Comments

@vi
Copy link
Contributor

vi commented Jul 12, 2019

Tribler version/branch+revision:

v7.3.0-beta6

Operating system and version:

Linux

Steps to reproduce the behavior:
  1. Start Tribler
  2. Pless the "+" button
  3. "Create torrent from files(s)"
  4. Enter the name of torrent: "vmcaffQvOv"
  5. Enter description: "vlKqMqxxtYq"
  6. Choose directory: let it be for example "m19Kasfq" directory, already in TriblerDownloads. A file path ending in "hello.txt" appears in the list.
  7. Leave some mysterious unlabeled directory field below by default: the user profile directory.
  8. Leave "Seed this torrent" and "Add to my channel" checked.
  9. Press "Create torrent". "Torrent successfully added to the channel".
  10. Go do downloads, find the new torrent, inspect its information. Search for this new content using Tribler Search. Go to "My Channel", inspect the new entry.
Expected behavior:

Download is named "vmcaffQvOv". Channel entry is also named "vmcaffQvOv". All of "vmcaffQvOv", "vlKqMqxxtYq" and "hello.txt" are findable using Tribler Search.

Description "vlKqMqxxtYq" is visible in detailed info bottom pane when entry is selected.

"m19Kasfq" may be or may not be searcheable.

Actual behavior:

Download is named "hello.txt". Channel entry is named "hello.txt". Neither "vlKqMqxxtYq" nor "vmcaffQvOv" is nowhere to be found in GUI. Neither words are searcheable by Triber, only "hello.txt".

Relevant log file output:

User home directory gains file vmcaffQvOv.torrent:

$ aria2c -S vmcaffQvOv.torrent 
>>> Printing the contents of file 'vmcaffQvOv.torrent'...
*** BitTorrent File Information ***
Comment: vlKqMqxxtYq
Creation Date: Fri, 12 Jul 2019 20:47:43 GMT
Created By: Tribler version: 7.0.0-GIT
Mode: single
Announce:
Info Hash: b46e98d0bb72890c143723d35b5d7d27b0e6835f
Piece Length: 16KiB
The Number of Pieces: 1
Total Length: 13B (13)
Name: hello.txt
Magnet URI: magnet:?xt=urn:btih:B46E98D0BB72890C143723D35B5D7D27B0E6835F&dn=hello.txt
Files:
idx|path/length
===+===========================================================================
  1|./hello.txt
   |13B (13)
---+---------------------------------------------------------------------------
@ichorid ichorid added this to the V7.3: Gigachannels milestone Jul 13, 2019
@qstokkink
Copy link
Contributor

I am not too familiar with our most recent search implementation. However, I do know that the BitTorrent protocol doesn't really support file names, especially the names of single file torrents have to resemble the file name. So any sort of name management will have to come from Tribler's channel management/torrent metadata mechanism.

Regarding the metadata mechanism: @ichorid, we do store the custom torrent name and description in the MetadataStore, right? If so, it should just be a matter of tying that in to the search mechanism.

@ichorid
Copy link
Contributor

ichorid commented Jul 15, 2019

@qstokkink , you're completely right: bittorrent protocol does not permit changing the name of the torrent without touching the infohash, and we manage the stuff on our own in GigaChannels metadata entries.

@ichorid ichorid self-assigned this Jul 18, 2019
@qstokkink
Copy link
Contributor

So, if I understand the design correctly, the FtsIndex table does not have the correct references to satisfy the $query:

fts_ids = raw_sql(
"""SELECT rowid FROM ChannelNode WHERE rowid IN (SELECT rowid FROM FtsIndex WHERE FtsIndex MATCH $query
ORDER BY bm25(FtsIndex) LIMIT $lim) GROUP BY infohash""")

@ichorid
Copy link
Contributor

ichorid commented Jul 18, 2019

Not exactly. By design, GigaChan does not store any information about the contents of the torrent. The problem reported by @vi is due to the fact that the torrent "name" field is the object's name on disk (filename for single files, dirname for directories). And we can only rename stuff at the GigaChan metadata level.

@qstokkink
Copy link
Contributor

Aha, then #4683 is a completely separate issue.

@ichorid
Copy link
Contributor

ichorid commented Jul 18, 2019

Torrent creation process is a problem since you have several different cases/parameters that are not orthogonal to each other, and therefor hard to align:

  • single file or dir: torrent name = torrent dir/filename on disk
  • single file or dir + give torrent a name : copy file/dir to a new location (location?), rename the file to the torrent name
  • multiple files -> copy the files to a newly-created dir (torrent name?, location?)
  • multiple files + give torrent a name -> copy the files to a newly-created dir (torrent name), move to (location?)

GigaChan just gets the torrent name and puts it in into the metadata entry. So, the problem is not about GigaChan or the GUI, it is about our torrent-creating routine.

@ichorid ichorid changed the title New torrent name and description seems to be lost after creation Creating torrent with a name is broken Jul 18, 2019
@ichorid
Copy link
Contributor

ichorid commented Jul 18, 2019

The proper way to fix it is by fixing the torrent creation process. As an ugly workaround, we can pass the torrent name that the user suggested through up to the moment we add the torrent to GigaChannel. However, the torrent name in the downloads will still be the same as the filename.

@ichorid
Copy link
Contributor

ichorid commented Jul 18, 2019

So, guys, how should we handle naming torrents created by user, knowing that the toplevel filename/dirname of the torrent must be the same as the user-entered name?

@qstokkink
Copy link
Contributor

We can store the user-entered name in the metadata and display that value when rendering for the GUI.

@vi
Copy link
Contributor Author

vi commented Jul 18, 2019

Main thing about name and description is searchability. Filename should not be the only key to search for. Description is a good place to put various tags and keywords.

GUI concerns are a bit secondary, although it is not nice when you don't see why you get a particular search result.

@ichorid
Copy link
Contributor

ichorid commented Jul 18, 2019

@vi , at this moment, GigaChan is only able to search by metadata title name, that is the by default copied from the torrent name. We're not going to add content search in the foreseeable future, as we already had problems with it in Dispersy times, and it proved to add more noise than information to the search. The best practice with the most successful torrent trackers is to only index torrent title for the search, but have it descriptive and not bound to the torrent dir/name.

@vi
Copy link
Contributor Author

vi commented Jul 18, 2019

Then this torrent name (which becomes metadata title name) should be overridable by user.

Description should also be visible when clicking at search results (maybe after waiting for the file list).

@ichorid
Copy link
Contributor

ichorid commented Jul 18, 2019

Metadata title is editable in the personal channel table. You can change the category as well. Torrent's description is not served through GigaChannels. Though it should definitely be shown with the files.

@Nubro01
Copy link

Nubro01 commented Dec 7, 2019

Dec 6th version 7.4.0 still has a problem. Downloaded all Intel docs and tried to make a Torrent and it was created, but it wants to download the files, althought they are already there, so???

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

No branches or pull requests

6 participants