Update: podcast opml endpoints

This commit is contained in:
Nicholas Wallace 2024-07-20 02:38:56 +00:00
parent 7af02ad2e2
commit eb0f5b2e1b
4 changed files with 129 additions and 33 deletions

View File

@ -58,14 +58,12 @@ paths:
404:
description: Not found
/api/podcasts/opml:
/api/podcasts/opml/parse:
post:
summary: Get feeds from OPML text
description: Parse OPML text and return an array of feeds
operationId: getFeedsFromOPMLText
tags:
- Podcasts
requestBody:
required: true
content:
application/json:
schema:
@ -73,20 +71,56 @@ paths:
properties:
opmlText:
type: string
description: The OPML text containing podcast feeds
responses:
200:
description: Successfully retrieved feeds from OPML text
'200':
description: Successfully parsed OPML text and returned feeds
content:
application/json:
schema:
type: array
items:
$ref: '../objects/mediaTypes/Podcast.yaml#/components/schemas/Podcast'
400:
description: Bad request
403:
description: Forbidden
type: object
properties:
feeds:
type: array
items:
type: object
properties:
title:
type: string
feedUrl:
type: string
'400':
description: Bad request, OPML text not provided
'403':
description: Forbidden, user is not admin
/api/podcasts/opml/create:
post:
summary: Bulk create podcasts from OPML feed URLs
operationId: bulkCreatePodcastsFromOpmlFeedUrls
requestBody:
content:
application/json:
schema:
type: object
properties:
feeds:
type: array
items:
type: string
libraryId:
$ref: '../objects/Library.yaml#/components/schemas/libraryId'
folderId:
$ref: '../objects/Folder.yaml#/components/schemas/folderId'
autoDownloadEpisodes:
$ref: '../objects/mediaTypes/Podcast.yaml#/components/schemas/autoDownloadEpisodes'
responses:
'200':
description: Successfully created podcasts from feed URLs
'400':
description: Bad request, invalid request body
'403':
description: Forbidden, user is not admin
'404':
description: Folder not found
/api/podcasts/{id}/checknew:
parameters:

View File

@ -11,6 +11,9 @@ components:
nullable: true
format: 'pod_[a-z0-9]{18}'
example: pod_o78uaoeuh78h6aoeif
autoDownloadEpisodes:
type: boolean
description: Whether episodes are automatically downloaded.
Podcast:
type: object
@ -37,8 +40,7 @@ components:
items:
$ref: '../entities/PodcastEpisode.yaml#/components/schemas/PodcastEpisode'
autoDownloadEpisodes:
type: boolean
description: Whether episodes are automatically downloaded.
$ref: '#/components/schemas/autoDownloadEpisodes'
autoDownloadSchedule:
type: string
description: The schedule for automatic episode downloads, in cron format.

View File

@ -1589,23 +1589,19 @@
}
}
},
"/api/podcasts/opml": {
"/api/podcasts/opml/parse": {
"post": {
"summary": "Get feeds from OPML text",
"description": "Parse OPML text and return an array of feeds",
"operationId": "getFeedsFromOPMLText",
"tags": [
"Podcasts"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"opmlText": {
"type": "string",
"description": "The OPML text containing podcast feeds"
"type": "string"
}
}
}
@ -1614,23 +1610,82 @@
},
"responses": {
"200": {
"description": "Successfully retrieved feeds from OPML text",
"description": "Successfully parsed OPML text and returned feeds",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Podcast"
"type": "object",
"properties": {
"feeds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"feedUrl": {
"type": "string"
}
}
}
}
}
}
}
}
},
"400": {
"description": "Bad request"
"description": "Bad request, OPML text not provided"
},
"403": {
"description": "Forbidden"
"description": "Forbidden, user is not admin"
}
}
}
},
"/api/podcasts/opml/create": {
"post": {
"summary": "Bulk create podcasts from OPML feed URLs",
"operationId": "bulkCreatePodcastsFromOpmlFeedUrls",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"feeds": {
"type": "array",
"items": {
"type": "string"
}
},
"libraryId": {
"$ref": "#/components/schemas/libraryId"
},
"folderId": {
"$ref": "#/components/schemas/folderId"
},
"autoDownloadEpisodes": {
"$ref": "#/components/schemas/autoDownloadEpisodes"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully created podcasts from feed URLs"
},
"400": {
"description": "Bad request, invalid request body"
},
"403": {
"description": "Forbidden, user is not admin"
},
"404": {
"description": "Folder not found"
}
}
}
@ -3856,6 +3911,10 @@
}
}
},
"autoDownloadEpisodes": {
"type": "boolean",
"description": "Whether episodes are automatically downloaded."
},
"Podcast": {
"type": "object",
"description": "A podcast containing multiple episodes.",
@ -3889,8 +3948,7 @@
}
},
"autoDownloadEpisodes": {
"type": "boolean",
"description": "Whether episodes are automatically downloaded."
"$ref": "#/components/schemas/autoDownloadEpisodes"
},
"autoDownloadSchedule": {
"type": "string",

View File

@ -57,8 +57,10 @@ paths:
$ref: './controllers/PodcastController.yaml#/paths/~1api~1podcasts'
/api/podcasts/feed:
$ref: './controllers/PodcastController.yaml#/paths/~1api~1podcasts~1feed'
/api/podcasts/opml:
$ref: './controllers/PodcastController.yaml#/paths/~1api~1podcasts~1opml'
/api/podcasts/opml/parse:
$ref: './controllers/PodcastController.yaml#/paths/~1api~1podcasts~1opml~1parse'
/api/podcasts/opml/create:
$ref: './controllers/PodcastController.yaml#/paths/~1api~1podcasts~1opml~1create'
/api/podcasts/{id}/checknew:
$ref: './controllers/PodcastController.yaml#/paths/~1api~1podcasts~1{id}~1checknew'
/api/podcasts/{id}/clear-queue: