scotty/internal/backends/funkwhale/models.go
2025-04-03 15:00:45 +02:00

87 lines
2.7 KiB
Go

/*
Copyright © 2023 Philipp Wolfer <phw@uploadedlobster.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
package funkwhale
type ListeningsResult struct {
Count int `json:"count"`
Previous string `json:"previous"`
Next string `json:"next"`
Results []Listening `json:"results"`
}
type Listening struct {
Id int `json:"int"`
User User `json:"user"`
Track Track `json:"track"`
CreationDate string `json:"creation_date"`
}
type FavoriteTracksResult struct {
Count int `json:"count"`
Previous string `json:"previous"`
Next string `json:"next"`
Results []FavoriteTrack `json:"results"`
}
type FavoriteTrack struct {
Id int `json:"int"`
User User `json:"user"`
Track Track `json:"track"`
CreationDate string `json:"creation_date"`
}
type Track struct {
Id int `json:"int"`
Artist Artist `json:"artist"`
Album Album `json:"album"`
Title string `json:"title"`
Position int `json:"position"`
DiscNumber int `json:"disc_number"`
RecordingMBID string `json:"mbid"`
Tags []string `json:"tags"`
Uploads []Upload `json:"uploads"`
}
type Artist struct {
Id int `json:"int"`
Name string `json:"name"`
ArtistMBID string `json:"mbid"`
}
type Album struct {
Id int `json:"int"`
Title string `json:"title"`
AlbumArtist Artist `json:"artist"`
ReleaseDate string `json:"release_date"`
TrackCount int `json:"track_count"`
ReleaseMBID string `json:"mbid"`
}
type User struct {
Id int `json:"int"`
UserName string `json:"username"`
}
type Upload struct {
UUID string `json:"uuid"`
Duration int `json:"duration"`
}