TeamB 2376 Posted May 2, 2020 Share Posted May 2, 2020 (edited) 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 April 24, 2023 by TeamB 6 Link to comment Share on other sites More sharing options...
Happy2Play 8928 Posted May 22, 2021 Share Posted May 22, 2021 (edited) Minor issue with punctuation, as everything after the apostrophe is dropped. @TeamB Edited May 22, 2021 by Happy2Play Link to comment Share on other sites More sharing options...
TeamB 2376 Posted May 23, 2021 Author Share Posted May 23, 2021 I released a fix version : 1.7.0.4 1 Link to comment Share on other sites More sharing options...
Dreakon13 137 Posted June 12, 2021 Share Posted June 12, 2021 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 More sharing options...
TeamB 2376 Posted June 13, 2021 Author Share Posted June 13, 2021 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. 1 Link to comment Share on other sites More sharing options...
TeamB 2376 Posted June 15, 2021 Author Share Posted June 15, 2021 I have released a new version with the ability to save custom queries and also charting options to the custom query page. 1 3 Link to comment Share on other sites More sharing options...
seanbuff 956 Posted June 16, 2021 Share Posted June 16, 2021 @TeamB all tabs are working correctly except for the Summary tab which just gives me a '400 Bad Request' 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 More sharing options...
TeamB 2376 Posted June 16, 2021 Author Share Posted June 16, 2021 Has it just started happening? Did it happen on the none beta server? Link to comment Share on other sites More sharing options...
Happy2Play 8928 Posted June 16, 2021 Share Posted June 16, 2021 13 minutes ago, seanbuff said: @TeamB all tabs are working correctly except for the Summary tab which just gives me a '400 Bad Request' 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 More sharing options...
seanbuff 956 Posted June 16, 2021 Share Posted June 16, 2021 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 More sharing options...
TeamB 2376 Posted June 16, 2021 Author Share Posted June 16, 2021 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 More sharing options...
seanbuff 956 Posted June 16, 2021 Share Posted June 16, 2021 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 More sharing options...
seanbuff 956 Posted June 16, 2021 Share Posted June 16, 2021 Nope, removing unknown user data made no difference unfortunately. Link to comment Share on other sites More sharing options...
TeamB 2376 Posted June 16, 2021 Author Share Posted June 16, 2021 Ok i will look into it. Link to comment Share on other sites More sharing options...
Happy2Play 8928 Posted June 16, 2021 Share Posted June 16, 2021 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? 1 Link to comment Share on other sites More sharing options...
seanbuff 956 Posted June 16, 2021 Share Posted June 16, 2021 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' Link to comment Share on other sites More sharing options...
TeamB 2376 Posted June 16, 2021 Author Share Posted June 16, 2021 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 More sharing options...
seanbuff 956 Posted June 16, 2021 Share Posted June 16, 2021 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 More sharing options...
TeamB 2376 Posted June 16, 2021 Author Share Posted June 16, 2021 I think this is the line having the issue https://github.com/faush01/playback_reporting/blob/31ff478da0b4581a54b715683dfecca86948eeac/playback_reporting/Api/UserActivityAPI.cs#L708 Link to comment Share on other sites More sharing options...
TeamB 2376 Posted June 16, 2021 Author Share Posted June 16, 2021 (edited) 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 June 16, 2021 by TeamB Link to comment Share on other sites More sharing options...
TeamB 2376 Posted June 16, 2021 Author Share Posted June 16, 2021 try the latest version 1.8.0.1 Link to comment Share on other sites More sharing options...
seanbuff 956 Posted June 16, 2021 Share Posted June 16, 2021 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 More sharing options...
seanbuff 956 Posted June 16, 2021 Share Posted June 16, 2021 1.8.0.1 fixed the issue. Thanks for the quick turnaround @TeamB 1 Link to comment Share on other sites More sharing options...
TeamB 2376 Posted June 18, 2021 Author Share Posted June 18, 2021 (edited) 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 June 20, 2021 by TeamB Link to comment Share on other sites More sharing options...
Happy2Play 8928 Posted June 18, 2021 Share Posted June 18, 2021 Updated to 1.9.0.0, everything appears to be working, no console or log errors. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now