Open nochso opened 8 years ago
I'm a bit concerned about over-complicating the selection part, as it is really neat now, and having to select a file comes up very rarely. The biggest issue that I see is a user-friendly way to select the desired file(s).
In any case, peerflix does this, so we might get some ideas from it: https://github.com/mafintosh/peerflix/blob/master/index.js#L53
I'm a bit concerned about over-complicating the selection part, as it is really neat now, and having to select a file comes up very rarely.
In that case, I'd be ok with only a bool-flag -select-file
to override the default "largest file". The file extension whitelist is not needed then.
The biggest issue that I see is a user-friendly way to select the desired file(s).
I was thinking of something simple like:
$ go-peerflix -select-file <link>
...
Files found in torrent:
0: File1.mkv
1: File2.mkv
...
20: File21.mkv
Enter # (0-20) of the file you want to play: _
That way the default behavior is kept and you can override it if needed.
If we go in that direction, it might worth to port the whole ui to termui, and implement the selector there.
This would help on other areas as well, as logging sucks because the screen refresh erases the written log messages, and less than a second is rarely enough to understand these messages. (On the other hand they are rarely actionable, but at the very least they are a visual annoyance now.)
termui looks quite nice. Alternatively you could pause the refresh while asking for input.
Some ideas:
-select-file
to allow overriding.