Jump to content

Playback Reporting


TeamB

Recommended Posts

Q-Droid

What I see is a lot of Roku clients in those lists...

 

  • Haha 1
Link to comment
Share on other sites

TeamB
39 minutes ago, Q-Droid said:

What I see is a lot of Roku clients in those lists...

 

yeah but I have seen it on Windows Kodi Clients, Web Clients and Raspberry Pi Libreelec Clients so it is not just one type of client.

like I said, I have tried to reproduce this in so many different ways, but can not.

Link to comment
Share on other sites

vaise
45 minutes ago, TeamB said:

it is very weird, the plugin just monitors the sessions and saved play state like start and stop times when a Playback Session is running, for the times to be so long the session needs to exist for that time, i.e. the playback session is stuck, I have heard of this happening but never been able to reproduce the issue in Emby, I have tried everything from terminating emby clients (killing them in Task Manager etc) to fast pause/play/leaving them in a paused state for hours and hours but the Playback session in the Emby dashboard always shows the correct state for me and thus the Playback reporting the correct times.

I have a few of these weird entries in my system also, I have absolutely no idea how they got there, one movie play session run for 6 hours in my system, that is not true and I dont know why the Emby Session did this.

Yeah you can update the times to say 1 hour to keep item play event in the system.

I have the select statement here - how to I change that to an update the records to 10800 (3 hours) - I cant get the sql syntax right :

SELECT PlayDuration
FROM PlaybackActivity
WHERE PlayDuration > 10800
ORDER BY PlayDuration DESC

I will start with setting to 3 hours, then may drop it to 2 hours, cos there are load of 30m episodes in there and most movies are under 2 hours.  May even later change to 1.5 hours.

Link to comment
Share on other sites

TeamB
3 minutes ago, vaise said:

I have the select statement here - how to I change that to an update the records to 10800 (3 hours) - I cant get the sql syntax right :

SELECT PlayDuration
FROM PlaybackActivity
WHERE PlayDuration > 10800
ORDER BY PlayDuration DESC

I will start with setting to 3 hours, then may drop it to 2 hours, cos there are load of 30m episodes in there and most movies are under 2 hours.  May even later change to 1.5 hours.

MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!

you need to use an SQL update command

MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!

UPDATE PlayDuration SET PlayDuration = <the new value>, PauseDuration = 0 WHERE PlayDuration - PauseDuration > <the limit you want to set>

i.e. cap all to 3 hours

MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!

UPDATE PlayDuration SET PlayDuration = (60 * 60 * 3), PauseDuration = 0 WHERE PlayDuration - PauseDuration > (60 * 60 * 3)

MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!

Just in case you missed it

MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!

 

Link to comment
Share on other sites

vaise
33 minutes ago, TeamB said:

MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!

you need to use an SQL update command

MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!

UPDATE PlayDuration SET PlayDuration = <the new value>, PauseDuration = 0 WHERE PlayDuration - PauseDuration > <the limit you want to set>

i.e. cap all to 3 hours

MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!

UPDATE PlayDuration SET PlayDuration = (60 * 60 * 3), PauseDuration = 0 WHERE PlayDuration - PauseDuration > (60 * 60 * 3)

MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!

Just in case you missed it

MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!MAKE SURE YOU DO A BACKUP OF YOUR PLAYBACK REPORTING DATA FIRST!

 

I think that is missing the actual database there ?  playbackactivity ?

 

UPDATE PlaybackActivity 
SET PlayDuration = (60 * 60 * 3), PauseDuration = 0 
WHERE PlayDuration - PauseDuration > (60 * 60 * 3)

 

 

Edited by vaise
  • Agree 2
Link to comment
Share on other sites

vaise

Summary of activities - I ran the above for 2 hours -

UPDATE PlaybackActivity 
SET PlayDuration = (60 * 60 * 2), PauseDuration = 0 
WHERE PlayDuration - PauseDuration > (60 * 60 * 2)

And then re-ran the outliers sql 

SELECT *, PlayDuration - PauseDuration AS PlayTime
FROM PlaybackActivity
ORDER BY PlayTime DESC
LIMIT 10

And they are all now set to 7200 as expected :

image.thumb.png.76a826300b79d361154c1503329c37c7.png

So - I then ran this script I always use to calculate the total minutes (you gave me this a while back) :

SELECT UserId, SUM(PlayDuration - PauseDuration) AS PlayTime
FROM PlaybackActivity
WHERE DateCreated >= '2023-03-24' AND DateCreated < '2024-03-24'
GROUP BY UserId
ORDER BY PlayTime DESC

But - strangely, the seconds has not changed - its still high and the same as when I started.  What have I got wrong here ? :

image.png.ae8bdfd3e3280911c02c1ef9d29bfb77.png

 

 

Link to comment
Share on other sites

TeamB

not sure, try and find one of the updated items in the Plugin Report pages and see if it is correctly set to 2 hours

Link to comment
Share on other sites

vaise
10 minutes ago, TeamB said:

not sure, try and find one of the updated items in the Plugin Report pages and see if it is correctly set to 2 hours

While I could not find any specific to 2 hours exactly, I was Scrolling through the summary tab, and I can see these which should not by rights be there after that sql update - as 2 hours should be the maximum ? :

image.png.13f30b466f9e7b43e3f270928c196ada.png

image.png.e3412d75ea2b7444f4418d37a0f9d726.png

image.png.67b1c633f8f9b50d24fccf5ebadbc7ee.png

image.png.ffae11a8a85552e79b8178461b90f16e.png

image.png.4acd41022d10abbbadcdec25bffea24c.png

image.png.6449a75078c33f891a27392fc37e6cac.png

 

 

 

Link to comment
Share on other sites

TeamB
4 minutes ago, vaise said:

While I could not find any specific to 2 hours exactly, I was Scrolling through the summary tab, and I can see these which should not by rights be there after that sql update - as 2 hours should be the maximum ? :

image.png.13f30b466f9e7b43e3f270928c196ada.png

image.png.e3412d75ea2b7444f4418d37a0f9d726.png

image.png.67b1c633f8f9b50d24fccf5ebadbc7ee.png

image.png.ffae11a8a85552e79b8178461b90f16e.png

image.png.4acd41022d10abbbadcdec25bffea24c.png

image.png.6449a75078c33f891a27392fc37e6cac.png

 

 

 

if you run the update query again does tell you how many items were updated?

Link to comment
Share on other sites

vaise

Its as if the app and the selects are reading a cache of what it looked like before the manual updates.......

Link to comment
Share on other sites

TeamB
Posted (edited)
33 minutes ago, vaise said:

Its as if the app and the selects are reading a cache of what it looked like before the manual updates.......

it should auto commit.

try this command in the SQL Query tab

COMMIT

Or try restarting the server.

Edited by TeamB
Link to comment
Share on other sites

vaise
1 minute ago, TeamB said:

it should auto commit.

Try restarting the server.

Thats next on my list.  
just a number of friends/family watching stuff currently.  Will get to it and report back.

Link to comment
Share on other sites

vaise

restarted emby - still seeing the records in the summary.

Is this is any way related to database changes in the past ?

When I first ported from beta to prod a month ago, I posted that the playback reporting restore was only bringing in a small subset of the data - I have to copy the database over.

Happytoplay posted a soution to that in that thread....

Link to comment
Share on other sites

TeamB

the weird thing is if you run this

UPDATE PlaybackActivity 
SET PlayDuration = (60 * 60 * 2), PauseDuration = 0 
WHERE PlayDuration - PauseDuration > (60 * 60 * 2)

and then run this

SELECT *, PlayDuration - PauseDuration AS PlayTime
FROM PlaybackActivity
WHERE PlayTime > (60 * 60 * 2)
ORDER BY PlayTime DESC
LIMIT 10

Do you get ZERO results? (you should)

Link to comment
Share on other sites

vaise

Yep - zero results.

image.png.0523c5dac02d373cd45fffee509b6848.png

Its crazy!

 

Its like the app is reading a different database :

 

image.thumb.png.c4b8c1554b4c9df29dd0d074a5e42862.png

Edited by vaise
Link to comment
Share on other sites

vaise

While doing various sql's, I am also seeing loads of 0 seconds.

Link to comment
Share on other sites

vaise

Im getting somewhere - what different about this statement ?

SELECT ROWID, * 
FROM PlaybackActivity 
ORDER BY PlayDuration DESC
LIMIT 50

Because it is finding other records with playduration high - probably the missing links!!!!!!

image.png.37280823ee622636f10f6fbb8c593243.png

 

Edited by vaise
Link to comment
Share on other sites

vaise

Found the issue - checkout these PauseDurations - 

image.png.056f0645bd8fb500e1becda61311d835.png

 

Edited by vaise
Link to comment
Share on other sites

vaise

In summary on all this, the commands abouve were bad due to some sort of corruption values in the pauseduration - which was the same or similar to the playduration - so they were not being picked up.  Cammands therefore used to rectify - with setting anything longer that 2 hours to 2 hours, and a pause duration higher than 5 minutes to 0 pause duration. :

SELECT ROWID, * 
FROM PlaybackActivity 
WHERE PlayDuration > 7200 AND PauseDuration > 300
ORDER BY PlayDuration DESC
LIMIT 50

UPDATE PlaybackActivity 
SET PlayDuration = (60 * 60 * 2), PauseDuration = 0 
WHERE PlayDuration > 7200 AND PauseDuration > 300

This has now left only 11 records, just over 2 hours with pause duration in the 200 seconds ish.

So..... you would think that was good - but no - the original issue is still there - as I guess most of this fix up stuff was for dates older than 1 year - and my sql SUM of the seconds is still massive for one year :

SELECT UserId, SUM(PlayDuration - PauseDuration) AS PlayTime
FROM PlaybackActivity
WHERE DateCreated >= '2023-03-24' AND DateCreated < '2024-03-24'
GROUP BY UserId
ORDER BY PlayTime DESC

produces :

image.png.3ef16659136c6907ed5c6f100dff1778.png

 

WHICH IS SURELY TOO MANY SECONDS OF PLAYBACK FOR NORMAL USE.

 

 

 

Edited by vaise
Link to comment
Share on other sites

TeamB

but those pause and playback durations should cancel each other out.

yeah 86 Days is a lot.

if you find a pattern, let me know.

 

Link to comment
Share on other sites

Q-Droid
11 hours ago, TeamB said:

yeah but I have seen it on Windows Kodi Clients, Web Clients and Raspberry Pi Libreelec Clients so it is not just one type of client.

like I said, I have tried to reproduce this in so many different ways, but can not.

What I mean is Roku are notorious for orphan/stray sessions in Emby. Is it possible that even when users properly exit that Emby still doesn't close everything out? Perhaps the devs used a "special" workaround for Roku that doesn't completely remove the session though it does end the streams.

Sure, this doesn't account for the others.

 

 

Edited by Q-Droid
  • Agree 1
Link to comment
Share on other sites

vaise

I just wanted to create a Top 10 user list.  Not sure if I can trust the seconds watched.  Then I figured I could do it by number of plays….. but there are shed loads of ‘plays’ of 0 seconds (but the setting in the app is set to register not if more than 180 seconds minimum is used).  

Maybe I should delete those ?  Or all plays less that 180 seconds…..

Link to comment
Share on other sites

Happy2Play
3 hours ago, vaise said:

I just wanted to create a Top 10 user list.  Not sure if I can trust the seconds watched.  Then I figured I could do it by number of plays….. but there are shed loads of ‘plays’ of 0 seconds (but the setting in the app is set to register not if more than 180 seconds minimum is used).  

Maybe I should delete those ?  Or all plays less that 180 seconds…..

I will guess all before this option was added.  Or are they still recorded and just ignored for stats?

Ignore play sessions less than x seconds in duration

 

Link to comment
Share on other sites

Sorry for the issues. I suspect those huge pause times with huge durations are when people turn off their TV but leave their Roku happily playing with the TV off. Try it yourself. Play something on your Roku. Now turn off your TV connected to that Roku. Do you see what happens on the dashboard activity? When you turn the TV back on is the Roku still playing the item or is it paused? If it isn't paused wait longer to turn the TV back on. Then check to see if when you turn it on after waiting longer is it paused and still running the Emby app?

We have had changes in the Roku Emby Beta app to prevent this from happening and it will stop these things but they are not pushed to the store version yet. These changes will eventually make it to the Store release version. Once they do you should be able to trust your playback reports when the Roku is concerned.

 

Edited by speechles
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...