Comments (10)
Intereting point 👍
from spotify-tui.
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.
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.
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.
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.
@SgiobairOg Are you still working on this? Was hoping to have a crack at it over the weekend?
from spotify-tui.
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.
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 URI
s 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.
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.
@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)
- App plays with computer audio instead of headphone while I am using headphone HOT 1
- cargo install soptify-tui failed. HOT 5
- Alternatives for this abandonware? HOT 2
- Specifying device in configuration file / forcing tui to use specific device
- spt keeps returning to error when I connect to Sonos HOT 2
- Is playing from CLI? HOT 1
- wezterm terminal issue HOT 4
- EQ bars color
- re-run HOT 1
- Can't Access Artist Page HOT 3
- Spotify TUI only works when a song is selected that I have never heard before. HOT 2
- Spotify-tui is not available in Slovenia HOT 5
- "Play recommendations for song/artist" no worky HOT 2
- [Question] Alternative for Free Non-Premium accounts HOT 1
- It would be possible to add support for fresh openssl ? HOT 1
- Getting error when loading spt HOT 2
- Error during brew install HOT 2
- Autoplay plays songs in the search list, instead of playing songs of same type HOT 1
- Unable to install in Mac HOT 5
- Callback on Different Device? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spotify-tui.