[player] Only update queue item in metadata_update_cb on changed

metadata. This avoids an unnecessary update query and queue change
notification (leading to clients requesting the unchanged queue).
This commit is contained in:
chme 2017-12-09 10:40:30 +01:00
parent 2ee02d407b
commit 0b07cff633

View File

@ -385,6 +385,9 @@ metadata_update_cb(void *arg)
goto out_free_metadata; goto out_free_metadata;
} }
// Update queue item if metadata changed
if (metadata->artist || metadata->title || metadata->album || metadata->genre || metadata->artwork_url || metadata->song_length)
{
// Since we won't be using the metadata struct values for anything else than // Since we won't be using the metadata struct values for anything else than
// this we just swap pointers // this we just swap pointers
if (metadata->artist) if (metadata->artist)
@ -406,6 +409,7 @@ metadata_update_cb(void *arg)
DPRINTF(E_LOG, L_PLAYER, "Database error while updating queue with new metadata\n"); DPRINTF(E_LOG, L_PLAYER, "Database error while updating queue with new metadata\n");
goto out_free_queueitem; goto out_free_queueitem;
} }
}
o_metadata = outputs_metadata_prepare(metadata->item_id); o_metadata = outputs_metadata_prepare(metadata->item_id);