rndusr / torf-cli

CLI tool for creating, reading and editing torrent files
GNU General Public License v3.0
134 stars 13 forks source link

Differentiate adding trackers via CSV and -t #22

Closed vRobM closed 4 years ago

vRobM commented 4 years ago

When adding trackers to a .torrent via -t t1,t2,t3, it adds them all under one block. When adding trackers to a .torrent via -t t1 -t t2 -t t3, it does the same.

Adding via separate -t parameters, it should add that -t set + and CSV into one block, and the next -t into a new block.

some torrent clients only use the first tracker in a block. separating each tracker into separate blocks uses all trackers at once.

rndusr commented 4 years ago

Works for me:

$ torf foo -t http://foo:123,http://foo:456 -t http://bar:789
[...]
   Trackers  Tier 1: http://foo:123
                     http://foo:456
             Tier 2: http://bar:789

What does torf --version say?

vRobM commented 4 years ago

3.2.0

There appears to be intermittent behavior and tracker printing problems.

After just adding 5 trackers, the output does not show tiers from the command adding them or separately, after the fact. Loading up the torrent though does show separate trackers rather than a list.

hope that helps reproduce it.

rndusr commented 4 years ago

Can you give me an exact command?

vRobM commented 4 years ago

torf -i a.torrent -t http://foo:1 -t http://foo:2 -t http://foo:3 -t http://foo:4 -t http://foo:5 -o b.torrent

Trackers http://foo:1 http://foo:2 http://foo:3 http://foo:4 http://foo:5

rndusr commented 4 years ago

OK, I can reproduce it. It seems to happen if there is only one tracker in a tier.

Thanks.

vRobM commented 4 years ago

Thank you, for taking a serious look.

rndusr commented 4 years ago

OK, turns out this isn't really a bug, it's just bad UX.

The trackers are stored in multiple tiers as expected, but torf doesn't display different tiers if all tiers contain only one tracker. That's why it looks like they are all in the same tier.

I'm not sure what the best fix would be. If there is only one tracker, it looks weird with "Tier 1:" in front of the URL. I guess the best solution would be to always display the tiers unless there is only a single tracker in a single tier.

I'm open for suggestions.

vRobM commented 4 years ago

Being explicit makes sense. Perhaps add another label for the non-tier structure. List perhaps.

vRobM commented 4 years ago

Another input method would also be interesting, such as an interactive mode, where one can pick a section to edit, then get a free form text box to paste a bunch of information, and after it's parsed torf asks the intent, list of tier mode, taking any indents and spaces into consideration, etc.

I realize that's a big feature, but also a more human friendly approach.

rndusr commented 4 years ago

You mean torf should list the trackers twice, once as a flat list and then again as tiers?

That just adds clutter in my opinion. Especially for single-tracker torrents.

rndusr commented 4 years ago

Yeah, that's a very big feature.

Maybe an option to edit the tracker list in $EDITOR would be nice. But that wouldn't solve the display issue.

vRobM commented 4 years ago

You mean torf should list the trackers twice, once as a flat list and then again as tiers? That just adds clutter in my opinion. Especially for single-tracker torrents.

no, only one at a time, but distinguish. So either it's a tiered list or a list of tiers, but it should be obvious in the representation.

rndusr commented 4 years ago

How would torf decide which display style to use?

vRobM commented 4 years ago

start with the Tier.

By default the 0 Tier is always present and either has a list of trackers or only one. rinse repeat for additional tiers.

rndusr commented 4 years ago

I went with my original idea of always showing the tier unless there only a single tracker, which is the only case where tiers are really irrelevant.