GithubHelp home page GithubHelp logo

Comments (10)

Rigellute avatar Rigellute commented on May 22, 2024

Intereting point 👍

from spotify-tui.

SgiobairOg avatar SgiobairOg commented on May 22, 2024

Completely new to Rust but, as this is a super interesting project could I offer to take a crack at this issue?

from spotify-tui.

jfaltis avatar jfaltis commented on May 22, 2024

I would suggest to use Shift+S or Alt+s to enter a "sort mode" which basically just listens for the next keypress and processes it to decide to sort by what criteria. E.g t for title, a for artist, l for length etc. Maybe it could also show some kind of "Statusbar" with the sorting criterias and corresponding keys while being in "sort mode"

from spotify-tui.

Rigellute avatar Rigellute commented on May 22, 2024

Upper case S (i.e. <Shift+S>) sounds like a good binding to me.

And if you want to take a crack at it @SgiobairOg, be my guest!

from spotify-tui.

SgiobairOg avatar SgiobairOg commented on May 22, 2024

So, handling the key inputs is straightforward enough, even with no Rust experience.

Could someone point me to the code that handles populating the track table though? I'm assuming I can just grab the tracks from app.track_table.tracks, and sort them with slice::sort_by. Not sure how to update the display and set the current track if one is playing.

from spotify-tui.

debdutto avatar debdutto commented on May 22, 2024

@SgiobairOg Are you still working on this? Was hoping to have a crack at it over the weekend?

from spotify-tui.

SgiobairOg avatar SgiobairOg commented on May 22, 2024

I was, but don’t actually know how to do the sort and haven’t had time to figure it out. I can commit a branch if you want so you can have what I’ve got so far.

from spotify-tui.

luiswirth avatar luiswirth commented on May 22, 2024

I've been spending some time on this issue and there seem to be some obstacles in implementing this...

I was successful in sorting the tracks by Title, Artist, Album and Duration depending on the keyboard input. But the difficulty lies in starting the playback and have the tracks play in the same order as they are in the TrackTable. If I'm right I must pass all the URIs of all tracks in the correct order to the spotify-api. So far we've just passed None as argument, since we just used the default ordering. I hope this doesn't have any noticeable performance implications when playing big playlists.

I will continue working on it.

If somebody wants to follow along: My Fork. Feedback is very welcome!

from spotify-tui.

Rigellute avatar Rigellute commented on May 22, 2024

You are right @LU15W1R7H, we can sort the display for the tracks and can even get the playback to work in that order - but the limitation is that Spotify will only play those tracks that have been sorted (once you get to the end of that list, playback will stop).

Perhaps this is intentional, but means we will need to correctly manage unsorted (i.e. default) mode, which has the full context of the current playback (playlist/album etc.). That is to say we don't specify an array of URLs.

Totally doable, but more state to manage!

from spotify-tui.

luiswirth avatar luiswirth commented on May 22, 2024

@Rigellute yeah, thats totally true. I would also prefer another solution, I just haven't found one so far. It seems the spotify-api just doesn't provide the ability the play the songs in some predefined order...

from spotify-tui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.