From ae3d75bbe309b835f819d61fadfa46deb7c813e1 Mon Sep 17 00:00:00 2001 From: herby2212 <12448284+herby2212@users.noreply.github.com> Date: Mon, 27 Feb 2023 02:32:50 +0100 Subject: [PATCH] watch time & user stats for collections (#1982) * user_stats for collection * watch_time_stats for collection * check for media_type to be compatible with API * update API and datafactory optimizations * beautify webserve class * fix sql query build * filter on suitable collections * stats for collections of sub media type * optimize array creation --- data/interfaces/default/info.html | 15 ++++++-- plexpy/datafactory.py | 61 ++++++++++++++++++++++--------- plexpy/webserve.py | 22 +++++++---- 3 files changed, 69 insertions(+), 29 deletions(-) diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index dbce734b..471c8e7e 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -12,6 +12,7 @@ data :: Usable parameters (if not applicable for media type, blank value will be == Global keys == rating_key Returns the unique identifier for the media item. media_type Returns the type of media. Either 'movie', 'show', 'season', 'episode', 'artist', 'album', or 'track'. +sub_media_type Returns the subtype of media. Either 'movie', 'show', 'season', 'episode', 'artist', 'album', or 'track'. art Returns the location of the item's artwork title Returns the name of the movie, show, episode, artist, album, or track. edition_title Returns the edition title of a movie. @@ -553,7 +554,7 @@ DOCUMENTATION :: END % endif - % if data['media_type'] in ('movie', 'show', 'season', 'episode', 'artist', 'album', 'track'): + % if data['media_type'] in ('movie', 'show', 'season', 'episode', 'artist', 'album', 'track', 'collection'):