From 1593a045b6c64f0918ba35166fe9c3badf7e6b95 Mon Sep 17 00:00:00 2001 From: unl0ck Date: Tue, 12 Nov 2024 20:43:02 +0000 Subject: [PATCH 1/4] Add Library ItemController --- docs/controllers/LibraryItemController.yaml | 53 +++++++++++++++++++++ docs/root.yaml | 2 + 2 files changed, 55 insertions(+) create mode 100644 docs/controllers/LibraryItemController.yaml diff --git a/docs/controllers/LibraryItemController.yaml b/docs/controllers/LibraryItemController.yaml new file mode 100644 index 0000000000..2aa562df5a --- /dev/null +++ b/docs/controllers/LibraryItemController.yaml @@ -0,0 +1,53 @@ +components: + schemas: + expanded: + type: binary + 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' \ No newline at end of file diff --git a/docs/root.yaml b/docs/root.yaml index 4d6c055db7..efb1c1b7c1 100644 --- a/docs/root.yaml +++ b/docs/root.yaml @@ -90,3 +90,5 @@ tags: description: Notifications endpoints - name: Podcasts description: Podcast endpoints + - name: LibraryItem + description: LibraryItem endpoints From b701b4c50e78a54334f5c394df0721c101cf6e07 Mon Sep 17 00:00:00 2001 From: unl0ck Date: Tue, 12 Nov 2024 20:49:43 +0000 Subject: [PATCH 2/4] fixed type --- docs/controllers/LibraryItemController.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/controllers/LibraryItemController.yaml b/docs/controllers/LibraryItemController.yaml index 2aa562df5a..1acb5dc17d 100644 --- a/docs/controllers/LibraryItemController.yaml +++ b/docs/controllers/LibraryItemController.yaml @@ -1,7 +1,7 @@ components: schemas: expanded: - type: binary + type: integer description: Whether to return Library Item Expanded instead. 0 for false, 1 for true. format: binary example: 0 From 2803f49d48ace9a2a58c83058f587119e1883688 Mon Sep 17 00:00:00 2001 From: unl0ck Date: Tue, 12 Nov 2024 20:53:27 +0000 Subject: [PATCH 3/4] fixed ref --- docs/controllers/LibraryItemController.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/controllers/LibraryItemController.yaml b/docs/controllers/LibraryItemController.yaml index 1acb5dc17d..a66acf2b41 100644 --- a/docs/controllers/LibraryItemController.yaml +++ b/docs/controllers/LibraryItemController.yaml @@ -33,17 +33,17 @@ paths: in: query description: Whether to return Library Item Expanded instead. 0 for false, 1 for true. schema: - $ref: '/components/schemas/expanded' + $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' + $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' + $ref: '#/components/schemas/episode' responses: '200': description: OK From efc33fa3690fac4986155f23d82c98bb786be179 Mon Sep 17 00:00:00 2001 From: unl0ck Date: Tue, 12 Nov 2024 21:25:32 +0000 Subject: [PATCH 4/4] added to bookBase metadata and added media to LibraryItemBase --- docs/objects/LibraryItem.yaml | 6 ++++++ docs/objects/mediaTypes/Book.yaml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/docs/objects/LibraryItem.yaml b/docs/objects/LibraryItem.yaml index 107ba9f3f9..ff0b9815e6 100644 --- a/docs/objects/LibraryItem.yaml +++ b/docs/objects/LibraryItem.yaml @@ -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. diff --git a/docs/objects/mediaTypes/Book.yaml b/docs/objects/mediaTypes/Book.yaml index ebe2b63d9d..fa7ede063e 100644 --- a/docs/objects/mediaTypes/Book.yaml +++ b/docs/objects/mediaTypes/Book.yaml @@ -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