handle absence of year in the metadata

This commit is contained in:
Artem Tarasov 2024-05-20 20:20:56 +02:00
parent 08b401442e
commit 10aeeb71ad
1 changed files with 8 additions and 1 deletions

View File

@ -246,7 +246,14 @@ local function worker(user_args)
local update_metadata = function(meta)
artist_widget:set_text(meta.artist)
title_widget:set_text(meta.current_song)
metadata_widget:set_text(string.format('%s (%s)\n%s (%s/%s)', meta.album, meta.year, meta.current_song, duration(meta.position), duration(meta.length)))
local s = meta.album;
if meta.year ~= nil and #meta.year == 4 then
s = s .. " (" .. meta.year .. ")"
end
s = s .. "\n" .. meta.current_song .. " (" .. duration(meta.position) .. "/" .. duration(meta.length) .. ")"
metadata_widget:set_text(s)
progress_widget.value = meta.progress
-- poor man's urldecode