🚚 Moving tracks to its own subpackage
This commit is contained in:
parent
04274dc788
commit
4990b09f67
2 changed files with 35 additions and 19 deletions
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"codeberg.org/danjones000/strip-beats/config"
|
"codeberg.org/danjones000/strip-beats/config"
|
||||||
|
"codeberg.org/danjones000/strip-beats/media/tags"
|
||||||
"codeberg.org/danjones000/strip-beats/utils"
|
"codeberg.org/danjones000/strip-beats/utils"
|
||||||
"dario.cat/mergo"
|
"dario.cat/mergo"
|
||||||
"github.com/akrennmair/slice"
|
"github.com/akrennmair/slice"
|
||||||
|
|
@ -99,7 +100,7 @@ type Stream struct {
|
||||||
StartTime float64 `json:"start_time,string"`
|
StartTime float64 `json:"start_time,string"`
|
||||||
Duration float64 `json:",string"`
|
Duration float64 `json:",string"`
|
||||||
DurationTs int `json:"duration_ts"`
|
DurationTs int `json:"duration_ts"`
|
||||||
Tags Tags
|
Tags tags.Tags
|
||||||
}
|
}
|
||||||
|
|
||||||
func (st Stream) isWantedCodec() bool {
|
func (st Stream) isWantedCodec() bool {
|
||||||
|
|
@ -124,26 +125,10 @@ type Format struct {
|
||||||
Size int `json:",string"`
|
Size int `json:",string"`
|
||||||
BitRate int `json:"bit_rate,string"`
|
BitRate int `json:"bit_rate,string"`
|
||||||
Score int `json:"probe_score"`
|
Score int `json:"probe_score"`
|
||||||
Tags Tags
|
Tags tags.Tags
|
||||||
}
|
}
|
||||||
|
|
||||||
type Tags struct {
|
func (pr Probe) FullTags() tags.Tags {
|
||||||
MajorBrand string `json:"major_brand"`
|
|
||||||
Title string
|
|
||||||
Artist string
|
|
||||||
AlbumArtist string `json:"album_artist"`
|
|
||||||
Album string
|
|
||||||
Date string
|
|
||||||
Encoder string
|
|
||||||
Comment string
|
|
||||||
Description string
|
|
||||||
Composer string
|
|
||||||
Genre string
|
|
||||||
Disc string
|
|
||||||
Track string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (pr Probe) FullTags() Tags {
|
|
||||||
t := pr.Format.Tags
|
t := pr.Format.Tags
|
||||||
s := pr.WantedAudioStream()
|
s := pr.WantedAudioStream()
|
||||||
if s != nil {
|
if s != nil {
|
||||||
|
|
|
||||||
31
media/tags/tags.go
Normal file
31
media/tags/tags.go
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
package tags
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/google/uuid"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Tags struct {
|
||||||
|
MajorBrand string `json:"major_brand"`
|
||||||
|
Title string
|
||||||
|
Artist string
|
||||||
|
AlbumArtist string `json:"album_artist"`
|
||||||
|
Album string
|
||||||
|
Date string
|
||||||
|
Encoder string
|
||||||
|
Comment string
|
||||||
|
Description string
|
||||||
|
Synopsis string
|
||||||
|
Url string `json:"purl"`
|
||||||
|
AcoustidId uuid.UUID `json:"ACOUSTID_ID"`
|
||||||
|
MusicbrainzReleaseGroupId uuid.UUID `json:"MUSICBRAINZ_RELEASEGROUPID"`
|
||||||
|
MusicbrainzAlbumId uuid.UUID `json:"MUSICBRAINZ_ALBUMID"`
|
||||||
|
MusicbrainzAlbumArtistId uuid.UUID `json:"MUSICBRAINZ_ALBUMARTISTID"`
|
||||||
|
AlbumArtistSort string
|
||||||
|
ReleaseCountry string
|
||||||
|
Label string
|
||||||
|
ReleaseType string
|
||||||
|
Composer string
|
||||||
|
Genre string
|
||||||
|
Disc string
|
||||||
|
Track string
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue