mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-04 02:16:01 -05:00
respect coding convention and changed log level
This commit is contained in:
parent
32c3b57fcd
commit
01cc83f819
@ -1439,14 +1439,14 @@ dacp_reply_playqueueedit_move(struct evhttp_request *req, struct evbuffer *evbuf
|
||||
*/
|
||||
int ret;
|
||||
|
||||
const char *editparams;
|
||||
const char *param;
|
||||
int src;
|
||||
int dst;
|
||||
|
||||
editparams = evhttp_find_header(query, "edit-params");
|
||||
if (editparams)
|
||||
param = evhttp_find_header(query, "edit-params");
|
||||
if (param)
|
||||
{
|
||||
ret = safe_atoi32(strchr(editparams, ':') + 1, &src);
|
||||
ret = safe_atoi32(strchr(param, ':') + 1, &src);
|
||||
if (ret < 0)
|
||||
{
|
||||
DPRINTF(E_LOG, L_DACP, "Invalid edit-params move-from value in playqueue-edit request\n");
|
||||
@ -1455,7 +1455,7 @@ dacp_reply_playqueueedit_move(struct evhttp_request *req, struct evbuffer *evbuf
|
||||
return;
|
||||
}
|
||||
|
||||
ret = safe_atoi32(strchr(editparams, ',') + 1, &dst);
|
||||
ret = safe_atoi32(strchr(param, ',') + 1, &dst);
|
||||
if (ret < 0)
|
||||
{
|
||||
DPRINTF(E_LOG, L_DACP, "Invalid edit-params move-to value in playqueue-edit request\n");
|
||||
@ -1481,13 +1481,13 @@ dacp_reply_playqueueedit_remove(struct evhttp_request *req, struct evbuffer *evb
|
||||
*/
|
||||
int ret;
|
||||
|
||||
const char *itemsparam;
|
||||
const char *param;
|
||||
int item_index;
|
||||
|
||||
itemsparam = evhttp_find_header(query, "items");
|
||||
if (itemsparam)
|
||||
param = evhttp_find_header(query, "items");
|
||||
if (param)
|
||||
{
|
||||
ret = safe_atoi32(itemsparam, &item_index);
|
||||
ret = safe_atoi32(param, &item_index);
|
||||
if (ret < 0)
|
||||
{
|
||||
DPRINTF(E_LOG, L_DACP, "Invalid edit-params remove item value in playqueue-edit request\n");
|
||||
|
18
src/player.c
18
src/player.c
@ -3398,22 +3398,24 @@ queue_add_next(struct player_command *cmd)
|
||||
static int
|
||||
queue_move(struct player_command *cmd)
|
||||
{
|
||||
struct player_source *ps_src = NULL;
|
||||
struct player_source *ps_dst = NULL;
|
||||
struct player_source *ps_src;
|
||||
struct player_source *ps_dst;
|
||||
int i;
|
||||
|
||||
int pos_max = MAX(cmd->arg.ps_pos[0], cmd->arg.ps_pos[1]);
|
||||
DPRINTF(E_LOG, L_PLAYER, "Move song from position %d to be next song after %d\n", cmd->arg.ps_pos[0],
|
||||
DPRINTF(E_DBG, L_PLAYER, "Move song from position %d to be next song after %d\n", cmd->arg.ps_pos[0],
|
||||
cmd->arg.ps_pos[1]);
|
||||
|
||||
struct player_source *ps_tmp = cur_playing ? cur_playing : cur_streaming;
|
||||
if (!ps_tmp)
|
||||
{
|
||||
DPRINTF(E_DBG, L_PLAYER, "Current playing/streaming song not found\n");
|
||||
DPRINTF(E_LOG, L_PLAYER, "Current playing/streaming song not found\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (i = 0; i <= pos_max; ++i)
|
||||
ps_src = NULL;
|
||||
ps_dst = NULL;
|
||||
for (i = 0; i <= pos_max; i++)
|
||||
{
|
||||
if (i == cmd->arg.ps_pos[0])
|
||||
ps_src = ps_tmp;
|
||||
@ -3465,12 +3467,12 @@ queue_remove(struct player_command *cmd)
|
||||
{
|
||||
struct player_source *ps_src = NULL;
|
||||
|
||||
DPRINTF(E_LOG, L_PLAYER, "Remove song from position %d\n", cmd->arg.ps_pos[0]);
|
||||
DPRINTF(E_DBG, L_PLAYER, "Remove song from position %d\n", cmd->arg.ps_pos[0]);
|
||||
|
||||
struct player_source *ps_tmp = cur_playing ? cur_playing : cur_streaming;
|
||||
if (!ps_tmp)
|
||||
{
|
||||
DPRINTF(E_DBG, L_PLAYER, "Current playing/streaming song not found\n");
|
||||
DPRINTF(E_LOG, L_PLAYER, "Current playing/streaming song not found\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user