Simplify function and align table values
This commit is contained in:
parent
fdb2fa92b0
commit
648f33d059
|
@ -152,22 +152,14 @@ function mpd_all.async(format, warg, callback)
|
|||
mpd_state[key] = helpers.capitalize(v)
|
||||
elseif k == "Artist" or k == "Title" or
|
||||
k == "Album" or k == "Genre" then
|
||||
if k == "Artist" then
|
||||
local current_artists = mpd_state["{Artists}"]
|
||||
if current_artists == "N/A" then
|
||||
mpd_state["{Artists}"] = v
|
||||
if k == "Artist" or k == "Genre" then
|
||||
local current_key = "{" .. k .. "s}"
|
||||
local current_state = mpd_state[current_key]
|
||||
if current_state == "N/A" then
|
||||
mpd_state[current_key] = v
|
||||
else
|
||||
mpd_state["{Artists}"] = append_with_separator(
|
||||
current_artists, v)
|
||||
end
|
||||
end
|
||||
if k == "Genre" then
|
||||
local current_generes = mpd_state["{Generes}"]
|
||||
if current_generes == "N/A" then
|
||||
mpd_state["{Generes}"] = v
|
||||
else
|
||||
mpd_state["{Generes}"] = append_with_separator(
|
||||
current_generes, v)
|
||||
mpd_state[current_key] = append_with_separator(
|
||||
current_state, v)
|
||||
end
|
||||
end
|
||||
mpd_state[key] = v
|
||||
|
|
Loading…
Reference in New Issue