Jump to content

Playback Reporting


TeamB

Recommended Posts

vaise
18 minutes ago, TeamB said:

how and where are you pulling this data from?

try the query tab to write a query to give you the data you need.

Yeah - I am not too technical there - I was literally copying the output from the app to excel as text, then trying to sort it there (the hours use is what I am after).

I was using the user report, then changing the date from 01/01/2023 till now, and pulling that back, then copy and past from the browser.

I am sure there are much better ways but the query option I have no idea wehere to start to get the same info.

Link to comment
Share on other sites

TeamB

in the query tab run the following query

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

make sure you check the box "Replace UserId with UserName" under the query box, PlayTime is seconds
 

  • Like 1
Link to comment
Share on other sites

vaise
1 hour ago, TeamB said:

in the query tab run the following query

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

make sure you check the box "Replace UserId with UserName" under the query box, PlayTime is seconds
 

Thanks heaps for that - I have saved it for next time.  Just change the dates and I am dandy.  nice 1!

Link to comment
Share on other sites

CJTripper

I noted the Playback Reporting plugin (v 2.1.0.1) seems to have some compatibility issues with the latest Emby Server beta (Windows Emby Server Beta 4.8.0.40). After the upgrade to 4.8.0.40 (and multiple reboots), the Activity Log on my Emby Dashboard screen no longer displayed playback events. I found some errors in my logs indicating Playback Reporting errors when a movie or show was played by a user. I deleted the playback_reporting.dll file from the plugins folder and restarted the server, my dashboard activity is correctly logging the playback events again.

Here is a snip of the event log error generated during a playback start:

2023-08-07 21:02:40.675 Error SessionManager: Error in event handler
    *** Error Report ***
    Version: 4.8.0.40
    Command line: C:\Users\User\AppData\Roaming\Emby-Server\system\EmbyServer.dll -noautorunwebapp
    Operating system: Microsoft Windows 10.0.22621
    Framework: .NET 6.0.20
    OS/Process: x64/x64
    Runtime: C:/Users/User/AppData/Roaming/Emby-Server/system/System.Private.CoreLib.dll
    Processor count: 20
    Data path: C:\Users\User\AppData\Roaming\Emby-Server\programdata
    Application path: C:\Users\User\AppData\Roaming\Emby-Server\system
    System.MissingMethodException: System.MissingMethodException: Method not found: 'Void SQLitePCL.pretty.IBindParameter.Bind(System.ReadOnlySpan`1<Char>)'.
       at playback_reporting.Data.SqliteExtensions.TryBind(IStatement statement, String name, String value)
       at playback_reporting.Data.ActivityRepository.<>c__DisplayClass18_0.<AddPlaybackAction>b__0(IDatabaseConnection db)
       at SQLitePCL.pretty.DatabaseConnection.<>c__DisplayClass18_0.<RunInTransaction>b__0(IDatabaseConnection db)
       at SQLitePCL.pretty.DatabaseConnection.RunInTransaction[T](IDatabaseConnection This, Func`2 f, TransactionMode mode)
       at SQLitePCL.pretty.DatabaseConnection.RunInTransaction(IDatabaseConnection This, Action`1 action, TransactionMode mode)
       at playback_reporting.Data.ActivityRepository.AddPlaybackAction(PlaybackInfo play_info)
       at playback_reporting.EventMonitorEntryPoint.ProcessSessions()
       at playback_reporting.EventMonitorEntryPoint._sessionManager_PlaybackStart(Object sender, PlaybackProgressEventArgs e)
       at MediaBrowser.Common.Events.EventHelper.<>c__DisplayClass1_0`1.<QueueEventIfNotNull>b__0()
    Source: playback_reporting
    TargetSite: Void TryBind(SQLitePCL.pretty.IStatement, System.String, System.String)

Link to comment
Share on other sites

Albertax
25 minutes ago, CJTripper said:

I noted the Playback Reporting plugin (v 2.1.0.1) seems to have some compatibility issues with the latest Emby Server beta (Windows Emby Server Beta 4.8.0.40). After the upgrade to 4.8.0.40 (and multiple reboots), the Activity Log on my Emby Dashboard screen no longer displayed playback events. I found some errors in my logs indicating Playback Reporting errors when a movie or show was played by a user. I deleted the playback_reporting.dll file from the plugins folder and restarted the server, my dashboard activity is correctly logging the playback events again.

Here is a snip of the event log error generated during a playback start:

2023-08-07 21:02:40.675 Error SessionManager: Error in event handler
    *** Error Report ***
    Version: 4.8.0.40
    Command line: C:\Users\User\AppData\Roaming\Emby-Server\system\EmbyServer.dll -noautorunwebapp
    Operating system: Microsoft Windows 10.0.22621
    Framework: .NET 6.0.20
    OS/Process: x64/x64
    Runtime: C:/Users/User/AppData/Roaming/Emby-Server/system/System.Private.CoreLib.dll
    Processor count: 20
    Data path: C:\Users\User\AppData\Roaming\Emby-Server\programdata
    Application path: C:\Users\User\AppData\Roaming\Emby-Server\system
    System.MissingMethodException: System.MissingMethodException: Method not found: 'Void SQLitePCL.pretty.IBindParameter.Bind(System.ReadOnlySpan`1<Char>)'.
       at playback_reporting.Data.SqliteExtensions.TryBind(IStatement statement, String name, String value)
       at playback_reporting.Data.ActivityRepository.<>c__DisplayClass18_0.<AddPlaybackAction>b__0(IDatabaseConnection db)
       at SQLitePCL.pretty.DatabaseConnection.<>c__DisplayClass18_0.<RunInTransaction>b__0(IDatabaseConnection db)
       at SQLitePCL.pretty.DatabaseConnection.RunInTransaction[T](IDatabaseConnection This, Func`2 f, TransactionMode mode)
       at SQLitePCL.pretty.DatabaseConnection.RunInTransaction(IDatabaseConnection This, Action`1 action, TransactionMode mode)
       at playback_reporting.Data.ActivityRepository.AddPlaybackAction(PlaybackInfo play_info)
       at playback_reporting.EventMonitorEntryPoint.ProcessSessions()
       at playback_reporting.EventMonitorEntryPoint._sessionManager_PlaybackStart(Object sender, PlaybackProgressEventArgs e)
       at MediaBrowser.Common.Events.EventHelper.<>c__DisplayClass1_0`1.<QueueEventIfNotNull>b__0()
    Source: playback_reporting
    TargetSite: Void TryBind(SQLitePCL.pretty.IStatement, System.String, System.String)

I had the same issues with 40, and ended up rolling back. 

Link to comment
Share on other sites

TeamB
1 hour ago, Luke said:

Resolved for next build. Thanks.

does this mean no changes need for the plugin?

Link to comment
Share on other sites

23 minutes ago, TeamB said:

does this mean no changes need for the plugin?

Correct.

Link to comment
Share on other sites

TeamB

I released a new version with an updated plugin sdk and a bunch of changes to the DB system anyway that would get it back up and running

  • Thanks 5
Link to comment
Share on other sites

CJTripper
On 8/9/2023 at 12:08 AM, TeamB said:

I released a new version with an updated plugin sdk and a bunch of changes to the DB system anyway that would get it back up and running

Thanks, I installed the updated Playback Reporting plugin v2.1.0.2, and it appears to have resolved the Dashboard Activity logging issues with Emby Server beta 4.8.0.40 (on Windows). @TeamB- I appreciate your quick work to resolve the issue!

Link to comment
Share on other sites

browneye253

I noticed someone else asking about a query to view content that hasn't been watched and that not being possible without joining with the main emby tables.  Is that something plugins don't have access to?  I like many others am losing access to a lot of storage and trying to find a way to cull out inactive content.  Thanks.

  • Agree 1
Link to comment
Share on other sites

TeamB
1 hour ago, browneye253 said:

I like many others am losing access to a lot of storage and trying to find a way to cull out inactive content.

how are you losing access to storage?

1 hour ago, browneye253 said:

I noticed someone else asking about a query to view content that hasn't been watched and that not being possible without joining with the main emby tables.  Is that something plugins don't have access to?

no, a plugin can not access the emby database tables directly to join against. A plugin does have access to the internal API to extract info about play status etc so something would be written but that is not playback reporting.

playback reporting was designed to monitor what your users are doing not what they are not doing.

Link to comment
Share on other sites

browneye253
1 hour ago, TeamB said:

how are you losing access to storage?

I was using Google Workspaces for storage but they have pulled back their unlimited storage option so I'm looking for ways to shrink my library.

  • Agree 1
Link to comment
Share on other sites

seanbuff
3 hours ago, browneye253 said:

I noticed someone else asking about a query to view content that hasn't been watched

1 hour ago, TeamB said:

playback reporting was designed to monitor what your users are doing not what they are not doing.

In saying that, if I am understanding the ask correctly - you can kinda use Playback Reporting to view items that haven't been watched by anyone.

You can use the 'Played' tab in the plugin, select the movie/show, and see if it has or hasn't ever been watched.

image.png.1cbfb4d9cc4d66651873b90949626b8c.png

image.png.0ae9c451bb652589409b9d07002979d0.png


But yeah, it will be a pretty manual task to go through each item

Link to comment
Share on other sites

browneye253

I found that.. Movies wouldn't be too bad but TV was going to be a nightmare because it didn't show at the show level you had to drill down to the episode level.  If that same view would show the users when I clicked the show level I could work with that for now.

Link to comment
Share on other sites

TeamB
9 minutes ago, browneye253 said:

I found that.. Movies wouldn't be too bad but TV was going to be a nightmare because it didn't show at the show level you had to drill down to the episode level.  If that same view would show the users when I clicked the show level I could work with that for now.

it should show you counts at a TV Show level

image.png.c57ecb070fb9c41373b9fe7976cfe05c.png

 

I think what you really want is a query that can tell you the most unplayed, i.e. you might have a TV Show with one one or two users that rewatch it regularly but it is still used a lot and you might want to keep that.

The above will not tell you that.

Edited by TeamB
Link to comment
Share on other sites

browneye253

@TeamBAwww.. I totally missed that it was an episode watched / total episode count.  I caught the icon changing to green and expected to see that if they had watched.  Looks like it's green if they've watched all episodes.  Would love it if it was orange or some other color when it's a partial watch or if you wanted to get super fancy and change color on the percentage of total watched. 

Blue < 25%
Orange < 75%
Yellow < 100%
Green = 100%

So now... if I change the "Keep Data" to a year or two or forever with say 25 users would I be pushing anything database-wise or performance?

Really appreciate the feedback and help.

Link to comment
Share on other sites

TeamB

the watched states are directly from the emby db

you dont need to change the keep data for as this data comes from the Emby main DB not the playback reporting DB.

 

  • Like 1
Link to comment
Share on other sites

browneye253

Excellent to hear... I was worried my Playback data was only a few months and it wouldn't be a real reflection of what my users have watched.  If I'm understanding correctly if I look at TV show "X" it would be showing anybody over the life of the server that has watched the show?

Link to comment
Share on other sites

TeamB
16 minutes ago, browneye253 said:

Excellent to hear... I was worried my Playback data was only a few months and it wouldn't be a real reflection of what my users have watched.  If I'm understanding correctly if I look at TV show "X" it would be showing anybody over the life of the server that has watched the show?

yes correct, it uses play stats from emby so if that user has that item marked as watched in emby then that is what it is using in this report

Link to comment
Share on other sites

dual-o
On 8/9/2023 at 8:08 AM, TeamB said:

I released a new version with an updated plugin sdk and a bunch of changes to the DB system anyway that would get it back up and running

I have the memory leak issue since the update to 2.0.0.4 too.

It was also reported here:

On 8/14/2023 at 9:57 AM, Tux7501 said:

Disregard my previous comment. It seems it quickly grew to 6GB but after 6-8 hours it’s still at 6GB which is fine. Not sure why the Playback Reporting plugin was causing this issue. Hopefully it’s fixed in future releases

Do you need a github issue? @TeamB

Link to comment
Share on other sites

TeamB
21 minutes ago, dual-o said:

I have the memory leak issue since the update to 2.0.0.4 too.

It was also reported here:

Do you need a github issue? @TeamB

what server version?

Link to comment
Share on other sites

TeamB

I rolled back some changes I recently made to the DB code. It was just code clean up and I dont know if or why this was causing issues but for now rolling back.

New Version 2.0.0.5

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

13 hours ago, dual-o said:

I have the memory leak issue since the update to 2.0.0.4 too.

It was also reported here:

Do you need a github issue? @TeamB

I just wanted to confirm I also had the memory leak issue. Was causing my docker in unraid to crash at midnight during the scheduled job i guess? I un-installed the plugin and no more crashing.

  • Like 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...