mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-27 06:33:21 -05:00
[scan] Minor changes to smart pl scanner
This commit is contained in:
parent
4c86798182
commit
4b60da5fb4
@ -54,7 +54,7 @@ scan_smartpl(const char *file, time_t mtime, int dir_id)
|
||||
|
||||
ret = playlist_fill(pli, file);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
goto free_pli;
|
||||
|
||||
pli->type = PL_SMART;
|
||||
}
|
||||
@ -67,18 +67,12 @@ scan_smartpl(const char *file, time_t mtime, int dir_id)
|
||||
{
|
||||
DPRINTF(E_LOG, L_SCAN, "Error parsing smart playlist '%s'\n", file);
|
||||
free_smartpl(&smartpl, 1);
|
||||
goto error;
|
||||
goto free_pli;
|
||||
}
|
||||
|
||||
free(pli->title);
|
||||
pli->title = strdup(smartpl.title);
|
||||
|
||||
free(pli->query);
|
||||
pli->query = strdup(smartpl.query_where);
|
||||
|
||||
free(pli->query_order);
|
||||
pli->query_order = safe_strdup(smartpl.order);
|
||||
|
||||
swap_pointers(&pli->title, &smartpl.title);
|
||||
swap_pointers(&pli->query, &smartpl.query_where);
|
||||
swap_pointers(&pli->query_order, &smartpl.order);
|
||||
pli->query_limit = smartpl.limit;
|
||||
|
||||
free_smartpl(&smartpl, 1);
|
||||
@ -87,12 +81,12 @@ scan_smartpl(const char *file, time_t mtime, int dir_id)
|
||||
if (ret < 0)
|
||||
{
|
||||
DPRINTF(E_LOG, L_SCAN, "Error saving smart playlist '%s'\n", file);
|
||||
goto error;
|
||||
goto free_pli;
|
||||
}
|
||||
|
||||
DPRINTF(E_INFO, L_SCAN, "Added or updated smart playlist '%s'\n", file);
|
||||
|
||||
error:
|
||||
free_pli:
|
||||
free_pli(pli, 0);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user