🚧 Saving tags for later writing
This commit is contained in:
parent
4990b09f67
commit
0a55d514fc
5 changed files with 35 additions and 4 deletions
|
|
@ -22,6 +22,7 @@ func PickNewFile() media.Probe {
|
|||
func SetFile(path string) media.Probe {
|
||||
f := media.ProbeFile(path)
|
||||
file = &f
|
||||
copyTagsFromFile()
|
||||
return f
|
||||
}
|
||||
|
||||
|
|
|
|||
17
app/print.go
17
app/print.go
|
|
@ -52,8 +52,21 @@ func print() {
|
|||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
rec := chooseRec(ids)
|
||||
|
||||
fmt.Println(rec.Title)
|
||||
|
||||
tags.Title = rec.Title
|
||||
tags.MusicbrainzRecordingId = rec.Id
|
||||
tags.Date = rec.FirstReleaseDate
|
||||
|
||||
fmt.Printf("%+v\n", tags)
|
||||
}
|
||||
|
||||
func chooseRec(ids media.IdResults) brainz.Recording {
|
||||
var recs []list.Option
|
||||
var rec brainz.Recording
|
||||
var err error
|
||||
i := 1
|
||||
for _, res := range ids.Results {
|
||||
for _, rec = range res.Recordings {
|
||||
|
|
@ -66,7 +79,5 @@ func print() {
|
|||
}
|
||||
}
|
||||
|
||||
rec = list.List("Which recording is the correct one?", recs, nil).(recOpt).rec
|
||||
|
||||
fmt.Printf("%+v\n", rec.Title)
|
||||
return list.List("Which recording is the correct one?", recs, nil).(recOpt).rec
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,8 @@ func testMb() {
|
|||
}
|
||||
|
||||
func testPrint() {
|
||||
SetFile("/home/drj/MyFiles/Videos/WebShows/YouTube/Dolly_Parton_-_Topic/Just_Because_I_m_a_Woman.Dolly_Parton_-_Topic.Fmv-XQerVkM.webm")
|
||||
// SetFile("/home/drj/MyFiles/Videos/WebShows/YouTube/Dolly_Parton_-_Topic/Just_Because_I_m_a_Woman.Dolly_Parton_-_Topic.Fmv-XQerVkM.webm")
|
||||
SetFile("/home/drj/MyFiles/Videos/WebShows/YouTube/Whitney_Houston/I_Will_Always_Love_You_Ultimate_Collection_Edit.Whitney_Houston.rB7z_l8mBxw.mp4")
|
||||
print()
|
||||
|
||||
quit()
|
||||
|
|
|
|||
17
app/tags.go
Normal file
17
app/tags.go
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package app
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
t "codeberg.org/danjones000/strip-beats/media/tags"
|
||||
)
|
||||
|
||||
var tags t.Tags
|
||||
|
||||
func copyTagsFromFile() {
|
||||
if file == nil {
|
||||
panic(errors.New("Missing file"))
|
||||
}
|
||||
|
||||
tags = file.FullTags()
|
||||
}
|
||||
|
|
@ -20,6 +20,7 @@ type Tags struct {
|
|||
MusicbrainzReleaseGroupId uuid.UUID `json:"MUSICBRAINZ_RELEASEGROUPID"`
|
||||
MusicbrainzAlbumId uuid.UUID `json:"MUSICBRAINZ_ALBUMID"`
|
||||
MusicbrainzAlbumArtistId uuid.UUID `json:"MUSICBRAINZ_ALBUMARTISTID"`
|
||||
MusicbrainzRecordingId uuid.UUID
|
||||
AlbumArtistSort string
|
||||
ReleaseCountry string
|
||||
Label string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue