docs: update model documentation and add new model files for Spotube objects

This commit is contained in:
Kingkor Roy Tirtho 2025-08-14 14:10:04 +06:00
parent fbd7b771ef
commit 858cbd17ad
18 changed files with 272 additions and 35 deletions

View File

@ -58,6 +58,7 @@ const sections: [
][] = [ ][] = [
["Get Started", "get-started/", queryCollection], ["Get Started", "get-started/", queryCollection],
["Developing Plugins", "developing-plugins/", queryCollection], ["Developing Plugins", "developing-plugins/", queryCollection],
["Models", "models/", queryCollection],
// ["Design System", "design/", queryCollection], // ["Design System", "design/", queryCollection],
// ["Tailwind Components", "tailwind/", queryCollection], // ["Tailwind Components", "tailwind/", queryCollection],
// ["Functional Components", "components/", queryMetaCollection], // ["Functional Components", "components/", queryMetaCollection],

View File

@ -43,6 +43,6 @@ class AlbumEndpoint {
| `unsave()` | Removes the specified albums from saved albums. Accepts a list of album IDs. | `void` | | `unsave()` | Removes the specified albums from saved albums. Accepts a list of album IDs. | `void` |
{/* Urls */} {/* Urls */}
[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object [SpotubePaginationResponseObject]: /docs/models/spotube-pagination-response-object
[SpotubeFullAlbumObject]: /models/spotube-full-album-object [SpotubeFullAlbumObject]: /docs/models/spotube-album-object#spotubefullalbumobject
[SpotubeFullTrackObject]: /models/spotube-full-track-object [SpotubeFullTrackObject]: /docs/models/spotube-track-object

View File

@ -50,7 +50,7 @@ class ArtistEndpoint {
| `unsave()` | Removes the specified artists from saved artists. Accepts a list of artist IDs. | `void` | | `unsave()` | Removes the specified artists from saved artists. Accepts a list of artist IDs. | `void` |
{/* Urls */} {/* Urls */}
[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object [SpotubePaginationResponseObject]: /docs/models/spotube-pagination-response-object
[SpotubeFullAlbumObject]: /models/spotube-full-album-object [SpotubeFullAlbumObject]: /docs/models/spotube-album-object#spotubefullalbumobject
[SpotubeFullArtistObject]: /models/spotube-full-artist-object [SpotubeFullArtistObject]: /docs/models/spotube-artist-object#spotubefullartistobject
[SpotubeFullTrackObject]: /models/spotube-full-track-object [SpotubeFullTrackObject]: /docs/models/spotube-track-object

View File

@ -40,9 +40,9 @@ By the way, the `Object` can be any of the following types:
- [`SpotubeFullAlbumObject`][SpotubeFullAlbumObject] - [`SpotubeFullAlbumObject`][SpotubeFullAlbumObject]
{/* Urls */} {/* Urls */}
[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object [SpotubePaginationResponseObject]: /docs/models/spotube-pagination-response-object
[SpotubeBrowseSectionObject]: /models/spotube-browse-section-object [SpotubeBrowseSectionObject]: /docs/models/spotube-browse-section-object
[SpotubeFullPlaylistObject]: /models/spotube-full-playlist-object [SpotubeFullPlaylistObject]: /docs/models/spotube-playlist-object#spotubefullplaylistobject
[SpotubeFullTrackObject]: /models/spotube-full-track-object [SpotubeFullTrackObject]: /docs/models/spotube-track-object
[SpotubeFullArtistObject]: /models/spotube-full-artist-object [SpotubeFullArtistObject]: /docs/models/spotube-artist-object#spotubefullartistobject
[SpotubeFullAlbumObject]: /models/spotube-full-album-object [SpotubeFullAlbumObject]: /docs/models/spotube-album-object#spotubefullalbumobject

View File

@ -65,10 +65,4 @@ class CorePlugin {
> Also, the `downloadUrl` it provides should be a direct binary download link (redirect is supported) for the `.smplug` file > Also, the `downloadUrl` it provides should be a direct binary download link (redirect is supported) for the `.smplug` file
{/* Urls */} {/* Urls */}
[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object
[SpotubeBrowseSectionObject]: /models/spotube-browse-section-object
[SpotubeFullPlaylistObject]: /models/spotube-full-playlist-object
[SpotubeFullTrackObject]: /models/spotube-full-track-object
[SpotubeFullArtistObject]: /models/spotube-full-artist-object
[SpotubeFullAlbumObject]: /models/spotube-full-album-object
[scrobbling_wiki]: https://en.wikipedia.org/wiki/Last.fm [scrobbling_wiki]: https://en.wikipedia.org/wiki/Last.fm

View File

@ -76,6 +76,6 @@ class PlaylistEndpoint {
| `unsave` | Removes a playlist from the user's library. | `void` | | `unsave` | Removes a playlist from the user's library. | `void` |
{/* Urls */} {/* Urls */}
[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object [SpotubePaginationResponseObject]: /docs/models/spotube-pagination-response-object
[SpotubeFullPlaylistObject]: /models/spotube-full-playlist-object [SpotubeFullPlaylistObject]: /docs/models/spotube-playlist-object#spotubefullplaylistobject
[SpotubeFullTrackObject]: /models/spotube-full-track-object [SpotubeFullTrackObject]: /docs/models/spotube-track-object

View File

@ -51,9 +51,9 @@ class SearchEndpoint {
| `playlists()` | Searches only for playlists. | [`SpotubePaginationResponseObject`][SpotubePaginationResponseObject] of [`SpotubeFullPlaylistObject`][SpotubeFullPlaylistObject] | | `playlists()` | Searches only for playlists. | [`SpotubePaginationResponseObject`][SpotubePaginationResponseObject] of [`SpotubeFullPlaylistObject`][SpotubeFullPlaylistObject] |
{/* Urls */} {/* Urls */}
[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object [SpotubePaginationResponseObject]: /docs/models/spotube-pagination-response-object
[SpotubeSearchResponseObject]: /models/spotube-search-response-object [SpotubeSearchResponseObject]: /docs/models/spotube-search-response-object
[SpotubeFullPlaylistObject]: /models/spotube-full-playlist-object [SpotubeFullPlaylistObject]: /docs/models/spotube-playlist-object#spotubefullplaylistobject
[SpotubeFullTrackObject]: /models/spotube-full-track-object [SpotubeFullTrackObject]: /docs/models/spotube-track-object
[SpotubeFullArtistObject]: /models/spotube-full-artist-object [SpotubeFullArtistObject]: /docs/models/spotube-artist-object#spotubefullartistobject
[SpotubeFullAlbumObject]: /models/spotube-full-album-object [SpotubeFullAlbumObject]: /docs/models/spotube-album-object#spotubefullalbumobject

View File

@ -40,4 +40,4 @@ class TrackEndpoint {
| `radio()` | Fetches related tracks based on specified tracks. Try to return a List of 50 tracks. | [List\<SpotubeFullTrackObject\>][SpotubeFullTrackObject] | | `radio()` | Fetches related tracks based on specified tracks. Try to return a List of 50 tracks. | [List\<SpotubeFullTrackObject\>][SpotubeFullTrackObject] |
{/* Urls */} {/* Urls */}
[SpotubeFullTrackObject]: /models/spotube-full-track-object [SpotubeFullTrackObject]: /docs/models/spotube-track-object

View File

@ -75,9 +75,9 @@ These methods are pretty self-explanatory. You need to implement them to fetch u
> in the input list. > in the input list.
{/* Links */} {/* Links */}
[SpotubeUserObject]: /models/spotube-user-object [SpotubeUserObject]: /docs/models/spotube-user-object
[SpotubePaginationResponseObject]: /models/spotube-pagination-response-object [SpotubePaginationResponseObject]: /docs/models/spotube-pagination-response-object
[SpotubeFullTrackObject]: /models/spotube-full-track-object [SpotubeFullTrackObject]: /docs/models/spotube-track-object
[SpotubeFullPlaylistObject]: /models/spotube-full-playlist-object [SpotubeFullPlaylistObject]: /docs/models/spotube-playlist-object#spotubefullplaylistobject
[SpotubeFullAlbumObject]: /models/spotube-full-album-object [SpotubeFullAlbumObject]: /docs/models/spotube-album-object#spotubefullalbumobject
[SpotubeFullArtistObject]: /models/spotube-full-artist-object [SpotubeFullArtistObject]: /docs/models/spotube-artist-object#spotubefullartistobject

View File

@ -0,0 +1,42 @@
---
layout: "layouts/DocLayout.astro"
title: Album
description: Different types of album objects used in Spotube.
order: 3
---
### SpotubeSimpleAlbumObject
Following is the structure of the `SpotubeAlbumObject`:
| Property | Type |
| ----------- | ---------------------------------------------------------------- |
| id | `string` |
| name | `string` |
| externalUri | `string` |
| images | List of [`SpotubeImageObject`][SpotubeImageObject] |
| albumType | `album`, `single` or `compilation` |
| artists | List of [`SpotubeSimpleArtistObject`][SpotubeSimpleArtistObject] |
| releaseDate | `string` (YYYY-MM-DD format) or `null` |
{/* Urls */}
### SpotubeFullAlbumObject
Following is the structure of the `SpotubeFullAlbumObject`:
| Property | Type |
| ----------- | ---------------------------------------------------------------- |
| id | `string` |
| name | `string` |
| externalUri | `string` |
| images | List of [`SpotubeImageObject`][SpotubeImageObject] |
| albumType | `album`, `single` or `compilation` |
| artists | List of [`SpotubeSimpleArtistObject`][SpotubeSimpleArtistObject] |
| releaseDate | `string` (YYYY-MM-DD format) |
| totalTracks | `number` |
| recordLabel | `string` or `null` |
{/* Urls */}
[SpotubeImageObject]: /docs/models/spotube-image-object
[SpotubeSimpleArtistObject]: /docs/models/spotube-artist-objects#spotubesimpleartistobject

View File

@ -0,0 +1,33 @@
---
layout: "layouts/DocLayout.astro"
title: Artist
description: Different types of artist objects used in Spotube.
order: 2
---
### SpotubeSimpleArtistObject
Following is the structure of the `SpotubeArtistObject`:
| Property | Type |
| ----------- | ------------------------------------------------------------ |
| id | `string` |
| name | `string` |
| externalUri | `string` |
| images | List of [`SpotubeImageObject`][SpotubeImageObject] or `null` |
### SpotubeFullArtistObject
Following is the structure of the `SpotubeFullArtistObject`:
| Property | Type |
| ----------- | ----------------------------------------------------- |
| id | `string` |
| name | `string` |
| externalUri | `string` |
| images | List of [`SpotubeImageObject`][SpotubeImageObject] or |
| followers | `number` |
| genres | List of `string` or `null` |
{/* Urls */}
[SpotubeImageObject]: /docs/models/spotube-image-object

View File

@ -0,0 +1,27 @@
---
layout: "layouts/DocLayout.astro"
title: Browse Section
description: ""
order: 7
---
Following is the structure of `SpotubeBrowseSectionObject`:
| Property | Type |
| ----------- | ---------------- |
| id | `string` |
| title | `string` |
| externalUri | `string` |
| browseMore | `boolean` |
| items | List of `Object` |
The `items` property array can contain multiple type of `Object` in it but it will always be
- [`SpotubeFullPlaylistObject`][SpotubeFullPlaylistObject]
- [`SpotubeFullAlbumObject`][SpotubeFullAlbumObject]
- [`SpotubeFullArtistObject`][SpotubeFullArtistObject]
{/* Urls */}
[SpotubeFullPlaylistObject]: /docs/models/spotube-playlist-object#spotubefullplaylistobject
[SpotubeFullAlbumObject]: /docs/models/spotube-album-object#spotubefullalbumobject
[SpotubeFullArtistObject]: /docs/models/spotube-artist-object#spotubefullartistobject

View File

@ -0,0 +1,14 @@
---
layout: "layouts/DocLayout.astro"
title: Image
description: How images are represented in Spotube.
order: 0
---
Following is the structure of the `SpotubeImageObject`:
| Property | Type |
| -------- | --------------- |
| width | `int` or `null` |
| height | `int` or `null` |
| url | `string` |

View File

@ -0,0 +1,18 @@
---
layout: "layouts/DocLayout.astro"
title: Pagination Response
description: ""
order: 8
---
`SpotubePaginationResponseObject` is generic model. The `items` property can contain any type of `Object` in it.
This is the structure of `SpotubePaginationResponseObject`:
| Property | Type |
| ---------- | ----------------------------------------------- |
| limit | `number` |
| nextOffset | `number` or `null` |
| total | `number` |
| hasMore | `boolean` |
| items | List of generic type `T` which extends `Object` |

View File

@ -0,0 +1,40 @@
---
layout: "layouts/DocLayout.astro"
title: Playlist
description: Different types of playlist objects used in Spotube.
order: 5
---
### SpotubeSimplePlaylistObject
Following is the structure of the `SpotubeSimplePlaylistObject`:
| Property | Type |
| ----------- | ------------------------------------------------------------ |
| id | `string` |
| name | `string` |
| description | `string` |
| externalUri | `string` |
| images | List of [`SpotubeImageObject`][SpotubeImageObject] or `null` |
| owner | [`SpotubeUserObject`][SpotubeUserObject] |
### SpotubeFullPlaylistObject
Following is the structure of the `SpotubeFullPlaylistObject`:
| Property | Type |
| ------------- | ------------------------------------------------------------ |
| id | `string` |
| name | `string` |
| description | `string` |
| externalUri | `string` |
| images | List of [`SpotubeImageObject`][SpotubeImageObject] or `null` |
| owner | [`SpotubeUserObject`][SpotubeUserObject] |
| collaborators | List of [`SpotubeUserObject`][SpotubeUserObject] or `null` |
| collaborative | `boolean` |
| public | `boolean` |
{/* Urls */}
[SpotubeImageObject]: /docs/models/spotube-image-object
[SpotubeUserObject]: /docs/models/spotube-simple-user-object

View File

@ -0,0 +1,21 @@
---
layout: "layouts/DocLayout.astro"
title: Search Response
description: ""
order: 6
---
Following is the structure of the `SpotubeSearchResponseObject`:
| Property | Type |
| --------- | -------------------------------------------------------------------- |
| albums | List of [`SpotubeSimpleAlbumObject`][SpotubeSimpleAlbumObject] |
| artists | List of [`SpotubeFullArtistObject`][SpotubeFullArtistObject] |
| playlists | List of [`SpotubeSimplePlaylistObject`][SpotubeSimplePlaylistObject] |
| tracks | List of [`SpotubeFullTrackObject`][SpotubeFullTrackObject] |
{/* Urls */}
[SpotubeSimpleAlbumObject]: /docs/models/spotube-album-object#spotubesimplealbumobject
[SpotubeFullArtistObject]: /docs/models/spotube-artist-object#spotubefullartistobject
[SpotubeSimplePlaylistObject]: /docs/models/spotube-playlist-object#spotubesimpleplaylistobject
[SpotubeFullTrackObject]: /docs/models/spotube-track-object

View File

@ -0,0 +1,27 @@
---
layout: "layouts/DocLayout.astro"
title: Track
description: ""
order: 4
---
Following is the structure of the `SpotubeFullTrackObject`:
| Property | Type |
| ---------------------------- | ---------------------------------------------------------------- |
| id | `string` |
| name | `string` |
| externalUri | `string` |
| artists | List of [`SpotubeSimpleArtistObject`][SpotubeSimpleArtistObject] |
| album | [`SpotubeSimpleAlbumObject`][SpotubeSimpleAlbumObject] |
| durationMs (in milliseconds) | `number` |
| explicit | `boolean` |
| [isrc][isrc_wiki] | `string` |
> `isrc` stands for International Standard Recording Code, which is a unique identifier for tracks.
> It is used to identify recordings and is often used in music distribution and royalty collection. The format is typically a 12-character alphanumeric code.
{/* Urls */}
[SpotubeSimpleArtistObject]: /docs/models/spotube-artist-objects#spotubesimpleartistobject
[SpotubeSimpleAlbumObject]: /docs/models/spotube-album-object#spotubesimplealbumobject
[isrc_wiki]: https://en.wikipedia.org/wiki/International_Standard_Recording_Code

View File

@ -0,0 +1,20 @@
---
layout: "layouts/DocLayout.astro"
title: User
description: ""
order: 1
---
Structure of the SpotubeUserObject, which is used to represent a user in Spotube returned by Spotube Plugins.
| Property | Type |
| ----------- | -------------------------------------------------- |
| id | `string` |
| name | `string` |
| externalUri | `string` |
| images | List of [`SpotubeImageObject`][SpotubeImageObject] |
> `externalUri` is a URL that points to the user's profile on the external service (e.g. Listenbrainz)
{/* Urls */}
[SpotubeImageObject]: /docs/models/spotube-image-object