Jump to content

New Statistics plugin


reggi

Recommended Posts

reggi

So here is a new update. If this one is bug-free we can try to get this one in the catalog I think.

 

Changelog

- Removed graph (again), preparing a stable release first

- Added 2 new stats (highest and lowest rating), for lowest rating 0 is not included in the calculation

- Fix some more spelling errors

- Fix the crash when calculating oldest movie stat, no more NULL ref should occur now.

 

Let me know if you find any bugs in this version!

Statistics 0.0.11.0.zip

  • Like 1
Link to comment
Share on other sites

CBers

Thanks @@reggi.

 

Just downloaded, installed, restarted Emby and ran the scheduled task, but I'm confused over the stats.

 

Why does "24:Legacy" shows as 112.5% collected?

Why does "Beyond" show as 90.9% collected, when I have all 10 episodes?

 

Name	Started	Watched	Episodes	Specials	Collected	Score	Status
24: Legacy	2017	0%	0 / 9	0 / 0	112.5%	9.5	Continuing
Beyond	2017	0%	0 / 10	0 / 0	90.9%

There other similar discrepancies throughout my TV library, but I didn't want to list everything :)

 

Thanks.

  • Like 1
Link to comment
Share on other sites

reggi

As for the Beyond, I see that on TVDB there is already a Season 2 Episode 1 added.

So I think that the check if a episode is already aired is not working, that's why you get 90;9%

 

As for the 112,5%, I have no idea yet but I'll work on it tonight!

Link to comment
Share on other sites

CBers

Thanks Reggi.

 

Sorry to rain on your parade :)

 

Appreciate all the work you're doing.

  • Like 1
Link to comment
Share on other sites

Happy2Play

Just a quick look and I see similar anomalies.  Don't see the issue CBer sees with 24:Legacy though.

 

Name                   Started Watched Episodes Specials Collected    Score          Status

The Blacklist          2013    100%       83 / 83     0 / 0      101.2%        8.6         Continuing

 

I only have 82 episodes.

  • Like 2
Link to comment
Share on other sites

Happy2Play

I assume the second box is suppose to be Lowest Movie Rating.

 

58da1ce99b626_ratings.jpg

Link to comment
Share on other sites

PenkethBoy

Hi @@reggi

 

i am still getting an error with one of my servers - it maybe that its setup with video's etc which do not have tvdb metadata - TED talks etc

 

 

2017-03-28 14:20:15.1559 Info TaskManager: Executing Calculate statistics for all users
2017-03-28 14:20:15.1559 Info HttpServer: HTTP Response 204 to 192.168.1.11. Time: 0ms. http://192.168.1.52:9096/emby/ScheduledTasks/Running/d459f39d7abb81f5fcce03048a7ecf4d
2017-03-28 14:20:15.1559 Info HttpServer: HTTP GET http://192.168.1.52:9096/emby/ScheduledTasks?isHidden=false. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36
2017-03-28 14:20:15.1715 Info HttpServer: HTTP Response 200 to 192.168.1.11. Time: 16ms. http://192.168.1.52:9096/emby/ScheduledTasks?isHidden=false
2017-03-28 14:20:15.8122 Info HttpClient: HttpClientManager GET: https://thetvdb.com/api/Updates.php?type=all&time=1490654658
2017-03-28 14:20:16.8123 Info HttpClient: HttpClientManager GET: https://thetvdb.com/api/Updates.php?type=none
2017-03-28 14:22:29.2174 Error TaskManager: Error
*** Error Report ***
Version: 3.2.8.16
Command line: D:\Emby2\System\MediaBrowser.ServerApplication.exe
Operating system: Microsoft Windows NT 6.2.9200.0
64-Bit OS: True
64-Bit Process: True
Processor count: 8
Program data path: D:\Emby2
Application directory: D:\Emby2\System
System.InvalidOperationException: Sequence contains no elements
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at Statistics.Helpers.Calculator.CalculateHighestRating()
at Statistics.ScheduledTasks.CalculateStatsTask.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Emby.Common.Implementations.ScheduledTasks.ScheduledTaskWorker.d__68.MoveNext()
System.InvalidOperationException
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at Statistics.Helpers.Calculator.CalculateHighestRating()
at Statistics.ScheduledTasks.CalculateStatsTask.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Emby.Common.Implementations.ScheduledTasks.ScheduledTaskWorker.d__68.MoveNext()

2017-03-28 14:22:29.2174 Info TaskManager: Calculate statistics for all users Failed after 2 minute(s) and 14 seconds

 

 

Also i am getting funky stats for tv shows on my main server e.g. Babylon 5 - have 110 episodes but @ 96.5% - checked tvdb and 110 episodes is correct??

 

 

Keep up the good work you will get it sorted :)

  • Like 1
Link to comment
Share on other sites

reggi

Thanks for the support and testing guys!

 

And for the patience to get the plugin ready! :D

 

I will have a look at the show progress stats later today.

Thanks for the server log, I think I know why you are getting the problem.

Link to comment
Share on other sites

reggi

I have a new sub verion prepared that will fix the "beyond" bug.

 

I used today's date when no air date was supplied by TVDB, changed it to MaxDate so it will not be included in the today's collected calculations.

Also, I added some color stylings to the progress page, let me know what you think about them (useful or not?) Ow yes, I also changed "0 days ago" to "Today". I think that sounds better.

 

As for the stat's going over 100% I still have no idea what's happening. Some more investigation is needed.

 

@@PenkethBoy

Can you check if the issue is fixed with the HighestRating stat? (last server log you posted)

Normally this is fixed as well because I filter out all Movies without CommunityRating.

 

@@CBers

Maybe your problems are fixed now, if not can you maybe PM me the folder content of your "24:Legacy" serie?

I hope the Beyond stat is correct now.

 

@Happy2Play

Can you as well PM me the folder content of your "The Blacklist" serie? I have to find out why there is 1 episode extra.

 

Thanks again for testing the plugin over and over again to help me out!!

Statistics 0.0.11.1.zip

Edited by reggi
  • Like 2
Link to comment
Share on other sites

PenkethBoy

Hi @@reggi

 

fails quicker than last time but still errors out - on latest beta server 3.2.9.2

 

 

2017-03-29 18:21:18.3448 Info HttpServer: HTTP GET http://192.168.1.52:9096/emby/ScheduledTasks?isHidden=false. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36
2017-03-29 18:21:18.3448 Info HttpServer: HTTP Response 200 to 192.168.1.11. Time: 0ms. http://192.168.1.52:9096/emby/ScheduledTasks?isHidden=false
2017-03-29 18:21:20.6576 Info HttpServer: HTTP POST http://192.168.1.52:9096/emby/ScheduledTasks/Running/d459f39d7abb81f5fcce03048a7ecf4d. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36
2017-03-29 18:21:20.6576 Info TaskManager: Executing Calculate statistics for all users
2017-03-29 18:21:20.6576 Info HttpServer: HTTP Response 204 to 192.168.1.11. Time: 0ms. http://192.168.1.52:9096/emby/ScheduledTasks/Running/d459f39d7abb81f5fcce03048a7ecf4d
2017-03-29 18:21:20.6576 Info HttpServer: HTTP GET http://192.168.1.52:9096/emby/ScheduledTasks?isHidden=false. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36
2017-03-29 18:21:20.6576 Info HttpServer: HTTP Response 200 to 192.168.1.11. Time: 0ms. http://192.168.1.52:9096/emby/ScheduledTasks?isHidden=false
2017-03-29 18:21:21.1419 Info HttpClient: HttpClientManager GET: https://thetvdb.com/api/Updates.php?type=all&time=1490807105
2017-03-29 18:21:21.8139 Info HttpClient: HttpClientManager GET: https://thetvdb.com/api/Updates.php?type=none
2017-03-29 18:21:34.4559 Error TaskManager: Error
*** Error Report ***
Version: 3.2.9.2
Command line: D:\Emby2\System\MediaBrowser.ServerApplication.exe
Operating system: Microsoft Windows NT 6.2.9200.0
64-Bit OS: True
64-Bit Process: True
Processor count: 8
Program data path: D:\Emby2
Application directory: D:\Emby2\System
System.InvalidOperationException: Sequence contains no elements
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at Statistics.Helpers.Calculator.CalculateHighestRating()
at Statistics.ScheduledTasks.CalculateStatsTask.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Emby.Common.Implementations.ScheduledTasks.ScheduledTaskWorker.d__68.MoveNext()
System.InvalidOperationException
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at Statistics.Helpers.Calculator.CalculateHighestRating()
at Statistics.ScheduledTasks.CalculateStatsTask.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Emby.Common.Implementations.ScheduledTasks.ScheduledTaskWorker.d__68.MoveNext()

2017-03-29 18:21:34.4559 Info TaskManager: Calculate statistics for all users Failed after 0 minute(s) and 13 seconds
2017-03-29 18:21:34.4559 Info ServerManager: Sending web socket message NotificationAdded
2017-03-29 18:21:34.4559 Info ServerManager: Sending web socket message ScheduledTaskEnded
2017-03-29 18:21:34.4559 Info TaskManager: ExecuteQueuedTasks

 

 

 

Works ok on stable (but with metadata) :)

 

As for the shading 0f the % column might be better to not shade the 100% - anything else will stand out better then

Link to comment
Share on other sites

reggi

I forgot to mention, it's best that you remove the statistics.xml file before running the background task.

This way the incorrect "beyond" total count will be corrected!

 

@@PenkethBoy

 

EDIT:

I included a new version 0.0.11.2 that will hopefully fix your issue. It will now just show "NO DATA" when for some reason no movies or episodes are found for a certain stat calculation (no more null ref exceptions :) )

At the moment I'm only testing my plugin on 2 stable Emby servers, no beta version. Maybe I have to start doing that as well!

 

You mean something like this?

58dbf359a46b6_Screenshot_1.png

 

I removed all the radius borders and gradients and that looks like this (maybe better?)

58dbf415eed9e_Screenshot_2.png

 

As for the error you are getting, I'll have a look!

Statistics 0.0.11.2.zip

Edited by reggi
Link to comment
Share on other sites

reggi

Thanks for the screenshot.

 

Maybe you are just from the future and took new episodes from there to this timeframe. If not, this is a bug and I will look into it!

 

I'm also working to remove some columns (Episodes and Specials) and combine them in the Watched and Collected columns.

58dc0919413fb_Screenshot_5.png

  • Like 1
Link to comment
Share on other sites

Just fyi, if you are using the Emby database for missing episodes information then it will depend on the user enabling import of missing episodes on their Emby libraries. But if you mention to someone to do that make sure to point out that it will also cause longer library scans (as mentioned in the UI under the checkbox).

  • Like 1
Link to comment
Share on other sites

reggi

I figured that out a few weeks ago, without enabling the checkbox no virtual episodes are stored in the DB. Since I don't want to force people to enable it I started using the TVDB API to get the total episode counts for all episodes.

Thanks for mentioning it!

 

Btw, for getting the plugin in the catalog, I need to contact you or someone else from the team?

 

@@CBers

 

I found the problem with the 250%, it looks like coupling (US) has episodes without air dates in TVDB. But since you have them on your server it gives 250% instead of 100%

I think I just can round everything > 100% to 100% because there will be other shows with the same problem.

 

EDIT

And here is a new update that should fix the 250% collected stat.

Let me know what you think about the new column styling!!

Statistics 0.0.11.3.zip

Edited by reggi
  • Like 1
Link to comment
Share on other sites

Happy2Play

@@reggi

 

I found my issue, one season had two versions of an episode (mkv and mp4) since I had 83 episodes and there were only 82 aired.

 

The Blacklist 2013 100% 82 / 82 0 / 0 100% 8.6 Continuing

 

New updates look good.

 

 

 

Is there anything that can be done for double episodes?

 

Name      Started Watchedinfo   Collectedinfo     Score   Status

Mob City   2013    3 / 3 (100%)    3 / 0 (50%)         7.7     Ended

 

Mob City.S01E01-E02

Mob City.S01E03-E04

Mob City.S01E05-E06

Edited by Happy2Play
Link to comment
Share on other sites

CBers

@@CBers

 

I found the problem with the 250%, it looks like coupling (US) has episodes without air dates in TVDB. But since you have them on your server it gives 250% instead of 100%

I think I just can round everything > 100% to 100% because there will be other shows with the same problem.

 

 

D'ya know I didn't even see that, as it was green :)

 

Thanks, I'll try the latest version and report back.

Link to comment
Share on other sites

reggi

Nice that my plugin already finds wrong data on your server :D

 

I found as well double episodes already for a show last week with the plugin :)

 

For the double episodes, I have to check how Emby handles them in the database

Edited by reggi
  • Like 2
Link to comment
Share on other sites

Happy2Play

What is this suppose to mean? I have one unwatched, last nights episode.

 

   Name            Started         Watched                     Collected          Score       Status

Chicago Fire      2012      108 / 109 (99.1%)      109 / 0 (100.9%)      8.5      Continuing

Rogue                2013        41 / 42 (97.6%)         42 / 0 (105%)          6.9      Continuing

 

 

 

Hmm, something just changed as I ran task again and everything normailized.

 

Chicago Fire 2012 108 / 109 (99.1%) 109 / 109 (100%) 8.5 Continuing

Rogue           2013  41 / 42 (97.6%)      42 / 42 (100%)   6.9 Continuing

Edited by Happy2Play
Link to comment
Share on other sites

PenkethBoy

no error on 11.3 (deleted xml file as well) - on 9.3 beta

 

working ok on stable as well

 

i will look at some of the incorrect numbers tomorrow

Link to comment
Share on other sites

Happy2Play

Are all "User-based show progress" columns suppose to be sortable?  Currently only Watched and Collected are sortable.  Sorry if this has already been mentioned.

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