mirror of
https://github.com/AnimeThemes/animethemes-api-docs.git
synced 2026-07-11 01:34:06 +02:00
docs: update the new schema for performances (#128)
This commit is contained in:
@@ -205,6 +205,15 @@ const referenceSidebarItems = [
|
||||
{ text: 'Update', link: '/content/image/update/' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Performance',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: 'Resource', link: '/content/performance/' },
|
||||
{ text: 'Index', link: '/content/performance/index/' },
|
||||
{ text: 'Show', link: '/content/performance/show/' },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Resource',
|
||||
collapsed: true,
|
||||
|
||||
@@ -101,51 +101,6 @@ will return the JSON:
|
||||
}
|
||||
```
|
||||
|
||||
## Polymorphic One-to-Many
|
||||
|
||||
The relationship of polymorphic one-to-many. Applies simple pagination.
|
||||
|
||||
```graphql
|
||||
query {
|
||||
membershipPagination {
|
||||
data {
|
||||
performances {
|
||||
alias
|
||||
as
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Polymorphic inverse One-to-Many
|
||||
|
||||
The inverse type of polymorphic one-to-many.
|
||||
A union type indicates that a field might have multiple object types.
|
||||
|
||||
```graphql
|
||||
query {
|
||||
performancePagination {
|
||||
data {
|
||||
artist {
|
||||
__typename
|
||||
... on Artist {
|
||||
name
|
||||
}
|
||||
... on Membership {
|
||||
group {
|
||||
name
|
||||
}
|
||||
member {
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Polymorphic Many-to-Many
|
||||
|
||||
The polymorphic many-to-many relationship uses the same strategy as the usual [many-to-many](#many-to-many-belongstomany).
|
||||
|
||||
@@ -20,7 +20,6 @@ Affected Fields:
|
||||
* two_factor_confirmed_at -> twoFactorConfirmedAt
|
||||
* guard_name -> guardName
|
||||
* media_format -> mediaFormat
|
||||
* views_count -> viewsCount
|
||||
* external_id -> externalId
|
||||
* created_at -> createdAt
|
||||
* updated_at -> updatedAt
|
||||
@@ -30,22 +29,20 @@ Affected Fields:
|
||||
|
||||
The AnimeThemes API now introduces a new way to credit artists for songs. Each artist associated with a song is represented as a performance.
|
||||
|
||||
With this updated schema, individual group members can now be credited directly on a song, rather than only the entire group being credited. A performance can be linked either to an artist or to a membership, which represents the relationship between a group and one of its members.
|
||||
With this updated schema, individual group members can now be credited directly on a song, rather than only the entire group being credited.
|
||||
|
||||
While you can retrieve all performances for a song through the `performances` relationship, the structure differs when viewed from the artist’s side.
|
||||
|
||||
For groups, their performances are typically available through the `groupships.performances` relationship. You may want to deduplicate the performances by the song's id, because it returns the information for each membership.
|
||||
Usual performances are typically available through the `performances` relationship. You may want to deduplicate the performances by the song's id, because it returns the information for each group-member relation.
|
||||
|
||||
For a solo artist, you can access their performances via the performances relationship. If you want to retrieve the performances the artist participated in as part of a group, use the `memberships.performances` relationship.
|
||||
If an artist is performing a song as part of a group, use the `memberPerformances` relationship.
|
||||
|
||||
For more information, see the [wiki section on performances and memberships](https://animethemes.moe/wiki/guidelines/contribution#performances-and-memberships).
|
||||
Ideally you should use both and connect them on your code.
|
||||
|
||||
For more information, see the [wiki section on performances](https://animethemes.moe/wiki/guidelines/contribution#performances).
|
||||
|
||||
## From Group to ThemeGroup
|
||||
|
||||
It is easy to confuse what a group is. They can be a group of animethemes (e.g. "English Version") or a group of artists (e.g. "Aqours").
|
||||
|
||||
The `group` query/type does not exist. For a group of animethemes, the query is `themegroupPagination`. For a group of artists, they are included globally in the `artistPagination` query.
|
||||
|
||||
## Views Count Field Deprecated
|
||||
|
||||
The `viewsCount` field is now deprecated as we no longer track resource views, instead, we monitor popular songs based on their presence in playlists. Furthermore, there are plans to track popular songs using their likes count.
|
||||
The `group` query/type does not exist. For a group of animethemes, the query is `themegroupPagination`. For a group of artists, they are included globally in the `artistPagination` query.
|
||||
@@ -36,6 +36,9 @@ For example, Bakemonogatari is an anime production with five opening sequences a
|
||||
* animethemes.group
|
||||
* animethemes.song
|
||||
* animethemes.song.artists
|
||||
* animethemes.song.performances
|
||||
* animethemes.song.performances.artist
|
||||
* animethemes.song.performances.member
|
||||
* images
|
||||
* resources
|
||||
* series
|
||||
|
||||
@@ -27,6 +27,10 @@ For example, Chiwa Saitou is the musical performer of the Bakemonogatari OP1 the
|
||||
* groups
|
||||
* images
|
||||
* members
|
||||
* memberPerformances
|
||||
* memberPerformances.song
|
||||
* performances
|
||||
* performances.song
|
||||
* resources
|
||||
* songs
|
||||
* songs.animethemes
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: Performance
|
||||
---
|
||||
|
||||
# Performance
|
||||
|
||||
---
|
||||
|
||||
A performance API resource represents the association between an artist and a song.
|
||||
|
||||
## Fields
|
||||
|
||||
| Name | Type | Nullable | Default | Description |
|
||||
| :----------: | :-----: | :------: | :-----: | :---------------------------------------------------- |
|
||||
| id | Integer | No | Yes | The primary key of the resource |
|
||||
| alias | String | Yes | Yes | Used to distinguish a performance by alias |
|
||||
| as | String | Yes | Yes | Used to distinguish a performance by character |
|
||||
| member_alias | String | Yes | Yes | Used to distinguish a member performance by alias |
|
||||
| member_as | String | Yes | Yes | Used to distinguish a member performance by character |
|
||||
| relevance | Int | No | Yes | Used to sort the song performances by its relevance |
|
||||
| created_at | Date | No | No | The date that the resource was created |
|
||||
| updated_at | Date | No | No | The date that the resource was last modified |
|
||||
| deleted_at | Date | Yes | No | The date that the resource was deleted |
|
||||
|
||||
## Allowed Include Paths
|
||||
|
||||
* artist
|
||||
* member
|
||||
* song
|
||||
|
||||
## Endpoints
|
||||
|
||||
**[Performance Index](/content/performance/index/)**
|
||||
|
||||
The performance index endpoint displays a listing of performance resources.
|
||||
|
||||
**[Performance Show](/content/performance/show/)**
|
||||
|
||||
The performance show endpoint returns a performance resource.
|
||||
@@ -0,0 +1,100 @@
|
||||
---
|
||||
title: Performance Index
|
||||
---
|
||||
|
||||
# Performance Index Endpoint
|
||||
|
||||
The performance index endpoint returns a listing of performance resources.
|
||||
|
||||
## URL
|
||||
|
||||
```sh
|
||||
GET /performance/
|
||||
```
|
||||
|
||||
## Authentication
|
||||
|
||||
None
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Required | Description |
|
||||
| :----------: | :------: | :---------------------------------------------------------------------------- |
|
||||
| fields | No | Sparse fieldsets for resource types |
|
||||
| filter | No | Filters for anime resources & constraining the inclusion of related resources |
|
||||
| include | No | Inclusion of related resources |
|
||||
| page[number] | No | The page of anime resources to display |
|
||||
| page[size] | No | The number of anime resources to display for the current page |
|
||||
| q | No | The query to search for matching anime resources |
|
||||
| sort | No | The list of fields to sort the resources |
|
||||
|
||||
## Allowed Sort Fields
|
||||
|
||||
| Name | Description |
|
||||
| :----------: | :------------------------------------------------------------------------- |
|
||||
| id | Sort resources on the primary key |
|
||||
| alias | Sort resources on distinguishing label for performance by alias |
|
||||
| as | Sort resources on distinguishing label for performance by character |
|
||||
| member_alias | Sort resources on distinguishing label for performance by member alias |
|
||||
| member_as | Sort resources on distinguishing label for performance by member character |
|
||||
| relevance | Sort resources on distinguishing label for performance by relevance |
|
||||
| created_at | Sort resources on the resource creation date |
|
||||
| updated_at | Sort resources on the resource last modified date |
|
||||
| deleted_at | Sort resources on the resource deletion date |
|
||||
| random | Sort resources randomly. Ignored if other sort fields are provided. |
|
||||
|
||||
## Filters
|
||||
|
||||
| Name | Description |
|
||||
| :----------: | :----------------------------------------------------------------- |
|
||||
| id | Filter resources on the primary key |
|
||||
| alias | Filter resources on the alias of the performance |
|
||||
| as | Filter resources on the character of the performance |
|
||||
| member_alias | Filter resources on the member alias of the performance |
|
||||
| member_as | Filter resources on the member character of the performance |
|
||||
| relevance | Filter resources on the relevance of the performance |
|
||||
| created_at | Filter resources on the resource creation date |
|
||||
| updated_at | Filter resources on the resource last modified date |
|
||||
| deleted_at | Filter resources on the resource deletion date |
|
||||
| trashed | Filter resources on trashed (deleted) status [With, Without, Only] |
|
||||
| has | Filter resources on relations within allowed include paths |
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
{
|
||||
performances: [
|
||||
{
|
||||
id: id,
|
||||
alias: "alias",
|
||||
as: "as",
|
||||
member_alias: "member_alias",
|
||||
member_as: "member_as",
|
||||
relevance: relevance,
|
||||
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/performance/
|
||||
```
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
title: Performance Show
|
||||
---
|
||||
|
||||
# Performance Show Endpoint
|
||||
|
||||
The performance show endpoint returns a performance resource.
|
||||
|
||||
For example, the `/performance/3373` endpoint will return the performance resource for the X performance.
|
||||
|
||||
## URL
|
||||
|
||||
```sh
|
||||
GET /performance/{id}
|
||||
```
|
||||
|
||||
## Authentication
|
||||
|
||||
None
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Required | Description |
|
||||
| :-----: | :------: | :------------------------------------------------------ |
|
||||
| fields | No | Sparse fieldsets for resource types |
|
||||
| filter | No | Filters to constrain the inclusion of related resources |
|
||||
| include | No | Inclusion of related resources |
|
||||
| sort | No | Sort related resources |
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
{
|
||||
performance: {
|
||||
id: id,
|
||||
alias: "alias",
|
||||
as: "as",
|
||||
member_alias: "member_alias",
|
||||
member_as: "member_as",
|
||||
relevance: relevance,
|
||||
created_at: "created_at",
|
||||
updated_at: "updated_at",
|
||||
deleted_at: "deleted_at"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```bash
|
||||
curl https://api.animethemes.moe/performance/3373
|
||||
```
|
||||
@@ -26,6 +26,9 @@ For example, Staple Stable is the song for the Bakemonogatari OP1 AnimeTheme.
|
||||
* animethemes.anime
|
||||
* animethemes.group
|
||||
* artists
|
||||
* peformances
|
||||
* performances.artist
|
||||
* performances.member
|
||||
* resources
|
||||
|
||||
## Allowed Pivots
|
||||
|
||||
Reference in New Issue
Block a user