1
0

Oh, time.Duration works a little differently...

This commit is contained in:
Alexander Andreev 2023-10-02 03:55:17 +04:00
parent f1e2eca876
commit 9757f5f748
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -21,7 +21,7 @@ func (s *Song) ArtistTitle() string {
} }
func (s *Song) DurationString() string { func (s *Song) DurationString() string {
if s.Duration.Hours() > 0 { if s.Duration.Hours() >= 1 {
return time.UnixMilli(s.Duration.Milliseconds()).Format("15:04:05") return time.UnixMilli(s.Duration.Milliseconds()).Format("15:04:05")
} }
return time.UnixMilli(s.Duration.Milliseconds()).Format("04:05") return time.UnixMilli(s.Duration.Milliseconds()).Format("04:05")