mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 16:15:57 -05:00
[jsonapi] Add checks for failed playback start and return error code
This commit is contained in:
parent
0f4cbb3375
commit
77a19a6df9
@ -1335,6 +1335,13 @@ play_item_with_id(const char *param)
|
|||||||
ret = player_playback_start_byitem(queue_item);
|
ret = player_playback_start_byitem(queue_item);
|
||||||
free_queue_item(queue_item, 0);
|
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;
|
return HTTP_NOCONTENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1368,6 +1375,13 @@ play_item_at_position(const char *param)
|
|||||||
ret = player_playback_start_byitem(queue_item);
|
ret = player_playback_start_byitem(queue_item);
|
||||||
free_queue_item(queue_item, 0);
|
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;
|
return HTTP_NOCONTENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user