GithubHelp home page GithubHelp logo

mcstats's Introduction

ZStats

ZStats aka MCStats is a tool to compile Play History statistics for JRiver Media Center

ZStats reads the contents of [Play History] field from JRiver's Media Center, computes user-defined statistics from the data, and writes back the calculated statistics to an MC field for usage in Views/Expressions/Smartlists. ZStats can also create user-defined Playlists for the Top N most played tracks in any given time range.

ZStats is designed to be executed periodically (nighly) as a scheduled task to update statistics for all files in an MC library, so that this heavy computation task doesn't need to be run in realtime in MC. Because of this, it does not have a GUI and all settings are done via a zstats.ini configuration file.

Please post any issues or requests using MC's Interact forum, where I'm known as zybex.


Features

  • Play History statistics per File, Album, Artist, or grouped by any other MC field
  • writes statistics back to an MC field for usage in Views/Expressions
  • creates TOP N Playlists for a given date range using multiple criteria
  • daily/weekly/monthly/etc statistics, custom date ranges supported
  • optionally executes an Expression before/after calculating statistics
  • designed to run as a scheduled task to update statistics periodically (overnight)

Instructions

ZStats requires MC v28.0.93 or above.

  1. Create the [Play History] field in MC and setup an "After Playback" expression (instructions below)
  2. download the latest release and place the executable in a folder with Write permissions
  3. run it once - it will create a default zstats.ini configuration
  4. edit the config file and enter your MCWS hostname, username and password
  5. run ZStats.exe again to process all files and generate Statistics and Playlists
  6. fine tune the config file to your taste, re-run to update statistics/playlists
  7. Use Windows Task Scheduler to schedule a nightly run of the tool

ZStats Configuration

The ZStats.ini configuration file is generated by default. You can define which statistics and playlists you want to create, as well as the output format for the [Play Stats] field and other settings. Please read the comments on the default zstats.ini to learn about all the available options and time range tokens.

The default configuration sets UpdateStats=0 and UpdatePlaylists=1, so it will only create the Top Playlists which is relatively fast. To create/update the [Play Stats] field you need to set UpdateStats=1. The first run with this option enabled may be VERY slow depending on the size of your library because it needs to update [Play Stats] for all files; however, on subsequent runs ZStats will only update the files which had changes since last run (files which were played since last run), so it will be much faster.


MC configuration

To use ZStats you need to first setup MC to collect Play History timestamps, as described in this thread. In short:

  1. Create a string field (NOT calculated) called [Play History]

  2. Set the expression in "Options > Library & Folders > Expressions: After Playback Expression" to

    setfield(Play History,[Last Played,0];[play history])

After setting this up and playing tracks for some time, the [Play History] field have been updated with enough information for ZStats to process and generate the statistics and playlists.

ZStats will automatically create the [Play Stats] field if it doesn't exist (or any other field name as specified in the ZStats.ini). However, the created field will have the flag "save in file tags" enabled by default as it cannot be disabled automatically via the MCWS API. This may cause the update process to become even slower as MC will update the sidecar.xml for each file as ZStats is updating the field. Because of this, I recommend that you manually disable this flag on the [Play Stats] MC field.

mcstats's People

Contributors

zybexxl avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.