chore(tags): add the version of a track to the title tag
This commit is contained in:
@@ -98,12 +98,13 @@ func (c *Client) Run(ctx context.Context, opts Options, id string) error {
|
|||||||
return ctx.Err()
|
return ctx.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
songTitle := song.GetTitle()
|
||||||
trackProgress := fmt.Sprintf("[%d/%d]", i+1, len(songs))
|
trackProgress := fmt.Sprintf("[%d/%d]", i+1, len(songs))
|
||||||
|
|
||||||
sp := spinner.New(spinner.CharSets[14], 100*time.Millisecond)
|
sp := spinner.New(spinner.CharSets[14], 100*time.Millisecond)
|
||||||
sp.Writer = os.Stdout
|
sp.Writer = os.Stdout
|
||||||
sp.Prefix = trackProgress + " "
|
sp.Prefix = trackProgress + " "
|
||||||
sp.Suffix = fmt.Sprintf(" Downloading: %s - %s", song.Artist, song.Title)
|
sp.Suffix = fmt.Sprintf(" Downloading: %s - %s", song.Artist, songTitle)
|
||||||
sp.Start()
|
sp.Start()
|
||||||
|
|
||||||
warnings, err := c.downloadSong(ctx, resource, song, opts, resourceOutputDir)
|
warnings, err := c.downloadSong(ctx, resource, song, opts, resourceOutputDir)
|
||||||
@@ -116,13 +117,13 @@ func (c *Client) Run(ctx context.Context, opts Options, id string) error {
|
|||||||
|
|
||||||
if path, ok := IsSkipError(err); ok {
|
if path, ok := IsSkipError(err); ok {
|
||||||
skipped++
|
skipped++
|
||||||
fmt.Printf("%s ↷ Skipped: %s - %s\n Already exists at: %s\n", trackProgress, song.Artist, song.Title, path)
|
fmt.Printf("%s ↷ Skipped: %s - %s\n Already exists at: %s\n", trackProgress, song.Artist, songTitle, path)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
failed++
|
failed++
|
||||||
c.Logger.Errorf("Failed to download %s - %s: %v\n", song.Artist, song.Title, err)
|
c.Logger.Errorf("Failed to download %s - %s: %v\n", song.Artist, songTitle, err)
|
||||||
fmt.Printf("%s ✖ Failed: %s - %s:\n Error: %v\n", trackProgress, song.Artist, song.Title, err)
|
fmt.Printf("%s ✖ Failed: %s - %s:\n Error: %v\n", trackProgress, song.Artist, songTitle, err)
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -133,8 +134,8 @@ func (c *Client) Run(ctx context.Context, opts Options, id string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
downloaded++
|
downloaded++
|
||||||
c.Logger.Infof("Downloaded %s - %s\n", song.Artist, song.Title)
|
c.Logger.Infof("Downloaded %s - %s\n", song.Artist, songTitle)
|
||||||
fmt.Printf("%s %s Downloaded: %s - %s\n", trackProgress, symbol, song.Artist, song.Title)
|
fmt.Printf("%s %s Downloaded: %s - %s\n", trackProgress, symbol, song.Artist, songTitle)
|
||||||
|
|
||||||
for _, w := range warnings {
|
for _, w := range warnings {
|
||||||
c.Logger.Warnf("Warning: %s\n", w)
|
c.Logger.Warnf("Warning: %s\n", w)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ func (t *flacTagger) addTags(resource deezer.Resource, song *deezer.Song, cover
|
|||||||
}
|
}
|
||||||
|
|
||||||
t.addTag("ARTIST", strings.Join(song.Contributors.MainArtists, ", "))
|
t.addTag("ARTIST", strings.Join(song.Contributors.MainArtists, ", "))
|
||||||
t.addTag("TITLE", song.Title)
|
t.addTag("TITLE", song.GetTitle())
|
||||||
t.addTag("COMPOSER", strings.Join(song.Contributors.Composers, ", "))
|
t.addTag("COMPOSER", strings.Join(song.Contributors.Composers, ", "))
|
||||||
t.addTag("LYRICIST", strings.Join(song.Contributors.Authors, ", "))
|
t.addTag("LYRICIST", strings.Join(song.Contributors.Authors, ", "))
|
||||||
t.addTag("REPLAYGAIN_TRACK_GAIN", song.Gain)
|
t.addTag("REPLAYGAIN_TRACK_GAIN", song.Gain)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ func (t *id3v2Tagger) addTags(resource deezer.Resource, song *deezer.Song, cover
|
|||||||
}
|
}
|
||||||
|
|
||||||
t.addTag("TPE1", strings.Join(song.Contributors.MainArtists, ", "))
|
t.addTag("TPE1", strings.Join(song.Contributors.MainArtists, ", "))
|
||||||
t.addTag("TIT2", song.Title)
|
t.addTag("TIT2", song.GetTitle())
|
||||||
t.addTag("TCOM", strings.Join(song.Contributors.Composers, ", "))
|
t.addTag("TCOM", strings.Join(song.Contributors.Composers, ", "))
|
||||||
t.addTag("TEXT", strings.Join(song.Contributors.Authors, ", "))
|
t.addTag("TEXT", strings.Join(song.Contributors.Authors, ", "))
|
||||||
t.addTag("TLEN", song.Duration)
|
t.addTag("TLEN", song.Duration)
|
||||||
|
|||||||
Reference in New Issue
Block a user