Skip to content

Commit

Permalink
Organized endpoints into folders, added media statistics endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeHagar committed Feb 5, 2024
1 parent bb18cef commit 0d94adb
Show file tree
Hide file tree
Showing 42 changed files with 209 additions and 44 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
144 changes: 144 additions & 0 deletions pms/paths/statistics/media.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
get:
tags:
- Statistics
summary: Get Media Statistics
description: This will return the media statistics for the server
operationId: getStatistics
parameters:
- name: Timespan
description: |
The timespan to retrieve statistics for
the exact meaning of this parameter is not known
in: query
required: false
example: 4
responses:
"200":
description: Media Statistics
content:
application/json:
schema:
type: object
properties:
MediaContainer:
type: object
properties:
size:
type: integer
format: int32
example: 5497
Device:
type: array
items:
type: object
properties:
id:
type: integer
format: int32
example: 208
name:
type: string
example: Roku Express
platform:
type: string
example: Roku
clientIdentifier:
type: string
example: 793095d235660625108ef785cc7646e9
createdAt:
type: integer
format: int32
example: 1706470556
example:
- id: 208
name: Roku Express
platform: Roku
clientIdentifier: 793095d235660625108ef785cc7646e9
createdAt: 1706470556
Account:
type: array
items:
type: object
properties:
id:
type: integer
format: int32
example: 238960586
key:
type: string
example: /accounts/238960586
name:
type: string
example: Diane
defaultAudioLanguage:
type: string
example: en
autoSelectAudio:
type: boolean
example: true
defaultSubtitleLanguage:
type: string
example: en
subtitleMode:
type: integer
format: int32
example: 1
thumb:
type: string
example: https://plex.tv/users/50d83634246da1de/avatar?c=1707110967
example:
- id: 238960586
key: /accounts/238960586
name: Diane
defaultAudioLanguage: en
autoSelectAudio: true
defaultSubtitleLanguage: en
subtitleMode: 1
thumb: https://plex.tv/users/50d83634246da1de/avatar?c=1707110967
StatisticsMedia:
type: array
items:
type: object
properties:
accountID:
type: integer
format: int32
example: 1
deviceID:
type: integer
format: int32
example: 13
timespan:
type: integer
format: int32
example: 4
at:
type: integer
format: int32
example: 1707141600
metadataType:
type: integer
format: int32
example: 4
count:
type: integer
format: int32
example: 1
duration:
type: integer
format: int32
example: 1555
example:
- accountID: 1
deviceID: 13
timespan: 4
at: 1707141600
metadataType: 4
count: 1
duration: 1555


"400":
$ref: "../../responses/400.yaml"
"401":
$ref: "../../responses/401.yaml"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
109 changes: 65 additions & 44 deletions pms/pms-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,104 +41,128 @@ components:
name: "X-Plex-Token"

paths:

# Plex Media Server endpoints

# Colon Endpoints
# Folder: pms/paths/colon
/:
$ref: "./paths/root.yaml"
$ref: "./paths/colon/root.yaml"
/:/prefs:
$ref: "./paths/server-preferences.yaml"
$ref: "./paths/colon/prefs.yaml"
/:/scrobble:
$ref: "./paths/scrobble.yaml"
$ref: "./paths/colon/scrobble.yaml"
/:/unscrobble:
$ref: "./paths/unscrobble.yaml"
$ref: "./paths/colon/unscrobble.yaml"
/:/progress:
$ref: "./paths/progress.yaml"
$ref: "./paths/colon/progress.yaml"
/:/timeline:
$ref: "./paths/colon/timeline.yaml"

# Activities
# Folder: pms/paths/activities
/activities:
$ref: "./paths/activities.yaml"
$ref: "./paths/activities/activities.yaml"
/activities/{activityUUID}:
$ref: "./paths/activities-cancel.yaml"
$ref: "./paths/activities/cancel.yaml"

# Butler
# Folder: pms/paths/butler
/butler:
$ref: "./paths/butler.yaml"
$ref: "./paths/butler/butler.yaml"
/butler/{taskName}:
$ref: "./paths/butler-task.yaml"
$ref: "./paths/butler/task.yaml"

/clients:
$ref: "./paths/clients.yaml"
/devices:
$ref: "./paths/devices.yaml"

# Hubs
# Folder: pms/paths/hubs
/hubs:
$ref: "./paths/hubs.yaml"
$ref: "./paths/hubs/hubs.yaml"
/hubs/search:
$ref: "./paths/hubs-search.yaml"
$ref: "./paths/hubs/search.yaml"
/hubs/search/voice:
$ref: "./paths/hubs-search-voice.yaml"
$ref: "./paths/hubs/search-voice.yaml"
/hubs/sections/{sectionId}:
$ref: "./paths/hubs-section.yaml"
$ref: "./paths/hubs/section.yaml"

/identity:
$ref: "./paths/identity.yaml"

# Library
# Folder: pms/paths/library
/library/hashes:
$ref: "./paths/library-hashes.yaml"
$ref: "./paths/library/hashes.yaml"
/library/recentlyAdded:
$ref: "./paths/library-recentlyadded.yaml"
$ref: "./paths/library/recentlyadded.yaml"
/library/sections:
$ref: "./paths/libraries.yaml"
$ref: "./paths/library/libraries.yaml"
/library/sections/{sectionId}:
$ref: "./paths/library.yaml"
$ref: "./paths/library/library.yaml"
/library/sections/{sectionId}/{tag}:
$ref: "./paths/library-content.yaml"
$ref: "./paths/library/content.yaml"
/library/sections/{sectionId}/refresh:
$ref: "./paths/library-refresh.yaml"
$ref: "./paths/library/refresh.yaml"
/library/sections/{sectionId}/search:
$ref: "./paths/library-content-search.yaml"

# /library/sections/{sectionId}/common:
# $ref: "./paths/library-content-common.yaml"
# This endpoint seems to be busted

$ref: "./paths/library/content-search.yaml"
/library/metadata/{ratingKey}:
$ref: "./paths/metadata.yaml"
$ref: "./paths/library/metadata.yaml"
/library/metadata/{ratingKey}/children:
$ref: "./paths/metadata-children.yaml"
$ref: "./paths/library/metadata-children.yaml"
/library/onDeck:
$ref: "./paths/library-ondeck.yaml"
$ref: "./paths/library/ondeck.yaml"

# Logs
# Folder: pms/paths/logs
/log:
$ref: "./paths/log.yaml"
$ref: "./paths/log/log.yaml"
/log/networked:
$ref: "./paths/log-networked.yaml"
$ref: "./paths/log/networked.yaml"

/myplex/account:
$ref: "./paths/myplex-account.yaml"

/photo/:/transcode:
$ref: "./paths/photo-transcode.yaml"

# Pins
# Folder: pms/paths/pins
/pins:
$ref: "./paths/pins.yaml"
$ref: "./paths/pins/pins.yaml"
/pins/{pinID}:
$ref: "./paths/pins-id.yaml"
$ref: "./paths/pins/pins-id.yaml"

# Playlists
# Folder: pms/paths/playlists
/playlists:
$ref: "./paths/playlists.yaml"
$ref: "./paths/playlists/playlists.yaml"
/playlists/{playlistID}:
$ref: "./paths/playlist-id.yaml"
$ref: "./paths/playlists/id.yaml"
/playlists/{playlistID}/items:
$ref: "./paths/playlist-contents.yaml"
$ref: "./paths/playlists/contents.yaml"
/playlists/upload:
$ref: "./paths/playlist-upload.yaml"
$ref: "./paths/playlists/upload.yaml"

/search:
$ref: "./paths/search.yaml"

# Security
# Folder: pms/paths/security
/security/token:
$ref: "./paths/security-token.yaml"
$ref: "./paths/security/token.yaml"
/security/resources:
$ref: "./paths/security-resources.yaml"
$ref: "./paths/security/resources.yaml"

/servers:
$ref: "./paths/servers.yaml"

/statistics/media:
$ref: "./paths/statistics/media.yaml"

# Status
/status/sessions:
$ref: "./paths/sessions.yaml"
/status/sessions/history/all:
Expand All @@ -150,18 +174,15 @@ paths:
$ref: "./paths/transcode-sessions-key.yaml"

/updater/status:
$ref: "./paths/updater-status.yaml"
$ref: "./paths/updater/status.yaml"
/updater/check:
$ref: "./paths/updater-check.yaml"
$ref: "./paths/updater/check.yaml"
/updater/apply:
$ref: "./paths/updater-apply.yaml"
$ref: "./paths/updater/apply.yaml"

/video/:/transcode/universal/start.mpd:
$ref: "./paths/video-transcode-universal-start.yaml"

/:/timeline:
$ref: "./paths/timeline.yaml"

tags:
- name: Activities
description: |
Expand Down

0 comments on commit 0d94adb

Please sign in to comment.