-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add playlists feature #871
Conversation
* replaces `pickFileToPlay` feature * when reopening player, restores the most recently viewed file
@@ -96,7 +96,7 @@ function chromecastPlayer () { | |||
|
|||
function open () { | |||
var torrentSummary = state.saved.torrents.find((x) => x.infoHash === state.playing.infoHash) | |||
ret.device.play(state.server.networkURL, { | |||
ret.device.play(state.server.networkURL + '/' + state.playing.fileIndex, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd put this into its own function to reduce code duplication. (Notice the two lines that look just like this one further down)
@Goldob thanks for doing this! Looks great I think it can be simplified a bit
Here's why:
The new UI (menu buttons plus player icons for skipping forward and back) looks great to me. |
Tempted to merge this now and make a follow up PR to avoid conflicts with #863 |
this._shuffled = false | ||
} | ||
|
||
// ============================================================================= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't add ascii banners like this. We don't have them anywhere else in the code
Just tested it, and I get this error when it auto skips to next track:
This is probably a Chrome issue as discussed in #599. Not sure if it's serious though. |
.filter((object) => TorrentPlayer.isPlayable(object.file)) | ||
.sort(function (a, b) { | ||
if (a.file.name < b.file.name) return -1 | ||
if (b.file.name < a.file.name) return 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to sort the files by name? I think preserving the original order makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files in torrent list are displayed alpabetically, so I think it's reasonable to keep that order. Also, when we stick to file indices, the sequence appears totally random.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have an example? All torrents I've checked is ordered reasonably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just checked and you are right. I had problem with one particular torrent and that's why I assumed it would be the case everywhere.
That said, getting rid of file sorting would let for yet another simplification of the code.
Anyway, for the sake of consistency, I think the alphabetical order should go either both in playlists and torrent list or none of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Goldob @mathiasvr I agree, I think keeping the original order is probably a good idea.
@feross what was the reason for sorting torrents alphabetically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess sort by name is okay.
I agree that it should be consistent, maybe it would be easier to sort the files initially and stick with that order everywhere else?
Thank you very much for the feedback! I'll introduce the suggested changes. The @mathiasvr, similar error appears sometimes if you change tracks too fast. It is caused by the Chrome issue, just like you said. In case of autoplaying my guess is that it tries to replay the file after reaching the end, but before it is able to do that, new media object replaces it. |
@Goldob looks great. I have a few nitpicks still but they're really small and easy to fix later. 🚢 🚢 🚢 |
Awesome to see that merged. One remark from me, before actually releasing this it would be nice to add a line to |
Open multi-file torrents as playlists. Basically #642 after rebase.
Solves #123 and #839.