mirror of
https://github.com/AnimeThemes/animethemes-api-docs.git
synced 2026-07-11 01:34:06 +02:00
feat: add playlist track adjacency endpoints (#60)
This commit is contained in:
@@ -18,7 +18,7 @@ Follow the Installation Guide in the README to ensure a functional local instanc
|
||||
|
||||
Set this repository as upstream to the forked repository.
|
||||
|
||||
`git remote add upstream https://github.com/AnimeThemes/animethemes-api-docs.git`
|
||||
`git remote add upstream git@github.com:AnimeThemes/animethemes-api-docs.git`
|
||||
|
||||
Pull upstream changes so that the local main branch is even with the upstream main branch.
|
||||
|
||||
|
||||
@@ -233,7 +233,9 @@ export default {
|
||||
{ text: 'Restore', link: '/list/playlist/track/restore/' },
|
||||
{ text: 'Show', link: '/list/playlist/track/show/' },
|
||||
{ text: 'Store', link: '/list/playlist/track/store/' },
|
||||
{ text: 'Update', link: '/list/playlist/track/update/' }
|
||||
{ text: 'Update', link: '/list/playlist/track/update/' },
|
||||
{ text: 'Forward Index', link: '/list/playlist/track/forward/' },
|
||||
{ text: 'Backward Index', link: '/list/playlist/track/backward/' }
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
---
|
||||
title: Backward Index
|
||||
---
|
||||
|
||||
# Backward Index Endpoint
|
||||
|
||||
The backward index endpoint returns a listing of tracks for the playlist in backward order.
|
||||
|
||||
## URL
|
||||
|
||||
```sh
|
||||
GET /playlist/{id}/backward
|
||||
```
|
||||
|
||||
## Authentication
|
||||
|
||||
**Required Permission**: view playlist track
|
||||
|
||||
**Other Requirements**: If the playlist is private, the user must own the playlist
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Required | Description |
|
||||
| :----------: | :------: | :------------------------------------------------------------------------------- |
|
||||
| fields | No | Sparse fieldsets for resource types |
|
||||
| include | No | Inclusion of related resources |
|
||||
| page[number] | No | The page of playlist resources to display |
|
||||
| page[size] | No | The number of playlist resources to display for the current page |
|
||||
|
||||
## Allowed Include Paths
|
||||
|
||||
* video
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
{
|
||||
tracks: [
|
||||
{
|
||||
id: id,
|
||||
created_at: "created_at",
|
||||
updated_at: "updated_at",
|
||||
deleted_at: "deleted_at"
|
||||
},
|
||||
...
|
||||
],
|
||||
links: {
|
||||
first: "first",
|
||||
last: "last",
|
||||
prev: "prev",
|
||||
next: "next"
|
||||
},
|
||||
meta: {
|
||||
current_page: current_page,
|
||||
from: from,
|
||||
path: "path",
|
||||
per_page: per_page,
|
||||
to: to
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```bash
|
||||
curl https://api.animethemes.moe/playlist/1/backward
|
||||
```
|
||||
@@ -28,7 +28,7 @@ None
|
||||
|
||||
```json
|
||||
{
|
||||
playlisttrack: {
|
||||
track: {
|
||||
id: id,
|
||||
created_at: "created_at",
|
||||
updated_at: "updated_at",
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
---
|
||||
title: Forward Index
|
||||
---
|
||||
|
||||
# Forward Index Endpoint
|
||||
|
||||
The forward index endpoint returns a listing of tracks for the playlist in forward order.
|
||||
|
||||
## URL
|
||||
|
||||
```sh
|
||||
GET /playlist/{id}/forward
|
||||
```
|
||||
|
||||
## Authentication
|
||||
|
||||
**Required Permission**: view playlist track
|
||||
|
||||
**Other Requirements**: If the playlist is private, the user must own the playlist
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Required | Description |
|
||||
| :----------: | :------: | :------------------------------------------------------------------------------- |
|
||||
| fields | No | Sparse fieldsets for resource types |
|
||||
| include | No | Inclusion of related resources |
|
||||
| page[number] | No | The page of playlist resources to display |
|
||||
| page[size] | No | The number of playlist resources to display for the current page |
|
||||
|
||||
## Allowed Include Paths
|
||||
|
||||
* video
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
{
|
||||
tracks: [
|
||||
{
|
||||
id: id,
|
||||
created_at: "created_at",
|
||||
updated_at: "updated_at",
|
||||
deleted_at: "deleted_at"
|
||||
},
|
||||
...
|
||||
],
|
||||
links: {
|
||||
first: "first",
|
||||
last: "last",
|
||||
prev: "prev",
|
||||
next: "next"
|
||||
},
|
||||
meta: {
|
||||
current_page: current_page,
|
||||
from: from,
|
||||
path: "path",
|
||||
per_page: per_page,
|
||||
to: to
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```bash
|
||||
curl https://api.animethemes.moe/playlist/1/forward
|
||||
```
|
||||
@@ -54,4 +54,12 @@ The playlist track store endpoint creates a new playlist track and returns the n
|
||||
|
||||
**[Playlist Track Update](/list/playlist/track/update/)**
|
||||
|
||||
The playlist track update endpoint updates a playlist track and returns the updated playlist track resource.
|
||||
The playlist track update endpoint updates a playlist track and returns the updated playlist track resource.
|
||||
|
||||
**[Forward Index](/list/playlist/track/forward/)**
|
||||
|
||||
The forward index endpoint returns a listing of tracks for the playlist in forward order.
|
||||
|
||||
**[Backward Index](/list/playlist/track/backward/)**
|
||||
|
||||
The backward index endpoint returns a listing of tracks for the playlist in backward order.
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
title: Playlist Index
|
||||
title: Playlist Track Index
|
||||
---
|
||||
|
||||
# Playlist Index Endpoint
|
||||
# Playlist Track Index Endpoint
|
||||
|
||||
The playlist index endpoint returns a listing of tracks for the playlist.
|
||||
The playlist track index endpoint returns a listing of tracks for the playlist.
|
||||
|
||||
## URL
|
||||
|
||||
@@ -54,7 +54,7 @@ GET /playlist/{id}/track
|
||||
|
||||
```json
|
||||
{
|
||||
playlisttracks: [
|
||||
tracks: [
|
||||
{
|
||||
id: id,
|
||||
created_at: "created_at",
|
||||
|
||||
@@ -28,7 +28,7 @@ None
|
||||
|
||||
```json
|
||||
{
|
||||
playlisttrack: {
|
||||
track: {
|
||||
id: id,
|
||||
created_at: "created_at",
|
||||
updated_at: "updated_at",
|
||||
|
||||
@@ -31,7 +31,7 @@ GET /playlist/{id}/track/{id}
|
||||
|
||||
```json
|
||||
{
|
||||
playlisttrack: {
|
||||
track: {
|
||||
id: id,
|
||||
created_at: "created_at",
|
||||
updated_at: "updated_at",
|
||||
|
||||
@@ -31,7 +31,7 @@ POST /playlist/{id}/track
|
||||
|
||||
```json
|
||||
{
|
||||
playlisttrack: {
|
||||
track: {
|
||||
id: id,
|
||||
created_at: "created_at",
|
||||
updated_at: "updated_at",
|
||||
|
||||
@@ -32,7 +32,7 @@ PUT|PATCH /playlist/{id}/track/{id}
|
||||
|
||||
```json
|
||||
{
|
||||
playlisttrack: {
|
||||
track: {
|
||||
id: id,
|
||||
created_at: "created_at",
|
||||
updated_at: "updated_at",
|
||||
|
||||
Generated
+687
-685
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -11,11 +11,11 @@
|
||||
"scripts": {
|
||||
"docs:dev": "vitepress dev docs",
|
||||
"docs:build": "vitepress build docs",
|
||||
"docs:serve": "vitepress serve docs"
|
||||
"docs:preview": "vitepress preview docs"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dotenv": "^16.0.3",
|
||||
"vitepress": "^1.0.0-alpha.28"
|
||||
"vitepress": "^1.0.0-alpha.31"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user