[jsonapi] Add checks for failed playback start and return error code

This commit is contained in:
chme 2019-01-01 10:15:23 +01:00
parent 0f4cbb3375
commit 77a19a6df9

View File

@ -1335,6 +1335,13 @@ play_item_with_id(const char *param)
ret = player_playback_start_byitem(queue_item);
free_queue_item(queue_item, 0);
if (ret < 0)
{
DPRINTF(E_LOG, L_WEB, "Failed to start playback from item with id '%d'\n", item_id);
return HTTP_INTERNAL;
}
return HTTP_NOCONTENT;
}
@ -1368,6 +1375,13 @@ play_item_at_position(const char *param)
ret = player_playback_start_byitem(queue_item);
free_queue_item(queue_item, 0);
if (ret < 0)
{
DPRINTF(E_LOG, L_WEB, "Failed to start playback from position '%d'\n", position);
return HTTP_INTERNAL;
}
return HTTP_NOCONTENT;
}