mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-15 00:35:03 -05:00
[mpd] support "date" argument in find and search commands
This commit is contained in:
parent
2a04740ca2
commit
7f09438621
16
src/mpd.c
16
src/mpd.c
@ -2190,6 +2190,14 @@ mpd_get_query_params_find(int argc, char **argv, struct query_params *qp)
|
|||||||
else
|
else
|
||||||
c1 = sqlite3_mprintf("(f.track = %d)", num);
|
c1 = sqlite3_mprintf("(f.track = %d)", num);
|
||||||
}
|
}
|
||||||
|
else if (0 == strcasecmp(argv[i], "date"))
|
||||||
|
{
|
||||||
|
ret = safe_atou32(argv[i + 1], &num);
|
||||||
|
if (ret < 0)
|
||||||
|
c1 = sqlite3_mprintf("(f.year = 0 OR f.year IS NULL)");
|
||||||
|
else
|
||||||
|
c1 = sqlite3_mprintf("(f.year = %d)", num);
|
||||||
|
}
|
||||||
else if (i == 0 && argc == 1)
|
else if (i == 0 && argc == 1)
|
||||||
{
|
{
|
||||||
// Special case: a single token is allowed if listing albums for an artist
|
// Special case: a single token is allowed if listing albums for an artist
|
||||||
@ -2683,6 +2691,14 @@ mpd_get_query_params_search(int argc, char **argv, struct query_params *qp)
|
|||||||
else
|
else
|
||||||
c1 = sqlite3_mprintf("(f.track = %d)", num);
|
c1 = sqlite3_mprintf("(f.track = %d)", num);
|
||||||
}
|
}
|
||||||
|
else if (0 == strcasecmp(argv[i], "date"))
|
||||||
|
{
|
||||||
|
ret = safe_atou32(argv[i + 1], &num);
|
||||||
|
if (ret < 0)
|
||||||
|
c1 = sqlite3_mprintf("(f.year = 0 OR f.year IS NULL)");
|
||||||
|
else
|
||||||
|
c1 = sqlite3_mprintf("(f.year = %d)", num);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINTF(E_WARN, L_MPD, "Parameter '%s' is not supported by forked-daapd and will be ignored\n", argv[i]);
|
DPRINTF(E_WARN, L_MPD, "Parameter '%s' is not supported by forked-daapd and will be ignored\n", argv[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user