UniversalMediaServer / UniversalMediaServer

A DLNA, UPnP and HTTP(S) Media Server.

Home Page:https://www.universalmediaserver.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fully played media bug

Fredo1650 opened this issue · comments

Hello, I notice a bug on the display of fully playing media.
On UMS the media is marked fully played in the logs,
but in some cases it is not displayed on the screen:
Video 6 start at 15:53:14, END 16:56:11 (Marked as fully played)
Video 7 start at 16:56:07, END 17:50:20 (Marked as fully played)
Video 8 unread but marked after 5 seconds of playback
I also noticed that when I navigate to the videos folder without pressing play, UMS marks the video currently playing on the web page even though it is not starting and then marks the media as fully playing (Video 8)
I think the TV or UMS cannot access the marked media file correctly.
ums_dbg_2024-04-17-17-51.zip
Capture d’écran 2024-04-17 175305
20240417_175516

@Fredo1650 ah yes I had the same bug as Video 8 on my LG TV and I made a change for that, I will see if that is possible for yours too

This doesn't look right:

TRACE 2024-04-17 17:50:16.188 [StopPlaying Event] net.pms.dlna.MediaMonitor Fully Played feature logging:
TRACE 2024-04-17 17:50:16.188 [StopPlaying Event] net.pms.dlna.MediaMonitor    duration: 4659.488
TRACE 2024-04-17 17:50:16.188 [StopPlaying Event] net.pms.dlna.MediaMonitor    getLastStartPosition: 0.0171607293672144
TRACE 2024-04-17 17:50:16.188 [StopPlaying Event] net.pms.dlna.MediaMonitor    getStartTime: 1713369011440
TRACE 2024-04-17 17:50:16.188 [StopPlaying Event] net.pms.dlna.MediaMonitor    getLastStartSystemTimeUser: 0.0
TRACE 2024-04-17 17:50:16.188 [StopPlaying Event] net.pms.dlna.MediaMonitor    elapsed: 1.7133690162051606E9
TRACE 2024-04-17 17:50:16.188 [StopPlaying Event] net.pms.dlna.MediaMonitor    minimum play time needed: 4286.72896
TRACE 2024-04-17 17:50:16.188 [StopPlaying Event] net.pms.dlna.MediaMonitor final decision: fully played

I have made a build with more logging, can you please reproduce the bug with this one? https://www.universalmediaserver.com/uploads/UMS-Fredo.exe

I did a test with this version, I specify that no video was played, I simply navigated in the folders by hovering over the videos as in the photos, but in the logs there is a START and STOP and marked as fully played a few seconds later
2nd bug the videos that UMS has marked are not all displayed on the television as marked (img 2 or on my 1st post), on the web player it is displayed correctly (img 3)
ums_dbg_2024-04-20-02-35.zip
img 1
img 2
img 3

commented

Does that TV animate the thumbnails when you hover over them? This could be triggering the fully played status.

My parent's LG tv did this when I was trying to setup a conf for it over a year ago, when every video I was using for testing needed transcoding it would do it for each thumbnail and my laptop was not up to the job so it just failed to work,.

No, the television does not animate the thumbnails, they are fixed, and the other bug it doesn't mark the thumbnails fully played on the TV whereas on the UMS web player the thumbnails are well marked, but sometimes the TV marks them like on the 1st post but not on all of them

I notice that the TV and UMS (WEB Player) have exactly the same thumbnails, but when UMS marks the thumbnails fully played it does not update them on the TV Example video E03 framed in red on the attached images.
I quit then restarted UMS, turned off the TV completely, unplugged the electrical outlet to be sure to unload the TV's memory but it's still the same
Can UMS force thumbnails to be refreshed when they are fully played ?
Capture d’écran 2024-04-22 010207
20240422_010136

From your logs:

TRACE 2024-04-20 02:32:48.322 [StopPlaying Event] net.pms.dlna.MediaMonitor Fully Played feature logging:
TRACE 2024-04-20 02:32:48.322 [StopPlaying Event] net.pms.dlna.MediaMonitor    duration: 4625.312
TRACE 2024-04-20 02:32:48.322 [StopPlaying Event] net.pms.dlna.MediaMonitor    getLastStartPosition: 0.008390577185684605
TRACE 2024-04-20 02:32:48.322 [StopPlaying Event] net.pms.dlna.MediaMonitor    getStartTime: 1713573163709
TRACE 2024-04-20 02:32:48.323 [StopPlaying Event] net.pms.dlna.MediaMonitor    getLastStartSystemTimeUser: 0.0
TRACE 2024-04-20 02:32:48.323 [StopPlaying Event] net.pms.dlna.MediaMonitor    elapsed: 1.7135731683303907E9
TRACE 2024-04-20 02:32:48.323 [StopPlaying Event] net.pms.dlna.MediaMonitor    minimum play time needed: 4255.28704
TRACE 2024-04-20 02:32:48.323 [StopPlaying Event] net.pms.dlna.MediaMonitor final decision: fully played
TRACE 2024-04-20 02:32:48.323 [StopPlaying Event] net.pms.dlna.MediaMonitor because elapsed > configuration.getMinimumWatchedPlayTimeSeconds()
TRACE 2024-04-20 02:32:48.323 [StopPlaying Event] net.pms.dlna.MediaMonitor because elapsed >= (fileDuration * configuration.getResumeBackFactor())

This is really bizarre, that apparently Java thinks 1.7135731683303907E9 is greater than 30... When I looked it up online I saw that integers and doubles in Java are supposed to be comparable but maybe there is a bug there. I will try to have an idea about it but it seems like such a fundamental thing.

Edit: It can't be a double/int thing because the last calculation is completely doubles

@UniversalMediaServer/developers does anyone have an idea about this? I hope I'm missing something really obvious here. I have a logging branch set up at #4601

@UniversalMediaServer/developers does anyone have an idea about this? I hope I'm missing something really obvious here. I have a logging branch set up at #4601

@SubJunk
I don't see where the 30 comes from, but the obvious thing would be : 1.7135731683303907E9 is bigger than 30, because 1.7 times ten to the power of nine is over a million ... ?

Ah that makes sense, ok so that number is being created wrong. I have made a new build @Fredo1650 to add more logging, please reproduce it again and it should show why that number is silly https://www.universalmediaserver.com/uploads/UMS-Fredo3.exe

I did a test with this new version I reproduced the bug, I just stayed in the videos folder on the thumbnails (fixed) by simply hovering over them without starting the video, UMS marks fully played.
On this new test I still have the difference on the thumbnails marked entirely played between the display of the television and that of the UMS WEB player
ums_dbg_2024-04-23-02-25.zip
Capture d’écran 2024-04-23 022521
Capture d’écran 2024-04-23 021921
20240423_021819
Capture d’écran 2024-04-23 022447
20240423_022436

@Fredo1650 thanks for that, I hope this build will fix it, please test https://www.universalmediaserver.com/uploads/UMS-Fredo4.exe

Thank you very much for your help, with this version it works better the media is no longer marked fully play in UMS when I hover over the thumbnails in the folder
ums_dbg_2024-04-23-23-46.zip
Capture d’écran 2024-04-23 234639

I still have this TV/UMS synchronization problem on the thumbnail marked fully playing, I think there is a bug in the UMS database, because by moving the files and restarting UMS several times, the thumbnails which was not marked before on the television are now marked fully play after this manipulation.
On the WEB player it works correctly.

I have that problem on my TV too but I think it is a matter of the TV not refreshing when it should. I have done debugging myself and it is just not requesting an update for the folder. There is possibly something we can do to improve that, I don't know. Can you make a new issue for that one so we can close this to keep things focused?

commented

Maybe #2664 is related to this?

Yeah good spotting, it probably is the same thing. I'm looking into it now