Sioro-Neoku / go-peerflix

Go Peerflix
MIT License
470 stars 119 forks source link

Option to select a specific file #26

Open nochso opened 8 years ago

nochso commented 8 years ago

Some ideas:

Sioro-Neoku commented 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

nochso commented 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.

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.

Sioro-Neoku commented 8 years ago

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.)

nochso commented 8 years ago

termui looks quite nice. Alternatively you could pause the refresh while asking for input.

nochso commented 8 years ago

On second thought, termui seems more specialized towards being a dashboard. gocui might be an alternative.