Store item context in player queue playlist#18
Store item context in player queue playlist#18darrell-k wants to merge 202 commits intopublic/9.0from
Conversation
…mserver-platforms` repo to LMS core. We still have to keep the `Custom.pm` around to tell LMS to use `Docker.pm`, as Linux run in Docker can't recognize it's actually a container.
But don't create a new DB version for this. Just drop it when we happen to re-build.
We must define the workflow inputs, not only the reference. The latter is only used to tell where to use the workflow from, but not what branch to build from.
Add library protocol-websocket https://metacpan.org/dist/Protocol-WebSocket
`gdresize.pl` must have been broken for a decade or more. Ever since we stopped using `Cache::FileCache`. The Control Panel only ever was used on Windows 32-bit. Let's get rid of it.
Upgraded Websocket handler
Don't convert payload to UTF8 if the call is server ping
Add Simple Async Web Sockets
Corrected formatting and typos in the example
…ould serve cached content.
Going forward the repository files should provide a simple md5 hash to verify the installers authenticity. Use it to verify the file after download. Signed-off-by: Michael Herger <michael@herger.net>
The MusicBrainz-supported ORIGINALDATE was added to Ogg with 3beabe2. Signed-off-by: Jonny Bylsma <jmbylsma@gmail.com>
…naldate Use ORIGINALDATE tag with Flac
Signed-off-by: BoringName15 <154511951+BoringName15@users.noreply.github.com>
…r-Wav-and-Opus Update ConnectionManager.pm to add checks for Wav and Opus
Signed-off-by: Michael Herger <michael@herger.net>
Signed-off-by: Michael Herger <michael@herger.net>
Previously the plugin only registered for LMS events when the Control Point subscribed to UPnP events. This meant the play state was not updated for Control Points that did not support UPnP eventing. This change fixes that. Signed-off-by: BoringName15 <154511951+BoringName15@users.noreply.github.com>
Signed-off-by: darrell-k <darrell@darrell.org.uk>
| if (defined(my $work_id = $request->getParam('work_id')) && $work_id eq '-1') { | ||
| $what->{'track.work'} = { '!=' => [undef] }; | ||
| } | ||
|
|
There was a problem hiding this comment.
An incidental enhancement to allow work_id:-1 in the playlistcontrol command so that when adding multiple works in one go (eg all for a composer or genre) only tracks that are part of a work are added.
| $track->added_from_work("1"); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Here we set the virtual column if the queue entries are being added via a work browse.
| $count++ | ||
| } | ||
| $count = 0; | ||
|
|
There was a problem hiding this comment.
Build a hash keyed by playlist index number to store the virtual column.
Slim/Control/Queries.pm
Outdated
| } | ||
| } | ||
| else { | ||
| $data->{'added_from_work'} = $addedFromWork{$count}; |
There was a problem hiding this comment.
Now add the virtual column to the $data passed in to _addSong
Slim/Control/Queries.pm
Outdated
|
|
||
| $returnHash{id} = $res->{'tracks.id'}; | ||
| $returnHash{title} = $res->{'tracks.title'}; | ||
| $returnHash{added_from_work} = $res->{added_from_work} if $res->{added_from_work}; |
There was a problem hiding this comment.
Add the virtual column to the returned data if it exists
|
|
||
| if ( !scalar keys %{$attributes} ) { | ||
| $track = Slim::Schema->objectForUrl($entry); | ||
| $track->added_from_work($addedFromWork); |
There was a problem hiding this comment.
Add the flag to the Track object.
|
|
||
| main::DEBUGLOG && $log->debug(" found addedFromWork: $addedFromWork"); | ||
| } | ||
|
|
There was a problem hiding this comment.
Read the flag from the player playlist file.
|
|
||
| if (my $addedFromWork = $item->get_column('added_from_work')) { | ||
| print $output "#ADDEDFROMWORK:$addedFromWork\n"; | ||
| } |
There was a problem hiding this comment.
Write the flag to the m3u file.
Slim/Schema/Track.pm
Outdated
| ); | ||
|
|
||
| $class->add_virtual_columns('added_from_work'); | ||
|
|
There was a problem hiding this comment.
Add the virtual column to the Track class.
At present there is no way to clear the item from the current playlist when the playlist only contains that one item. This change restores the ability to remove that item from the playlist by adding the "Remove from playlist" context menu item, even when the playlist only that 1 item. This option had historically been present, but was removed in commit 71e36d4 (Unnecessary items in context menu for current-playlist tracks, 2012-02-22). Signed-off-by: Martin Williams <martinr.williams@gmail.com>
…_with_one_item Fix: BUG 17980 - Allow item removal even if playlist has only 1 item
We've seen this step fail on macOS quite a bit. A re-run would "fix" it. Signed-off-by: Michael Herger <michael@herger.net>
Signed-off-by: Michael Herger <michael@herger.net>
…t-handler Update AVTransport.pm to move LMS event registration
Signed-off-by: darrell-k <darrell@darrell.org.uk>
Signed-off-by: darrell-k <darrell@darrell.org.uk>
Signed-off-by: darrell-k <darrell@darrell.org.uk>
Signed-off-by: darrell-k <darrell@darrell.org.uk>
Signed-off-by: darrell-k <darrell@darrell.org.uk>
The objective here is to store the context in which items were added to the play queue (specifically, did the added play queue items originate from a Works browse or not).
This data can then be used by clients to assist in grouping play queue entries.
This is achieved by adding a new flag to the player's m3u file - #ADDEDFROMWORK.
Play queue entries are written/retrieved using a Track object. Therefore I've added a Virtual Column to that object to facilitate passing in and out the necessary data.
This has required adding a extra CPAN module - nothing too big, it's 10k in size.
See detailed notes added against the changed code.