sahara101 / Movie-Roulette

Python App which chooses a random movie from your movie library.
MIT License
79 stars 1 forks source link

Doesn't load on large libraries. #3

Closed jbeck22 closed 2 weeks ago

jbeck22 commented 2 weeks ago

Doesn't seem to like large libraries. I have a test library of 1 movie and it works fine. When I moved on to my main library it doesn't load at all...

movie-roulette2 | ERROR:utils.cache_manager:Error updating cache: 'Stream' movie-roulette2 | INFO:movie_selector:Cache file does not exist. movie-roulette2 | INFO:movie_selector:Loaded 0 movies from cache. movie-roulette2 | INFO:movie_selector:Loaded 0 movies from cache. movie-roulette2 | INFO:movie_selector:Loaded 0 movies from cache. movie-roulette2 | INFO:movie_selector:Loaded 0 movies from cache.

sahara101 commented 2 weeks ago

It can take some time to build the cache on large libraries. You should see a progress bar, does it not start loading?

jbeck22 commented 2 weeks ago

I see the progress bar, but it does not move or fill and just disappears altogether.

jbeck22 commented 2 weeks ago

image

jbeck22 commented 2 weeks ago

I also confirmed that the json file isn't being created in the configured /config folder. The current_movie.json file is created if something in my library is playing. Also -- :4000/poster works as planned.

sahara101 commented 2 weeks ago

How big is the library?

sahara101 commented 2 weeks ago

Paste the contents of /debug_plex please

jbeck22 commented 2 weeks ago

{ "cache_file_exists": false, "cached_movies": 0, "loaded_from_cache": false, "movies_library_name": null, "plex_url": "http://192.168.1.238:32400", "total_unwatched_movies": 718 }

jbeck22 commented 2 weeks ago

Paste the contents of /debug_plex please

2,481 movies

sahara101 commented 2 weeks ago

Maybe a bug from this "movies_library_name": null,

I’ll check it out.

jbeck22 commented 2 weeks ago

here is the compose file in case it helps:

services: movie-roulette: image: ghcr.io/sahara101/movie-roulette:latest container_name: movie-roulette pull_policy: always environment:

Homepage ENV

  HOMEPAGE_MODE: "FALSE"
  #Plex ENV
  PLEX_URL: http://192.168.1.238:32400
  PLEX_TOKEN: xxxxxxxxx
  PLEX_MOVIE_LIBRARIES: Movies
    #Default movies, add more with comma delimiter A,B,C
    #Poster ENV
  TZ: America/New_York
  DEFAULT_POSTER_TEXT: My Cool Cinema
  PLEX_POSTER_USERS: xxxxxxx #Plex username, add more with comma delimiter A,B,C
  PUID: 1000
  PGID: 1000
  #      JELLYFIN_POSTER_USERS: "" #Jellyfin username, add more with comma delimiter A,B,C
  #Jellyfin ENV
  #      JELLYFIN_URL: " "
  #      JELLYFIN_API_KEY: " "
  #      JELLYFIN_USER_ID: " "
  #Client ENV
  APPLE_TV_ID: xxxxxxxxxxx
#      LGTV_IP: " "
#      LGTV_MAC: " "
network_mode: host
volumes:
  - /mnt/user/appdata/movie-roulette/data:/app/data
restart: unless-stopped

networks: {}

sahara101 commented 2 weeks ago

Can you try the :dev image? You should now also see debug logs for the cache.

jbeck22 commented 2 weeks ago

pulled the dev image, deleted my docker image and container -- started from scratch.

{ "cache_file_exists": false, "cached_movies": 0, "loaded_from_cache": false, "movies_library_name": "Movies", "plex_url": "http://192.168.1.238:32400", "total_unwatched_movies": 723 }

Can I pull the logs from somewhere....don't want to just copy and paste here if possible.

sahara101 commented 2 weeks ago

Do you see the cache loading in the docker log? You can paste it on pastebin for example.

Inspect on the web page could also show some info.

jbeck22 commented 2 weeks ago

Here are the logs: https://pastebin.com/J3vjrM7Y

jbeck22 commented 2 weeks ago

Here is the webpage inspection:

https://pastebin.com/UMcNLqBy

sahara101 commented 2 weeks ago

Seems some movie does not have the stream key which makes the cache exit. I am checking it now

sahara101 commented 2 weeks ago

PLease test :dev again, also in an incognito tab. You should also see in the logs if a movie is missing some keys, upload the log again if it still does not work. Sorry I cannot test myself as I do not have such a big library

jbeck22 commented 2 weeks ago

seems to be better now. Now I get a bunch of unwatched movies that I can cycle through.

New problem is that the filter button isn't loading any of the genres or years. PG Rating seems to be working ok.

sahara101 commented 2 weeks ago

Yes, seems some new issues because of the latest change. I will work on it tonight.

sahara101 commented 2 weeks ago

genres and years work fine for me though, can you paste the new logs please?

jbeck22 commented 2 weeks ago

I restarted the container and now it all seems to be working. good job crushing those bugs! I have an idea for an enhancement -- do you want it as a separate item or included inline here?

sahara101 commented 2 weeks ago

Glad to hear! Separate item please. Tell me, don’t you have the progress loading bar appearing more times than the first one? I will fix that (came with latest change) but it is weird if you don’t see it 😁

jbeck22 commented 2 weeks ago

the progress bar was all over the place -- would jump to 50% and then back down to around 10-15% and then back up to 50%. Up, down, up, down -- like that. until it was done.

sahara101 commented 2 weeks ago

The sporadic loading (cause of the cache refresh is solved in the next image)