Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LibraryItemController #3607

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions docs/controllers/LibraryItemController.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
components:
schemas:
expanded:
type: integer
description: Whether to return Library Item Expanded instead. 0 for false, 1 for true.
format: binary
example: 0
include:
type: string
description: "A comma separated list of what to include with the library item. The options are: progress, rssfeed, authors (for books), and downloads (for podcasts). expanded must be 1 for include to have an effect."
example: progress,rssfeed,authors
episode:
type: string
description: If requesting progress for a podcast, the episode ID to get progress for.

paths:
/api/items/{id}:
parameters:
- name: id
in: path
description: The ID of the libraryItem.
required: true
schema:
$ref: '../objects/LibraryItem.yaml#/components/schemas/libraryItemId'
get:
summary: Get a library item by ID
description: Get a library item by ID
operationId: getLibraryItemById
tags:
- LibraryItem
parameters:
- name: expanded
in: query
description: Whether to return Library Item Expanded instead. 0 for false, 1 for true.
schema:
$ref: '#/components/schemas/expanded'
- name: include
in: query
description: "A comma separated list of what to include with the library item. The options are: progress, rssfeed, authors (for books), and downloads (for podcasts). expanded must be 1 for include to have an effect."
schema:
$ref: '#/components/schemas/include'
- name: episode
in: query
description: If requesting progress for a podcast, the episode ID to get progress for.
schema:
$ref: '#/components/schemas/episode'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '../objects/LibraryItem.yaml#/components/schemas/libraryItemBase'
6 changes: 6 additions & 0 deletions docs/objects/LibraryItem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ components:
type: boolean
mediaType:
$ref: './mediaTypes/media.yaml#/components/schemas/mediaType'
media:
type: object
description: The media of the library item.
oneOf:
- $ref: './mediaTypes/Book.yaml#/components/schemas/bookBase'
- $ref: './mediaTypes/Podcast.yaml#/components/schemas/Podcast'
libraryItemMinified:
type: object
description: A single item on the server, like a book or podcast. Minified media format.
Expand Down
2 changes: 2 additions & 0 deletions docs/objects/mediaTypes/Book.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ components:
type: array
items:
$ref: '../metadata/BookMetadata.yaml#/components/schemas/bookChapter'
metadata:
$ref: '../metadata/BookMetadata.yaml#/components/schemas/bookMetadataBase'
missingParts:
description: Any parts missing from the book by track index.
type: array
Expand Down
2 changes: 2 additions & 0 deletions docs/root.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,5 @@ tags:
description: Notifications endpoints
- name: Podcasts
description: Podcast endpoints
- name: LibraryItem
description: LibraryItem endpoints