Skip to content

Commit

Permalink
Fix: disc tag handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed May 17, 2024
1 parent 37d74e4 commit f44335a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/scripting/scripts/yt-dlp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,26 @@ else
track = track.. "/" ..x.playlist_count
end

local disc = x.disc_number or x.season_number
if disc then
disc = tostring(disc)
end

-- build metadata table
local meta = {
title = title,
artist = x.artist or x.album_artist or x.composer or
x.creator or x.channel or x.uploader or x.extractor,
album = album,
disc = tostring(x.disc_number or x.season_number),
disc = disc,
track = track,
genre = x.genre,
date = x.release_date,
comment = x.description.. ", URL: " ..uri.. ", yt-dlp extractor: " ..x.extractor
comment = string.gsub(x.description, "[\r\n]+", " ")..
" [url: " ..uri.. " | extractor: " ..x.extractor.. "]"
}

-- append result to the queue and set tags
mympd.api("MYMPD_API_QUEUE_APPEND_URI_TAGS", {uri = uri, tags = meta, play = false})
end
end

0 comments on commit f44335a

Please sign in to comment.