JurajNyiri / PlexMeetsHomeAssistant

Custom card which integrates plex into Home Assistant and makes it possible to launch movies or tv shows on TV with a simple click
Apache License 2.0
111 stars 8 forks source link

Bug: Card freezes when clicking on movie (Desktop) #68

Closed NachtaktiverHalbaffe closed 2 years ago

NachtaktiverHalbaffe commented 2 years ago

Describe the bug On desktop when I click on a movie on the plex card, it wont play the animation and the whole web ui of HA freezes until a complete page refresh. Only happens on Fullscreen desktop (exception: shrinked the windowsize down to a phone-like aspect ratio). On mobile and everything else it works fine. The console is throwing some violation warnings (see screenshot below).

This also appears when opening the editor for the card, this time across all plattforms. In this case, it does take a long time to load, but wont freeze completly.

To Reproduce Steps to reproduce the behavior:

  1. Open tab with the plex card inside
  2. Click on any movie

Expected behavior Open the movie with an smooth transition, No freeze ups

Screenshots My freezed up screen. Wanted to open the top left movie 1 Console logs 2

Checks Please check below if true:

[x] I am running Home Assistant on HTTP protocol [ ] I am running BOTH Home Assistant AND Plex on HTTPS protocol [x] My Plex server is accessible through protocol, port and ip/hostname I have specified for the card. [ ] My Plex server is running on HTTPS and has a valid certificate.

Card Configuration

type: custom:plex-meets-homeassistant
token: XXXXXXXXXX
ip: 192.168.XXX.XX
port: 'XXXXXXXXXXX'
libraryName: Filme
protocol: http
maxCount: '24'
sort: audienceRating:desc
playTrailer: true
showExtras: true
showSearch: true
runBefore: script.plex_schauen
entity:
  - plexPlayer | LG 49UJ635V-ZF | 192.168.XXX.XX | XXXXXXXXXXXX
  - cast | media_player.XXXX
title: Filme
maxRows: ''
useHorizontalScroll: 'No'
displayTitleMain: 'Yes'
displaySubtitleMain: 'Yes'
minWidth: ''
minEpisodeWidth: ''
minExpandedWidth: ''
fontSize1: ''
fontSize2: ''
fontSize3: ''
fontSize4: ''
minExpandedHeight: ''
displayType: ''
useShuffle: 'No'

Card Version 3.4.1

Plex Version 1.24.5.5173 (Via offical Truenas Core Plex plugin)

Additional context

JurajNyiri commented 2 years ago
NachtaktiverHalbaffe commented 2 years ago
- Is there any error when movie clicked?
- Is there a network request sent and received when clicked?

=> No error found in HA & Supervisor logs except the console logs of my browser which I attached as an screenshot in my initial post (the violation warnings from the logs belongs to the plex card). When I click the movie, the network request for the Infos for that particular movie is not send. As mentioned, on mobile or shrinked down window size everything works as exspected including network requests.

- Is the page responsive otherwise, can you click other elements, select text etc?

=>No. maybe after a 30 seconds to a minute the frontend it is doing a little bit, but full responsiveness comes only back after a complete page refresh

- Does this happen with every movie?
- Does this happen with TV Shows or Music?

=>Yes. I don't have music in my libraries, but i think this will appear too on music when this happens on movies and tv-shows.

Edit: Last version which I know this hasnt appeared is the last version before v3.3 release. During v3.3 I didn't used this card, so I downgraded it via Hacs to 3.3 again and this problem occurs. So in my case this problem was introduced with release v3.3. Don't know if this can help

JurajNyiri commented 2 years ago

It must be a combination of multiple things. I tried in fullscreen panel mode and it worked properly. Could you please try to eliminate as much other factors as possible? Try it in a panel mode on its own with vanilla lovelace. Try it in sidebar and add new cards one by one and see when it starts happening. Please also provide info about what browser you are using.

NachtaktiverHalbaffe commented 2 years ago

Created a whole new dashboard with only one tab in panel mode and it appears again. Also tested on another browser (edge). I shrinked down the cards options only to the necessary options. Disabled my theming. Nothing helped.

I'm using Brave Version 1.33.106 Chromium: 96.0.4664.110 (Official Build) (64-bit). Of course all shields, script/cookieblocking addons disabled of course on my HA instance. As mentioned, it happens also on Edge.

Edit: Changed the screen resolution of my screen (1680x1050) to classic HD. The bug disappeared. So the screen resolution could be a factor to the problem. Maybe some size calculation breaks or creates an exception on my unusual screen resolution/ aspect ratio?

JurajNyiri commented 2 years ago

I was able to replicate this in a bit different scenario. It might be now fixed in 3.6. Could you please check?

NachtaktiverHalbaffe commented 2 years ago

I shortly checked with 3.6.1 and everything seems to work fine again 👍 Thx for fixing

JurajNyiri commented 2 years ago

Yay!