incremental waveform generation (kind-of) working
This commit is contained in:
@@ -404,7 +404,7 @@ func formatMiscLabelStr(a *mediaprovider.AlbumWithTracks) string {
|
||||
if y := a.ReissueDate.Year; y != nil && *y > a.YearOrZero() {
|
||||
yearStr += fmt.Sprintf(" (%s %s)", lang.L("reissued"), util.FormatItemDate(a.ReissueDate))
|
||||
}
|
||||
return fmt.Sprintf("%s · %s · %s%s", yearStr, tracksMsg, discs, util.SecondsToTimeString(float64(a.Duration)))
|
||||
return fmt.Sprintf("%s · %s · %s%s", yearStr, tracksMsg, discs, util.SecondsToTimeString(a.Duration.Seconds()))
|
||||
}
|
||||
|
||||
func (s *albumPageState) Restore() Page {
|
||||
|
||||
@@ -375,7 +375,7 @@ func (a *NowPlayingPage) fetchLyrics(ctx context.Context, song *mediaprovider.Tr
|
||||
}
|
||||
}
|
||||
if lyrics == nil && a.lrcFetch != nil {
|
||||
lyrics, err = a.lrcFetch.FetchLrcLibLyrics(song.Title, song.ArtistNames[0], song.Album, song.Duration)
|
||||
lyrics, err = a.lrcFetch.FetchLrcLibLyrics(song.Title, song.ArtistNames[0], song.Album, int(song.Duration.Seconds()))
|
||||
if err != nil {
|
||||
log.Println(err.Error())
|
||||
}
|
||||
@@ -445,7 +445,7 @@ func (a *NowPlayingPage) Reload() {
|
||||
a.queueList.SetItems(a.queue)
|
||||
a.totalTime = 0.0
|
||||
for _, tr := range a.queue {
|
||||
a.totalTime += float64(tr.Metadata().Duration)
|
||||
a.totalTime += tr.Metadata().Duration.Seconds()
|
||||
}
|
||||
a.formatStatusLine()
|
||||
|
||||
@@ -546,7 +546,7 @@ func (a *NowPlayingPage) formatStatusLine() {
|
||||
|
||||
dur := 0.0
|
||||
if np := a.pm.NowPlaying(); np != nil {
|
||||
dur = float64(np.Metadata().Duration)
|
||||
dur = np.Metadata().Duration.Seconds()
|
||||
}
|
||||
statusSuffix := ""
|
||||
trackNum := 0
|
||||
|
||||
@@ -514,7 +514,7 @@ func (a *PlaylistPageHeader) formatPlaylistTrackTimeStr(p *mediaprovider.Playlis
|
||||
fallbackTracksMsg := fmt.Sprintf("%d %s", p.TrackCount, tracks)
|
||||
tracksMsg := lang.LocalizePluralKey("{{.trackCount}} tracks",
|
||||
fallbackTracksMsg, p.TrackCount, map[string]string{"trackCount": strconv.Itoa(p.TrackCount)})
|
||||
return fmt.Sprintf("%s, %s", tracksMsg, util.SecondsToTimeString(float64(p.Duration)))
|
||||
return fmt.Sprintf("%s, %s", tracksMsg, util.SecondsToTimeString(p.Duration.Seconds()))
|
||||
}
|
||||
|
||||
func (s *playlistPageState) Restore() Page {
|
||||
|
||||
Reference in New Issue
Block a user