This commit is contained in:
53
internal/model/model.go
Normal file
53
internal/model/model.go
Normal file
@@ -0,0 +1,53 @@
|
||||
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"`
|
||||
Format string `json:"format"`
|
||||
BitRate int `json:"bit_rate"`
|
||||
SampleRate int `json:"sample_rate"`
|
||||
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"`
|
||||
}
|
||||
Reference in New Issue
Block a user