-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Sort songs in playlist by the time they were added #1576
Comments
Apart from "Spotify has it," what would be a reason for this "feature"? |
It's a lot easier to organise songs this way rather than it being on
shuffle.
…On Tue, 8 Nov 2022 at 01:08, Phan An ***@***.***> wrote:
Except for "Spotify has it," what would be a reason for this "feature"?
—
Reply to this email directly, view it on GitHub
<#1576 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALEBOMGNTUEUPFR4BBP3FBLWHEH6PANCNFSM6AAAAAARY5XRKQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I think the better way (which Spotify supports btw) is to be able to re-order the songs in playlists. This, however, isn't too high on my list. |
Yeah that'd also be a good way to sort it.
…On Tue, 8 Nov 2022 at 08:58, Phan An ***@***.***> wrote:
I think the better way (which Spotify supports btw) is to be able to
re-order the songs in playlists. This, however, isn't too high on my list.
—
Reply to this email directly, view it on GitHub
<#1576 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALEBOMAEDNJZUP4PZFOHL53WHF7CBANCNFSM6AAAAAARY5XRKQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Is there a way to rearrange the order of songs in a playlist? |
This is really a very important thing that greatly affects on the UI convenience |
For now I've been using "Shuffle" on the Favorites, but I would like this feature since usually the songs I've just added to the favorites are the current "fire" I'm listening to so I want to listen to them either shuffled or in the order they were added. |
DJ'ing. From time to time, I DJ dance events. In this scenario, being able to replay a playlist in the order that I curated it is critical. I've been doing it in iTunes, and I want to get rid of it for obvious reasons. So I wrote some code to parse my iTunes library and upload it to my Koel instance, but since Koel doesn't preserve the ordering of songs, it's not fit for this purpose. |
Good point. I will include it in a future version.
…On Wed, Jan 17, 2024 at 22:51 Erik Ylvisaker ***@***.***> wrote:
Apart from "Spotify has it," what would be a reason for this "feature"?
DJ'ing. From time to time, I DJ dance events. In this scenario, being able
to replay a playlist in the order that I curated it is *critical*. I've
been doing it in iTunes, and I want to get rid of it for obvious reasons.
So I wrote some code to parse my iTunes library and upload it to my Koel
instance, but since Koel doesn't preserve the ordering of songs, it's not
fit for this purpose.
—
Reply to this email directly, view it on GitHub
<#1576 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB5O3US7S4QMRTNJFOQDYTLYPBBW7AVCNFSM6AAAAAARY5XRKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJWHE2TINRXHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
So surprised to find that there is no way to order songs! The way Spotify has it is perfect, default to sort by date added, but allow reorder (so implementation-wise, the song order would default to an int based on the count songs in the playlist). |
This feature will land in the next version :)
…On Mon, Feb 5, 2024 at 16:38 Caen De Silva ***@***.***> wrote:
Good point. I will include it in a future version.
So surprised to find that there is no way to order songs! The way Spotify
has it is perfect, default to sort by date added, but allow reorder (so
implementation-wise, the song order would default to an int based on the
count songs in the playlist).
—
Reply to this email directly, view it on GitHub
<#1576 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB5O3UQZBOVQL5KVSCFJW6TYSD4IXAVCNFSM6AAAAAARY5XRKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRXGI4DANBUG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Awesome! I made an embarrassingly crude patch for myself until then, if anyone dares to use it public function index(Playlist $playlist)
{
$this->authorize('own', $playlist);
// Get the raw songs data from the playlist as an array
$rawSongsData = DB::table('songs')
->select('songs.*', 'playlist_song.order')
->join('playlist_song', 'songs.id', '=', 'playlist_song.song_id')
->join('playlists', 'playlists.id', '=', 'playlist_song.playlist_id')
->where('playlists.id', $playlist->id)
->orderBy('playlist_song.order')
->orderBy('songs.title')
->get()
->toArray();
// Transform raw data into Song model instances
$rawSongs = collect($rawSongsData)->map(function ($rawSong) {
return new Song((array) $rawSong);
});
// Reorder the raw songs collection based on the 'order' value
$orderedSongs = $rawSongs->sortBy('order');
// Override the track value with the 'order' value
$orderedSongs->each(function ($song, $index) {
$song->track = $index + 1; // Assuming 1-based track numbering
});
// Transform the ordered collection into SongResource
$return = SongResource::collection($orderedSongs);
return $return;
} Schema::table('playlist_song', function (Blueprint $table) {
$table->integer('order')->default(0);
}); Still needs to have the priority set when adding to playlist, and also support reorder |
Description
Sorting playlists in order of the time they were added (like spotify).
Example
Spotify has this with playlists.
The text was updated successfully, but these errors were encountered: