Jump to content

New Statistics plugin


Recommended Posts

HawkXP71
Posted

This project all started with my DV profiles not working properly and I wanted a simple way to find media that used DV Profile 5 so they could be replaced/repaired.

What it turned into, is essentially a modern implementation of the statistics plugin.  A lot of the ideas came directly from that.

Highlights

  • Uses emby theme's classes for all html.  No custom colors at all.  Should allow better visual integration into servers running a theme
  • Uses a sqlite database for storing information, and a xml config file for settings only
    • Both are stored in the plugins/configuration directory, this way they are backed up
  • Has both administrative statistics as well as user statistics (available to non administrators)
  • Tabbed interface
  • Unfortunately, does NOT use the new PluginUI :( I have tried but haven't made the investment to convert it, and with the limited documentation out there, and even fewer examples of functional plugins, I just couldn't get it working.
  • I went through the previous statistics plugin's requests and implemented a number of them.  To be fair, I didn't track them
  • Tables are sortable (sort remembered session to session)
  • Analysis Tasks are broken down in to smaller steps. Runtime and server usage allows it to be run nightly
    • I have mine run at 1am and have had no issues at all
  • Fully opensource, available at https://github.com/towel42-com/Statistics2026

Let me know if you have any questions

Admin Pages:

  • Summary Page
    • List of most active users
    • Number of users
    • Media Codec break down
    • Media Resolution breakdown
    • Dolby Vision Profiles
  • Movie Summary Page
    • Totals
      • Movies
      • Collections
      • Studios
      • Movies missing from collections
    • Movie Genres
    • Movie Actors
    • Movie Ratings
    • Largest/Longest Movie
    • Smallest/Shortest Movie
    • Highest/Lowest Rated
    • Highest/Lowest Bitrate
    • First/Latest movie added to server
    • Oldest/Latest movie premier
    • Least/Most watched movies
  • Movies Page
    • Lists all movies on the server
    • Filter for "On"/"Missing"/"All"
      • Missing for movies is based on the collections on the server
    • Columns for all movies
      • Name
      • Collection
      • Premiere Date
      • Streaming Services
    • Columns for missing movies
      • Click to search
      • if the date is in the future, lists how many days or the date
    • Additional Columns for movies on the server
      • Resolution
      • Codec
      • Dolby Vision Profile
      • Location on server
  • Episode/Series Summary Page
    • Totals
      • # of TV Episode
      • # of Total TV Series
      • Playtime of all tv episodes
      • TV Networks
      • Episodes missing from series
    • Report on TV Genres
    • Report on TV Actors
    • Report on TV Ratings
    • Largest/Longest Series
    • Highest/Lowest Average Rated Series
    • Highest/Lowest Bitrate Series
    • First TV Series/Latest TV Series added to server
    • Oldest/Latest TV series premier
    • Least/Most Watched Shows (average from across all users)
      • Does list shows that are tied for how many times they have been watched
    • Oldest/Latest TV Episode premier
    • First/Last TV Episode added to server
  • Episodes Page
    • Lists all the episodes on the server
    • Same functionality as the Movie lists, except for episodes
    • Filter for "On"/"Missing"/"All"
    • Columns for all movies
      • Name
      • Series
      • Premiere Date
      • Streaming Services
    • Columns for missing movies
      • Click to search
      • if the date is in the future, lists how many days or the date
    • Additional Columns for movies on the server
      • Resolution
      • Codec
      • Dolby Vision Profile
      • Location on server
  • TV Series Progress
    • Has a user selection 
    • For each series on the server, lists how many many episodes have been seen
    • The rating for the series (using the user values if available)
    • Shows the series status (ended/continuing etc etc)
  • User Stats
    • Has a user selection all values on this page are based on the Users watch history
    • Movie Stats
      • Total watchable time
      • Time Watched
      • Total movies available
      • Total movies watched
      • Users favorite movie years
      • Favorite movie Genres
      • Total time watching movies
      • Total Watchable movie time
      • Last seen movies
      • Most watched Movies
    • Series Stats
      • Total TV Episodes/Series
      • Total TV Episodes/Series Watched
      • Total Series Finished
      • Favorite TV Genres
      • Total Time Watching Episodes
      • Total Watchable Episode Time
      • Last Seen TV Episodes
      • Most watched shows
  • System Status page
    • Show the status of each analysis tool, when it was last run and how long it took
    • Shows the status of the database
    • Shows difference between tracked time and playcount based time
    • Show movies in multiple collections
  • Settings
    • System Settings
      • Show Debug info? turn on more details in different pages (only enabled when debug logging is enabled)
      • Show Diagnostics info? turns on more detailed debug information (only enabled when debug logging is enabled)
      • Show last run info? each page can show when the last time the tools necessary for analysis was run and why it was run
      • Reset the play count/time?  Next time the analysis is performed, all play time is reset to playcount * length of movie/episode
      • Reset database state? Recalulate the state of the database the next time a page is viewed
    • Search for missing settings
    • How many days in the future to look for missing media? When an episode or movie is scheduled, how far out to care if its missing
    • How many days after the premiere of a movie, to consider it missing?  If a movie comes out today, its not considered missing from a collection for this many days
    • In the search column for missing media, show "Search themoviedb"?  If checked, you can always search themoviedb for the episode or movie
    • Additional URLS to search for missing media. Add what you want here
    • Show filtered missing summaries?  For the summary pages, show all missing or only the ones that were not filtered out
    • Report on missing specials? For tv shows with known specials, report them as missing
    • In the streaming column, always have a link to JustWatch.com
    • How many streaming providers to list? Some media reports 30 to 40 streaming providers, this limits it (default is 3)
    • Missing Series Filter
      • Each filter is listed in a sortable filter table
      • Each row is one series
        • Series Name
        • Track Series?
        • Track Specials?
        • Min Season Number
        • Max Season Number
      • This allows you to track a tv show for missing, but only episodes after the 3 season 
        • I use this for tv shows that my wife watches but I only started getting for her late in the game
    • Missing Movies and Collection Filter
      • A text box where you can enter collections or movie names to filter
    • User Report Settings
      • Exclude Administrator users from reports?
        • Since the change of not allowing administrators to be remotely logged in from 2 years ago or so, I know many people created an admin user that does nothing.
        • No point in using that user for statistics
      • Only show suers with a Connect User ID
    • Media Report Settings
      • Number of Watched Videos to list
      • Number of "Tied" media to list
      • Number of Genres to report on
      • Number of Actors to report on
    • Dolby Vision Profile report settings
      • Show Non-HEVC/Unknown DV profiles
    • Resolution Report Settings
      • Show all known resolutions?

User Pages:

  • Users under App Settings have a "User Statistics category
  • They have two pages
    • They are identical to the admin pages minus the ability to select the user
  • User Stats Page
  • TV Series Progress Page

Non-UI functionality:

  • Tracks real time viewing of videos in real time, ie watched times are real time
  • Monitors when media is added, and will kick of a subset analysis (Media, Series, Collects, and Missing)
  • Automatically run on server startup (after a slight delay)
  • Non scheduled running of the analysis engines checks to see if its necessary via some out of date checks
  • Lots of debug console logging

To be worked on:

  • String based filter for movie and episode lists
  • Custom color schemes for highlight colors
  • Add filter for series status
  • User based settings page
  • User settings for what reports to show
  • Streaming providers based on CLIENT ip address

 

 

Statistics2026.dll

  • Like 1
  • Thanks 1
GrimReaper
Posted (edited)

There's a memory leak in  "4 - Analyze User Watched Data Information", it blew up past 24+ GB RAM usage (twice) before I killed it. Prior modules working fine. Win 10, 4.10.2.0.

Edit: Module "6 - Analyzing Series Information" freezes the server, goes up to 100% and then falls back to 80% - after that, server is unresponsive, no entries in the log, it just cuts-off.

Edited by GrimReaper
HawkXP71
Posted
16 minutes ago, GrimReaper said:

There's a memory leak in  "4 - Analyze User Watched Data Information", it blew up past 24+ GB RAM usage (twice) before I killed it. Prior modules working fine. Win 10, 4.10.2.0.

Edit: Module "6 - Analyzing Series Information" freezes the server, goes up to 100% and then falls back to 80% - after that, server is unresponsive..

Can you send me a debug log.  Likely not a memory leak, but a resource usage. That is the most expensive analysis.

How many users are on the server? how many episodes + movies?


 

GrimReaper
Posted
7 minutes ago, HawkXP71 said:

Can you send me a debug log.  Likely not a memory leak, but a resource usage. That is the most expensive analysis.

How many users are on the server? how many episodes + movies?
 

Just sent you one for "6 - Analyzing Series Information".

Users as in active or total? 70-ish ttl, 10ish-15 regularly active, ~5k+ movies, ~1.7k+ TV Shows, ~70k episodes.

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