mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +02:00
Restructured code, moved all modules into internal
For now all modules are considered internal. This might change later
This commit is contained in:
parent
f94e0f1e85
commit
857661ebf9
76 changed files with 121 additions and 68 deletions
87
internal/backends/funkwhale/models.go
Normal file
87
internal/backends/funkwhale/models.go
Normal file
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
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"`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue