Skip to content
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

Improve Quick Play support + Add support for Music Videos #1376

Merged
merged 22 commits into from
Oct 28, 2023

Conversation

cewert
Copy link
Member

@cewert cewert commented Sep 16, 2023

Expand Quick Play support for everything (tested on my server) except photos

NOTE: Some queries take a little while to load (like shuffling a large series or shuffling an artist with a lot of songs) and since there is no loading spinner it may seem as if the app is unresponsive.

Changes

  • BoxSet support added
    • Shuffle play all the items in the collection
    • Works from home screen and library view when viewing collections
  • Series support added
    • Play the first unwatched episode
      • If all episodes are watched, shuffle play all episodes
    • Works from the home screen and TV library view
  • Season support added
    • Play the first unwatched episode
      • If all episodes are watched, play the whole season starting from episode 1
    • Works from the home screen and series detail view
  • Album support added
    • Play the whole album starting from track 1
    • Works from the home screen, music library view(when viewing albums), and music artist detail view
  • Music artist support added
    • Shuffle all songs by found by the selected artist
    • Works from the home screen and music library view
  • "More Like This" support
    • Enable support for Quick Play on the "More Like This" row found on the "Extras" slider
    • Works on the movie detail view and the series detail view
  • Playlist support added
    • Shuffle play all items inside of playlist
    • Tested with a playlist full of songs and one with movies
    • Works on the home screen(favorites), and on the "Playlists" library view
  • Remove individual songs from the favorites row on the home screen.
  • Show loading spinner
  • Add support for "Appears on" row when viewing music artist
  • Fix music logic so that all songs are played when quick playing an artist or music library
    • Number of songs in playlist now matches the number of songs listed in the "Artist (Presentation)" view
  • Optimize api quieries
    • To shuffle play all 1366 of the songs in my music library now takes ~3.8 seconds
  • Add "collectionFolder" support
    • Supports movies, tvshows, boxsets, and music collection types
      • movies: shuffle play all movies found in collection
      • tvshows: shuffle play all watched episodes in collection
      • boxsets: pick a random boxset inside and play all the items inside
      • music: shuffle play all audio files in collection
    • Works from the "My Media" and favorite rows on the home page and also the main grid view
  • Add "UserView "support
    • Supports playlists collection type
    • Picks a random playlist inside and shuffle plays it
    • Works from the "My Media" and favorite rows on the home page and also the main grid view
  • Move quick play logic out of main and into it's own file under a namespace of quickplay

Issues

Fixes #1138
Fixes #1139
Fixes #1399

@cewert cewert requested a review from a team as a code owner September 16, 2023 21:30
@sevenrats
Copy link
Member

there actually is a loading spinner in there. or, at least there was, I haven't looked. its implemented as a progressDialog where everything except the loading spinner has its visibility shut off. it was working normally until the universal playslist changes. all to say, it may just still be in there with the wrong z index or visibility

@sevenrats
Copy link
Member

parts of it are still in there it looks like:

startMediaLoadingSpinner()

@1hitsong
Copy link
Member

Music Artists

Quick Play on Artist with no albums, only an Appears On credit, does not play anything. I expected it would play their appears on song.

Music Album

Quick Play on Album from the Appears On section does not play anything. I expected it would play the album.

@cewert
Copy link
Member Author

cewert commented Sep 17, 2023

@sevenrats added the spinner. Thanks for pointing out those functions 👍

@sevenrats
Copy link
Member

fair warning that progressDialog's such as this one block the back button. in 99.9% of cases this is no big deal, and in the rest of cases, its a small deal, but, it is in line to get fixed.

@cewert
Copy link
Member Author

cewert commented Sep 17, 2023

fair warning that progressDialog's such as this one block the back button. in 99.9% of cases this is no big deal, and in the rest of cases, its a small deal, but, it is in line to get fixed.

I didn't notice that but that sounds perfect to me. We have no way of cancelling the quick play functions once they start and some are pretty long so disabling the back button makes a lot of sense to me.

May want to add a function parameter to allow the dev to control the back button behavior sub startMediaLoadingSpinner(enableBackButton = false as boolean)

@cewert
Copy link
Member Author

cewert commented Sep 19, 2023

Changes

  • Add support for "Appears on" row when viewing music artist
  • Fix music logic so that all songs are played when quick playing an artist or music library
    • Number of songs in playlist now matches the number of songs listed in the "Artist (Presentation)" view
  • Optimize api quieries
    • To shuffle play all 1366 of the songs in my music library now takes ~3.8 seconds
  • Add "collectionFolder" support
    • Supports movies, tvshows, boxsets, and music collection types
      • movies: shuffle play all movies found in collection
      • tvshows: shuffle play all watched episodes in collection
      • boxsets: pick a random boxset inside and play all the items inside
      • music: shuffle play all audio files in collection
    • Works from the "My Media" and favorite rows on the home page and also the main grid view
  • Add "UserView "support
    • Supports playlists collection type
    • Picks a random playlist inside and shuffle plays it
    • Works from the "My Media" and favorite rows on the home page and also the main grid view
  • Move quick play logic out of main and into it's own file under a namespace of quickplay

Besides pictures, which aren't ready for the global queue yet, I think this is everything.

@1hitsong the two things you mentioned should be fixed

@1hitsong
Copy link
Member

1hitsong commented Sep 23, 2023

Home / My Media

Function Test Result Details
Movies ✔️
TV Show ✔️
Music ✔️
Collections ✔️
Live TV ✔️
Music Videos ✔️
Playlists ✔️
Recordings ✔️

Home / Continue Watching

Function Test Result Details
Movie ✔️
TV Show ✔️

Home / Next Up

Function Test Result Details
TV Show ✔️

Home / Favorites

Function Test Result Details
TV Season ✔️
TV Episode ✔️
Movie ✔️
TV Channel ✔️

Home / Latest in Movies

Function Test Result Details
Movie ✔️

Home / Latest in TV Shows

Function Test Result Details
TV Show ✔️

Home / Latest in Music

Function Test Result Details
Album ✔️

Home / On Now

Function Test Result Details
TV Program ✔️

Home / Latest in Music Videos

Function Test Result Details
Music Video ✔️

@1hitsong
Copy link
Member

1hitsong commented Sep 23, 2023

Movie Library

Function Test Result Details
Movies (Presentation) ✔️
Movies (Grid) ✔️
Studio ✔️
Genre / 6 selected movies ✔️
Genre / Collection image ✔️
Genre / Genre View ✔️
Multi Part movie section on detail page Untested. I don't have any to test with

@cewert
Copy link
Member Author

cewert commented Sep 23, 2023

Good call on limiting the music.. Thank you for breaking it lol. I'm thinking about testing with my 1300 files again and using one of the roku tools to measure ram usage. looks like the lowest ram for the devices we support is 512MB. I think it'd be best to base it on that instead of a random number. PCs have to share the CPU with other tasks but the roku will only be playing music so might as well fill up the ram with songs IMO. I also have the songs sorted by album before they get randomized so if if you turn off shuffle it lets you find more songs from the same album. At least it did for me because it loaded my whole library 😄 so that's another benefit of having as big of a playlist as possible.

I don't have TV setup but I'll try to find a free stream to test with. I should be able to find a music video to test with

Action list

  • Limit music library songs
  • live tv
  • recording
  • music video

@1hitsong
Copy link
Member

1hitsong commented Sep 23, 2023

Music Library

Function Test Result Details
Artists (Presentation) ✔️
Artists (Grid) ✔️
Album Artists (Presentation) ✔️
Album Artists (Grid) ✔️
Albums ✔️
Genres ✔️
Genres / Selected Genre / Album ✔️
Artists - With Albums ✔️
Artists - With only appears on ✔️
Artists - With only 1 song ✔️
1st click after changing the view setting ✔️

@cewert
Copy link
Member Author

cewert commented Sep 23, 2023

All of the red X's should be fixed with the exception of 1st click after changing the view setting because I wasn't able to reproduce. Also added support for playing studios when viewing movie library

Edit: kept adding things so here's a list of all the changes

Changes

  • Limit playlist size based on memory. This should hopefully fix your music library quick play crash
  • Add MusicVideo support
    • Image, title, and year show up on home page "latest in"
    • Selecting one loads the video in the movie details view
    • Quick play supported from My Media row and Latest In
  • Studio and genre support added when viewing movie libraries
  • Studio and genre support added when viewing tv show libraries
  • Genre support added when viewing music libraries
  • Stop shuffling playlist when playing one item

NOTE: I was unable to reproduce the bug you found in music library view where the 1st click after changing the view setting doesn't work

@cewert cewert changed the title Improve Quick Play support Improve Quick Play support + Add support for Music Videos Sep 23, 2023
@1hitsong
Copy link
Member

1hitsong commented Sep 23, 2023

Collections Library

Function Test Result Details
Collection ✔️

Music Video Library

Function Test Result Details
Music Video ✔️

Playlists Library

Function Test Result Details
1 movie ✔️
4 movies ✔️
1 album ✔️
2 albums ✔️
1 song ✔️
5 songs ✔️
1 TV episode ✔️
2 TV episodes ✔️
Mixed media ✔️

TV Shows Library

Function Test Result Details
Shows View / TV Series ✔️
Network View / Network ✔️
Network View / Selected Network / TV Series ✔️
Genre / 6 selected Series ✔️
Genre / Collection image ✔️
Genre / Genre View ✔️

TV Show Details

Function Test Result Details
Cast & Crew ✔️
More Like This ✔️

@cewert
Copy link
Member Author

cewert commented Sep 24, 2023

Changes

  • Fix regression on episode list view where quickplay was double firing and showing an error
  • Remove memory checker
  • Limit all queries to 2000 items
  • Add quickplay support for type "Person"
    • Shuffle play all Videos, Movies, and watched Episodes found
    • Works from movie details and series details views
  • Add quickiplay support for type "tvchannel"
    • Works from favorites on home page, livetv library channel view and livetv guide view
  • Add quickplay support for "livetv" libraries on the My Media row
    • Select a random channel and watch it live

I'm not able to reproduce the TV library network bug or the movie library collection image bug you found.

I don't have access to guide data so I don't think I'll be able to add support for type "programs" or "recordings".

@sevenrats
Copy link
Member

does this code tolerate incomplete metadata? we usually run into bugs related to that when we change this code. I will try to test tomorrow.

@cewert
Copy link
Member Author

cewert commented Sep 24, 2023

does this code tolerate incomplete metadata? we usually run into bugs related to that when we change this code. I will try to test tomorrow.

I don't understand your concern since we've tested this like crazy but as long as the itemNode that gets passed to main has a type and an id it will probably work.

@sevenrats
Copy link
Member

sevenrats commented Sep 24, 2023

I don't understand your concern since we've tested this like crazy but as long as the itemNode that gets passed to main has a type and an id it will probably work.

what i will am afraid of and what i will do tomorrow is:
create a strm file that points to any video online. scan it in but don't play it yet. browse to it as if i were going to play it on the roku using these changes. if it is a problem it will amount to some isvalid checks somewhere

@cewert
Copy link
Member Author

cewert commented Sep 24, 2023

Ahh yea I didn't test with a strm file. Thanks for testing 👍

@cewert cewert mentioned this pull request Oct 3, 2023
@1hitsong
Copy link
Member

Testing tables updated.

The two issues I mentioned are also still happening. Since you weren't able to reproduce them, I'll give it a quick look.

source/utils/quickplay.bs Show resolved Hide resolved
@cewert cewert merged commit dd3972c into jellyfin:unstable Oct 28, 2023
9 checks passed
@cewert cewert deleted the fix-quickplay branch October 28, 2023 21:25
@cewert cewert added the feature A new feature that currently doesn't exist. label Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature that currently doesn't exist.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Shuffle An Entire Library Expand "Quick Play" "Quick play" doesn't work on movie library
3 participants