endpoints #6

Open
opened 2026-04-15 13:25:57 +02:00 by rik · 0 comments
Owner

Keep it simple. Add one endpoint /episode/add that can be used by API as well as browser. Let the API check either cookie auth or password auth.

For updates, /episode/edit endpoint which may pass missing elements.

From bash, this is easy to use, pseudocode:

#/usr/bin/env bash

# Usage ./podlite episode/add "foo" "this is an episode" "foo.mp3" (need to take audio too for keep it simple).
# Usage ./podlite edit 2 '{"title", "foo2"}'
# Usage ./podlite edit 2 file=foo.mp3 (this should add the file and then check whether unused files and remove those.)

if "$1 == add"; then
  curl -X POST /episode/add
else "$1 == modify"; then
   curl -X PUT /episode/edit
fi

The less surprising the API, the easier it will be to use.

Keep it simple. Add one endpoint `/episode/add` that can be used by API as well as browser. Let the API check either cookie auth or password auth. For updates, `/episode/edit` endpoint which may pass missing elements. From bash, this is easy to use, pseudocode: ``` #/usr/bin/env bash # Usage ./podlite episode/add "foo" "this is an episode" "foo.mp3" (need to take audio too for keep it simple). # Usage ./podlite edit 2 '{"title", "foo2"}' # Usage ./podlite edit 2 file=foo.mp3 (this should add the file and then check whether unused files and remove those.) if "$1 == add"; then curl -X POST /episode/add else "$1 == modify"; then curl -X PUT /episode/edit fi ``` The less surprising the API, the easier it will be to use.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rik/podlite#6
No description provided.