Skip to content

Commit

Permalink
Update Readme, allowed headers for /media endpoint
Browse files Browse the repository at this point in the history
Self-explainatory
  • Loading branch information
VaMaster committed Sep 17, 2018
1 parent b7001f9 commit 4818631
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
22 changes: 1 addition & 21 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,6 @@ def All():
else:
limit = 100

if "Type" in headers:
media_type = headers["Type"]
else:
media_type = None

Log.Debug("Here's where we fetch some stats.")
records = query_tag_stats("all", limit)
for record in records:
Expand All @@ -157,11 +152,6 @@ def Actor():
else:
limit = 100

if "Type" in headers:
media_type = headers["Type"]
else:
media_type = None

Log.Debug("Here's where we fetch some stats.")
records = query_tag_stats("actor", limit)
for record in records:
Expand All @@ -181,11 +171,6 @@ def Director():
else:
limit = 100

if "Type" in headers:
media_type = headers["Type"]
else:
media_type = None

Log.Debug("Here's where we fetch some stats.")
records = query_tag_stats("director", limit)
for record in records:
Expand All @@ -205,11 +190,6 @@ def Writer():
else:
limit = 100

if "Type" in headers:
media_type = headers["Type"]
else:
media_type = None

Log.Debug("Here's where we fetch some stats.")
records = query_tag_stats("writer", limit)
for record in records:
Expand All @@ -223,7 +203,7 @@ def Writer():
@route(PREFIX2 + '/stats/user')
def User():
mc = MediaContainer()
headers = sort_headers(["Type", "Userid", "Username", "Limit", "Device", "Title", "Duration", "Count"])
headers = sort_headers(["Type", "Userid", "Username", "Limit", "Device", "Title"])

records = query_media_stats(headers)

Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Stats.bundle

Get stats...and stuff. IDK.
Get stats...and stuff. IDK.

# Endpoints:

server/stats/ENDPOINT?X-Plex-Token=XXXXXX

Where ENDPOINT is one of
stats/user
stats/director
stats/writer
stats/genre
stats/actor
stats/all

Every endpoint accepts an X-Plex-Limit parameter in the query

And stats/user accepts any one of these (as X-Plex-...)
"Type", "Userid", "Username", "Limit", "Device", "Title"

"Type" can be any of movie/show/album/track/episode

This is under development, so refer to Contents\Code\__init__.py for
the most up-to-date list of endpoints and accepted headers for each

0 comments on commit 4818631

Please sign in to comment.