56 lines
1.5 KiB
Go
56 lines
1.5 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// Library represents a music library directory.
|
|
type Library struct {
|
|
ID int `json:"id"`
|
|
Name string `json:"name"`
|
|
Path string `json:"path"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// MediaFile represents a single audio file on disk.
|
|
type MediaFile struct {
|
|
ID int `json:"id"`
|
|
Path string `json:"path"`
|
|
LibraryID int `json:"library_id"`
|
|
FileSize int64 `json:"file_size"`
|
|
FileMtimeNs int64 `json:"file_mtime_ns"`
|
|
Format string `json:"format"`
|
|
BitRate int `json:"bit_rate"`
|
|
SampleRate int `json:"sample_rate"`
|
|
LastSeenAt time.Time `json:"last_seen_at"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// Artist represents a music artist.
|
|
type Artist struct {
|
|
ID int `json:"id"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// Album represents a music album.
|
|
type Album struct {
|
|
ID int `json:"id"`
|
|
Title string `json:"title"`
|
|
ArtistID int `json:"artist_id"`
|
|
Cover string `json:"cover"`
|
|
Year int `json:"year"`
|
|
}
|
|
|
|
// Song represents a single track within an album.
|
|
type Song struct {
|
|
ID int `json:"id"`
|
|
Title string `json:"title"`
|
|
ArtistID int `json:"artist_id"`
|
|
AlbumID int `json:"album_id"`
|
|
Duration int `json:"duration"`
|
|
MediaFileID int `json:"media_file_id"`
|
|
TrackNumber int `json:"track_number"`
|
|
DiscNumber int `json:"disc_number"`
|
|
Genre string `json:"genre"`
|
|
}
|