🚧 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 {
|
func SetFile(path string) media.Probe {
|
||||||
f := media.ProbeFile(path)
|
f := media.ProbeFile(path)
|
||||||
file = &f
|
file = &f
|
||||||
|
copyTagsFromFile()
|
||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
17
app/print.go
17
app/print.go
|
|
@ -52,8 +52,21 @@ func print() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
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 recs []list.Option
|
||||||
var rec brainz.Recording
|
var rec brainz.Recording
|
||||||
|
var err error
|
||||||
i := 1
|
i := 1
|
||||||
for _, res := range ids.Results {
|
for _, res := range ids.Results {
|
||||||
for _, rec = range res.Recordings {
|
for _, rec = range res.Recordings {
|
||||||
|
|
@ -66,7 +79,5 @@ func print() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rec = list.List("Which recording is the correct one?", recs, nil).(recOpt).rec
|
return list.List("Which recording is the correct one?", recs, nil).(recOpt).rec
|
||||||
|
|
||||||
fmt.Printf("%+v\n", rec.Title)
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,8 @@ func testMb() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func testPrint() {
|
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()
|
print()
|
||||||
|
|
||||||
quit()
|
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"`
|
MusicbrainzReleaseGroupId uuid.UUID `json:"MUSICBRAINZ_RELEASEGROUPID"`
|
||||||
MusicbrainzAlbumId uuid.UUID `json:"MUSICBRAINZ_ALBUMID"`
|
MusicbrainzAlbumId uuid.UUID `json:"MUSICBRAINZ_ALBUMID"`
|
||||||
MusicbrainzAlbumArtistId uuid.UUID `json:"MUSICBRAINZ_ALBUMARTISTID"`
|
MusicbrainzAlbumArtistId uuid.UUID `json:"MUSICBRAINZ_ALBUMARTISTID"`
|
||||||
|
MusicbrainzRecordingId uuid.UUID
|
||||||
AlbumArtistSort string
|
AlbumArtistSort string
|
||||||
ReleaseCountry string
|
ReleaseCountry string
|
||||||
Label string
|
Label string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue