diff --git a/src/mpd.c b/src/mpd.c index 706e8f3e..9c0b28ed 100644 --- a/src/mpd.c +++ b/src/mpd.c @@ -2190,6 +2190,14 @@ mpd_get_query_params_find(int argc, char **argv, struct query_params *qp) else 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) { // 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 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 { DPRINTF(E_WARN, L_MPD, "Parameter '%s' is not supported by forked-daapd and will be ignored\n", argv[i]);