Jump to content

Playback Reporting


TeamB

Recommended Posts

TeamB

Playback reporting plugin:

  • View playback reports
  • View user activity
  • View performance and system usage

Install it from the Emby server plugin catalogue.

 

Source:

https://github.com/faush01/playback_reporting

 

Restoring data for recent (remote address) schema change

STOP this is destructive, back up your playback reporting data first.
stop emby server and take a copy of the playback_reporting.db DB before you start.

In the query tab run this to get a list of all the tables

SELECT name FROM sqlite_master

It should show a list of tables like this:

PlaybackActivity_20190525_085249
UserList
PlaybackActivity_20230425_063417
PlaybackActivity

the two tables you are interested in are

PlaybackActivity

and any table with the date sting in the end like

PlaybackActivity_20230425_063417

Edit the following query with the name you have in your above results (DONT USE MINE)

INSERT INTO PlaybackActivity
SELECT *, "" AS RemoteAddress FROM PlaybackActivity_<TABLE NAME HERE>
WHERE DateCreated NOT IN (SELECT DateCreated FROM PlaybackActivity)

This will import all the old data into the new table.

 

 

 

Edited by TeamB
  • Like 6
Link to comment
Share on other sites

  • 1 year later...
Happy2Play

Minor issue with punctuation, as everything after the apostrophe is dropped. @TeamB

query.thumb.jpg.21a25f12c900f9d8b74f8f411ce90127.jpg

result.jpg.2dfdc9f204578215147f6227d1ea09a8.jpg

 

Edited by Happy2Play
Link to comment
Share on other sites

  • 3 weeks later...
Dreakon13

I apologize if this isn't the right place to talk about the plugin, or possibly request something...

I love the plugin, I love digging through all the stats... I don't love having to re-write SQL statements every time to query data just the right way.  Is it currently possible, or is it possible in a future version, to allow storing/saving custom queries to conveniently re-run?

Link to comment
Share on other sites

TeamB

Yes, it was something on my list of things to look at that might be cool to add but i never got to it.

The plugin has been stable and not updated for several months now mainly due to the fact it does everything i need it to, with no feedback or suggestions from users there is no point making unwanted or unneeded changes for no reason.

I will look at your suggestion.

 

  • Thanks 1
Link to comment
Share on other sites

TeamB

I have released a new version with the ability to save custom queries and also charting options to the custom query page.

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

seanbuff

@TeamB all tabs are working correctly except for the Summary tab which just gives me a '400 Bad Request'

image.png.454285301f255994d401b8c5b450204c.png

 

2021-06-16 12:05:20.096 Info PlaybackReporting - UserActivityAPI: Default journal_mode for C:\Users\<username_obfuscated>\AppData\Roaming\Emby-Server\programdata\data\playback_reporting.db is delete
2021-06-16 12:05:20.098 Info PlaybackReporting - UserActivityAPI: Default journal_mode for C:\Users\<username_obfuscated>\AppData\Roaming\Emby-Server\programdata\data\playback_reporting.db is delete
2021-06-16 12:05:20.099 Error Server: Error processing request
	*** Error Report ***
	Version: 4.7.0.2
	Command line: C:\Users\<username_obfuscated>\AppData\Roaming\Emby-Server\system\EmbyServer.dll -noautorunwebapp
	Operating system: Microsoft Windows 10.0.19042
	Framework: .NET Core 3.1.13
	OS/Process: x64/x64
	Runtime: C:/Users/<username_obfuscated>/AppData/Roaming/Emby-Server/system/System.Private.CoreLib.dll
	Processor count: 16
	Data path: C:\Users\<username_obfuscated>\AppData\Roaming\Emby-Server\programdata
	Application path: C:\Users\<username_obfuscated>\AppData\Roaming\Emby-Server\system
	System.ArgumentNullException: System.ArgumentNullException: Value cannot be null. (Parameter 'g')
	   at System.Guid..ctor(String g)
	   at playback_reporting.Api.UserActivityAPI.Get(GetBreakdownReport request)
	   at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req)
	   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
	Source: System.Private.CoreLib
	TargetSite: Void .ctor(System.String)
	
2021-06-16 12:05:20.099 Info Server: http/1.1 Response 400 to 10.1.1.1. Time: 14ms. http://<domain_obfuscated>:8096/emby/user_usage_stats/UserId/BreakdownReport?user_id=&days=28&end_date=2021-06-16&stamp=1623809120081&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome&X-Emby-Device-Id=80c17a26-1a4e-4b76-bc1f-671376cae867&X-Emby-Client-Version=4.7.0.2


Latest version 1.8.0.0

Link to comment
Share on other sites

Happy2Play
13 minutes ago, seanbuff said:

@TeamB all tabs are working correctly except for the Summary tab which just gives me a '400 Bad Request'

image.png.454285301f255994d401b8c5b450204c.png

 


2021-06-16 12:05:20.096 Info PlaybackReporting - UserActivityAPI: Default journal_mode for C:\Users\<username_obfuscated>\AppData\Roaming\Emby-Server\programdata\data\playback_reporting.db is delete
2021-06-16 12:05:20.098 Info PlaybackReporting - UserActivityAPI: Default journal_mode for C:\Users\<username_obfuscated>\AppData\Roaming\Emby-Server\programdata\data\playback_reporting.db is delete
2021-06-16 12:05:20.099 Error Server: Error processing request
	*** Error Report ***
	Version: 4.7.0.2
	Command line: C:\Users\<username_obfuscated>\AppData\Roaming\Emby-Server\system\EmbyServer.dll -noautorunwebapp
	Operating system: Microsoft Windows 10.0.19042
	Framework: .NET Core 3.1.13
	OS/Process: x64/x64
	Runtime: C:/Users/<username_obfuscated>/AppData/Roaming/Emby-Server/system/System.Private.CoreLib.dll
	Processor count: 16
	Data path: C:\Users\<username_obfuscated>\AppData\Roaming\Emby-Server\programdata
	Application path: C:\Users\<username_obfuscated>\AppData\Roaming\Emby-Server\system
	System.ArgumentNullException: System.ArgumentNullException: Value cannot be null. (Parameter 'g')
	   at System.Guid..ctor(String g)
	   at playback_reporting.Api.UserActivityAPI.Get(GetBreakdownReport request)
	   at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req)
	   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
	Source: System.Private.CoreLib
	TargetSite: Void .ctor(System.String)
	
2021-06-16 12:05:20.099 Info Server: http/1.1 Response 400 to 10.1.1.1. Time: 14ms. http://<domain_obfuscated>:8096/emby/user_usage_stats/UserId/BreakdownReport?user_id=&days=28&end_date=2021-06-16&stamp=1623809120081&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome&X-Emby-Device-Id=80c17a26-1a4e-4b76-bc1f-671376cae867&X-Emby-Client-Version=4.7.0.2


Latest version 1.8.0.0

Not that it helps but I am not seeing this issue on same server version.  Summary reported for all and individual users.

Link to comment
Share on other sites

seanbuff
1 minute ago, TeamB said:

Has it just started happening? Did it happen on the none beta server?

Has just started as far as I can tell, I only run the beta server so cannot comment on a non-beta server.

Summary tab is my most used tab, so was definitely working without issue earlier in the week.

Link to comment
Share on other sites

TeamB

Its probably a removed user then, did you recently remove a user?

Onthe settings tab there is a button to clean up deleted users, try that.

Link to comment
Share on other sites

seanbuff

image.png.c694d61da8d860347ea2dc07fde79704.png

Also noticing it on the 'Breakdown' tab - but data is still flowing there unlike the 'Summary' tab

I have not removed or modified any users -- but will try that cleanup job now.

Link to comment
Share on other sites

seanbuff

Nope, removing unknown user data made no difference unfortunately.

Link to comment
Share on other sites

Happy2Play
24 minutes ago, seanbuff said:

Nope, removing unknown user data made no difference unfortunately.

Does the same thing happen if you change to say your primary user instead of all users?

  • Thanks 1
Link to comment
Share on other sites

seanbuff
17 minutes ago, Happy2Play said:

Does the same thing happen if you change to say your primary user instead of all users?

Ahh yes, individual user data shows up - it appears to just be an issue with 'All Users'

image.png.91aff5891ef0dcb392241882ebe0d7df.png

Link to comment
Share on other sites

TeamB

Ok that norrow s it down a little.

Are you sure you have not edited or removed a user recently?

Link to comment
Share on other sites

seanbuff
45 minutes ago, TeamB said:

Are you sure you have not edited or removed a user recently?

100% positive. In fact, I have never removed a user since inception - have only ever added.

Link to comment
Share on other sites

TeamB
1 hour ago, seanbuff said:

100% positive. In fact, I have never removed a user since inception - have only ever added.

Can you go to the query tab and run the following SQL

SELECT ROWID, * 
FROM PlaybackActivity
WHERE UserId is null OR UserId = ''
LIMIT 10

UNCHECK the "Replace UserId with UserName" option

And see if there are any results.

Edited by TeamB
Link to comment
Share on other sites

seanbuff
50 minutes ago, TeamB said:

Can you go to the query tab and run the following SQL

Yes I get results with that query, and the UserId column = null

 

20 minutes ago, TeamB said:

try the latest version 1.8.0.1

I will let you know once it shows up and I am able to restart the server, thanks @TeamB appreciate your time on this

Link to comment
Share on other sites

TeamB

I have updated the Chart JS lib to the latest. There were a number of code changes required for this as a Chart JS version 2->3 jump had a lot of code fixes and interface changes.

I think I got all the functional changes working but there might be look and feel changes that need fixing.

I have attached the test build here, if people can test this and compare with the 1.8 version of the plugin that would help iron out and inconsistencies.

If you do test it and find issues please add console logs or screen shots so we can track down the differences and issues.

 

 

Edited by TeamB
Link to comment
Share on other sites

Happy2Play

Updated to 1.9.0.0, everything appears to be working, no console or log errors.

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