mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 05:34:58 -05:00
[jsonapi] Add checks for failed playback start and return error code
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user