Add more tracks attributes

This commit is contained in:
Deluan 2023-03-31 15:05:39 -04:00 committed by Deluan
parent 141edb881e
commit 9308127342
5 changed files with 142 additions and 276 deletions

View File

@ -440,28 +440,60 @@ components:
$ref: '#/components/schemas/TrackRelationships'
TrackAttributes:
type: object
required: [title, artist, album, albumartist, track, mimetype, duration, channels, bitrate, size]
properties:
title:
type: string
description: The title of the track
artist:
artist: # TODO: Remove
type: string
description: The name of the artist who performed the track
album:
albumartist: # TODO: Remove
type: string
description: The primary artist of the album the track belongs to.
album: # TODO Remove
type: string
description: The name of the album the track belongs to
composer:
genre: # TODO Remove
type: string
description: The name of the composer who created the track
description: The genre of the track.
track:
type: integer
description: The track number within the album.
disc:
type: integer
description: The disc number within a multi-disc album.
year:
type: integer
description: The release year of the track or album.
bpm:
type: integer
description: The beats per minute (BPM) of the track.
recording-mbid:
type: string
description: The MusicBrainz identifier for the recording of the track.
track-mbid:
type: string
description: The MusicBrainz identifier for the track.
comments:
type: string
description: Any additional comments or notes about the track.
mimetype:
type: string
description: The MIME type of the audio file.
duration:
type: number
format: float
description: The duration of the track in seconds
required:
- title
- artist
- album
- duration
channels:
type: integer
description: The number of audio channels in the track.
bitrate:
type: integer
description: The bitrate of the audio file in kilobits per second (kbps).
size:
type: integer
description: The size of the audio file in bytes.
TrackRelationships:
type: object
properties:
@ -490,8 +522,6 @@ components:
enum:
- artist
- albumArtist
- composer
- vocalist
description: The role of an artist in a track or album
Artist:
allOf:

View File

@ -1,202 +0,0 @@
openapi: "3.0.0"
info:
version: 0.3.0
title: Navidrome API
description: 'This is heavily based on Aura API: https://auraspec.readthedocs.io/en/latest/api.html'
contact:
name: Navidrome
url: https://navidrome.org
servers:
- url: /api/v2
security:
- bearerAuth: []
paths:
/server:
get:
operationId: getServerInfo
responses:
'200':
description: The responses data key maps to a resource object dictionary representing the server.
content:
application/vnd.api+json:
schema:
type: object
required: [data]
properties:
data:
$ref: '#/components/schemas/ServerInfo'
default:
description: unexpected error
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
/tracks:
get:
operationId: getTracks
parameters:
- in: query
name: limit
schema:
type: integer
minimum: 0
default: 0
responses:
'200':
description: TODO
content:
application/vnd.api+json:
schema:
type: object
required: [data]
properties:
data:
type: array
items:
$ref: '#/components/schemas/Track'
default:
description: unexpected error
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
ServerInfo:
type: object
required: [aura-version, server, server-version, auth-required, features]
properties:
aura-version:
type: string
description: The version of the AURA spec implemented.
example: "1.0.0"
server:
type: string
description: The name of the server software.
example: "navidrome"
server-version:
type: string
description: The version number of the server.
example: "0.60.0"
auth-required:
type: boolean
description: Whether the user has access to the server.
example: true
features:
type: array
description: A list of optional features the server supports.
items:
type: string
enum:
- albums
- artists
- images
JSONAPIResourceObject:
title: JSON:API Resource Object
description: |
A JSON:API-compliant resource object. An inheritable object schema that contains the basic framework of a Resource Object from the JSON:API spec.
The `attributes`, `relationship`, and `meta` properties are added, as necessary, by the inheriting schema.
type: object
required: [type, id]
properties:
type:
$ref: '#/components/schemas/JSONAPIType'
id:
$ref: '#/components/schemas/JSONAPIId'
JSONAPIType:
title: JSON:API type Member
description: |
The `type` member is used to describe resource objects that share common attributes and relationships.
Note: The type member is required in every resource object throughout requests and responses in JSON:API. There are some cases, such as when POSTing to an endpoint representing heterogeneous data, when the type could not be inferred from the endpoint. However, picking and choosing when it is required would be confusing; it would be hard to remember when it was required and when it was not. Therefore, to improve consistency and minimize confusion, type is always required.
type: string
JSONAPIId:
title: JSON:API id Member
description: Every resource object MUST contain an id member and a type member (exception-the id member is not required when the resource object originates at the client and represents a new resource to be created on the server). Within a given API, each resource objects type and id pair MUST identify a single, unique resource.
type: string
Track:
allOf:
- $ref: '#/components/schemas/JSONAPIResourceObject'
- type: object
required: [attributes]
properties:
attributes:
$ref: '#/components/schemas/TrackAttributes'
TrackAttributes:
type: object
required: [title, artist, album, albumartist, track, mimetype, duration, channels, bitrate, size]
properties:
title:
type: string
artist:
type: string
album:
type: string
albumartist:
type: string
track:
type: integer
disc:
type: integer
year:
type: integer
bpm:
type: integer
genre:
type: string
recording-mbid:
type: string
track-mbid:
type: string
comments:
type: string
mimetype:
type: string
duration:
type: number
channels:
type: integer
bitrate:
type: integer
size:
type: integer
JSONAPIErrorResponse:
title: JSON:API Resource Object
type: object
required: [errors]
properties:
errors:
type: array
items:
$ref: '#/components/schemas/JSONAPIErrorObject'
JSONAPIErrorObject:
type: object
description: 'A JSON-API error object. see: https://jsonapi.org/format/#errors'
properties:
id:
type: string
description: a unique identifier for this particular occurrence of the problem.
example: 1
status:
type: integer
description: the HTTP status code applicable to this problem, expressed as a string value.
example: 400
code:
type: string
description: an application-specific error code, expressed as a string value.
example: invalid_request
detail:
type: string
description: a human-readable explanation specific to this occurrence of the problem.
example: First name must contain at least two characters.

View File

@ -34,23 +34,23 @@ func toAPITrack(mf model.MediaFile) Track {
Type: ResourceTypeTrack,
Id: mf.ID,
Attributes: &TrackAttributes{
Album: mf.Album,
//Albumartist: mf.AlbumArtist,
Artist: mf.Artist,
//Bitrate: mf.BitRate,
//Bpm: p(mf.Bpm),
//Channels: mf.Channels,
//Comments: p(mf.Comment),
//Disc: p(mf.DiscNumber),
Duration: mf.Duration,
//Genre: p(mf.Genre),
//Mimetype: mf.ContentType(),
//RecordingMbid: p(mf.MbzTrackID),
//Size: int(mf.Size),
Title: mf.Title,
//Track: mf.TrackNumber,
//TrackMbid: p(mf.MbzReleaseTrackID),
//Year: p(mf.Year),
Album: mf.Album,
Albumartist: mf.AlbumArtist,
Artist: mf.Artist,
Bitrate: mf.BitRate,
Bpm: p(mf.Bpm),
Channels: mf.Channels,
Comments: p(mf.Comment),
Disc: p(mf.DiscNumber),
Duration: mf.Duration,
Genre: p(mf.Genre),
Mimetype: mf.ContentType(),
RecordingMbid: p(mf.MbzTrackID),
Size: int(mf.Size),
Title: mf.Title,
Track: mf.TrackNumber,
TrackMbid: p(mf.MbzReleaseTrackID),
Year: p(mf.Year),
},
Relationships: &TrackRelationships{
Albums: &[]AlbumTrackRelationship{toAlbumRelationship(mf)},

View File

@ -1250,48 +1250,52 @@ func (sh *strictHandler) GetTrack(w http.ResponseWriter, r *http.Request, trackI
// Base64 encoded, gzipped, json marshaled Swagger object
var swaggerSpec = []string{
"H4sIAAAAAAAC/+xaX4/buBH/KgRb4B5OtbdJ2gcDfdi73gVb5JJgs20eki0wlsYW7yhSISnvugsD/Rr9",
"ev0kBYfUH9uSLW+ySbPIS7KWODO/Gc4/cnTHU12UWqFyls/ueAkGCnRo6NdCSIfmR60cCEVPMrSpEaUT",
"WvEZ/5nes/magVqz0ugSjVuzNBAItWQOb92E/d3CEmcssHsXX9vrv9QUsxXICnnChef6oUKz5glXUCCf",
"8V0qnnCb5liAxyMcFhG4c2g8+T/fv7/5fub/4Ql369LzsM4IteSb5gEYA2u+2SSR/U8qs2+Fy0fr6HJw",
"DFVm2Y1wea+eGHmepmdD9TB6fqhAjt9J0g0Uw1tIHSvApfmelsTxRB0DzYNo+NwgODSvgqrHNFVVgUak",
"rcbLQO73VzFtGEFlTjNgpNiu+sstcaeZYYd2rDmye5jjKgf1cbY4rL/nfy/lifBBNH+B1t7XCyRaO9oF",
"ZCvoNBN0CR/MBPfa+Vb/AzqfvucN1YNo+8aBcffI4pbohvO4bfiepm2H7hNnOqFSWWW4r+YlSnCYMYNW",
"VyZF6902rmZCMZejf1dqZTFhFn259+vnvmgXBdgBjWqBXTV2YG4SXsISX4hCuH1gVzl6L5ujYXrByAKs",
"RMM8yYBM/+qd9Oy2zZfhAirp+OyPZwlfaFOAI4Tu6ROe8EIoUVQFn501dhPK4RJNA/HVYmFxAKOmd2yh",
"CZpQQO8OAAwEAwjvAdBq0wPtjTau3rxKOus3TCv02anQBmuHFmh7d3XCXhtciFtisV3cv/vDd6Stl4cq",
"8z2bNhmayYDShO+QG2wSXnsYOfkPkF3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XNSHflsqyNS5mxly3ONCFxNHRFm",
"U7p/IIBoSK80m5Bfc47JI2GCKDCKw9JGDReIbbBuk0mvLfX6RP6pAQrVUpn6njfCL3UFQBj2lJroylpO",
"k0QBMzbk2Vkp5IB/NDpMyBsHmWtn8hSWkFvndkjjiueptywrS6czluAcnw5kzKBNF1g6oPrtGjoyV2tH",
"3s4IhWhgBT4ggdsSFAeRABq9WWPfVKG0wCK33fPknd3TPr7Snv/QiC7r9oKeTB5NTqwjyhIEKzmd0ccT",
"1zOUzGS4tabtRl64239rCFyds5TO6HNwx8saidpXkAMdQDtl2j57sPX/iMn+AcKI2b1He6PnNw82R1M0",
"D4UOoqhfV40m6j5GO5ToYGGd50DjLV0/Ax1BgS8hRsyr386srzdeRjw6OTnqmv1Tbm8wpQaSUV6fVe6i",
"3jzaHHlxsnF6GLwZqhGEk9TQAYrf0uuIPnG2DMFobD7tPEVBksf7SfqPM9YR/fMYQaHHJviyoSpsB4kP",
"tXySYFvKrKM6Vk3v8OdZut4btQ4OWo1XRuOOETdumPFpkI2t7csgj5V2V9edjg0/FrrfLTFiJ4y8pdz2",
"QeEb/7aYPM6fnpw8GUXln8fcgwMKwkXKlzytWO7X1/lgW58Oul5z+vg9Y37PmA8zY7q+8+GkTL9lH0jO",
"rLXpBKzpnftlX9qsDxS+TN6spYUSp4f7rWROvyM+JXX6E/QHljtbw0zbK7Yh/+tcVH61pexgOHo5rzr/",
"peC///6PJpaSvIcVKVjp2v3mStevOEk5tvdMrYiCUoG220UsejeAXzvaPAfjsfygySKXMcvxRMetb/uW",
"bmh9r9yM76XR99LogZZG7q78wVRGfkt/g4WRDVVsS482TE3v8OeegujKX6x8kXqovsUJlEMe6zdSDflN",
"cHQxVN+TPaxSyHirNE+BnC+5a6QpK/l0+Yiur9f/CwAA//8K6nqbf0AAAA==",
}
// GetSwagger returns the content of the embedded swagger specification file

View File

@ -11,8 +11,6 @@ import (
const (
ArtistRoleAlbumArtist ArtistRole = "albumArtist"
ArtistRoleArtist ArtistRole = "artist"
ArtistRoleComposer ArtistRole = "composer"
ArtistRoleVocalist ArtistRole = "vocalist"
)
// Defines values for ResourceType.
@ -205,17 +203,53 @@ type TrackAttributes struct {
// Album The name of the album the track belongs to
Album string `json:"album"`
// Albumartist The primary artist of the album the track belongs to.
Albumartist string `json:"albumartist"`
// Artist The name of the artist who performed the track
Artist string `json:"artist"`
// Composer The name of the composer who created the track
Composer *string `json:"composer,omitempty"`
// Bitrate The bitrate of the audio file in kilobits per second (kbps).
Bitrate int `json:"bitrate"`
// Bpm The beats per minute (BPM) of the track.
Bpm *int `json:"bpm,omitempty"`
// Channels The number of audio channels in the track.
Channels int `json:"channels"`
// Comments Any additional comments or notes about the track.
Comments *string `json:"comments,omitempty"`
// Disc The disc number within a multi-disc album.
Disc *int `json:"disc,omitempty"`
// Duration The duration of the track in seconds
Duration float32 `json:"duration"`
// Genre The genre of the track.
Genre *string `json:"genre,omitempty"`
// Mimetype The MIME type of the audio file.
Mimetype string `json:"mimetype"`
// RecordingMbid The MusicBrainz identifier for the recording of the track.
RecordingMbid *string `json:"recording-mbid,omitempty"`
// Size The size of the audio file in bytes.
Size int `json:"size"`
// Title The title of the track
Title string `json:"title"`
// Track The track number within the album.
Track int `json:"track"`
// TrackMbid The MusicBrainz identifier for the track.
TrackMbid *string `json:"track-mbid,omitempty"`
// Year The release year of the track or album.
Year *int `json:"year,omitempty"`
}
// TrackRelationships defines model for TrackRelationships.