mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -05:00
[mpd] Support search/find/count with modified-since
filter criteria
This commit is contained in:
parent
bbcf859b14
commit
0334269989
@ -192,6 +192,7 @@ static struct mpd_tagtype tagtypes[] =
|
|||||||
{ "file", NULL, NULL, NULL, MPD_TYPE_SPECIAL, -1, true, },
|
{ "file", NULL, NULL, NULL, MPD_TYPE_SPECIAL, -1, true, },
|
||||||
{ "base", NULL, NULL, NULL, MPD_TYPE_SPECIAL, -1, true, },
|
{ "base", NULL, NULL, NULL, MPD_TYPE_SPECIAL, -1, true, },
|
||||||
{ "any", NULL, NULL, NULL, MPD_TYPE_SPECIAL, -1, true, },
|
{ "any", NULL, NULL, NULL, MPD_TYPE_SPECIAL, -1, true, },
|
||||||
|
{ "modified-since", NULL, NULL, NULL, MPD_TYPE_SPECIAL, -1, true, },
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -738,6 +739,14 @@ parse_filter_window_params(int argc, char **argv, bool exact_match, struct query
|
|||||||
{
|
{
|
||||||
c1 = db_mprintf("(f.virtual_path LIKE '/%q%%')", argv[i + 1]);
|
c1 = db_mprintf("(f.virtual_path LIKE '/%q%%')", argv[i + 1]);
|
||||||
}
|
}
|
||||||
|
else if (0 == strcasecmp(tagtype->tag, "modified-since"))
|
||||||
|
{
|
||||||
|
// according to the mpd protocol specification the value can be a unix timestamp or ISO 8601
|
||||||
|
if (strchr(argv[i + 1], '-') == NULL)
|
||||||
|
c1 = db_mprintf("(f.time_modified > strftime('%%s', datetime('%q', 'unixepoch')))", argv[i + 1]);
|
||||||
|
else
|
||||||
|
c1 = db_mprintf("(f.time_modified > strftime('%%s', datetime('%q', 'utc')))", argv[i + 1]);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINTF(E_WARN, L_MPD, "Unknown special parameter '%s' will be ignored\n", tagtype->tag);
|
DPRINTF(E_WARN, L_MPD, "Unknown special parameter '%s' will be ignored\n", tagtype->tag);
|
||||||
|
Loading…
Reference in New Issue
Block a user