From 476495e5838ea7795291978cb1260002ec2c653b Mon Sep 17 00:00:00 2001 From: Adam Nielsen Date: Mon, 15 Jun 2020 02:19:36 +1000 Subject: [PATCH] OTHER: Make medialib URLs case sensitive This fixes a bug that prevents a song from ever being played again if the filename is renamed changing only the case. With this change the updated filename can be added to the medialib as a new entry. --- src/xmms/medialib.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/xmms/medialib.c b/src/xmms/medialib.c index ea9836d6a..1284e3a05 100644 --- a/src/xmms/medialib.c +++ b/src/xmms/medialib.c @@ -273,9 +273,18 @@ xmms_medialib_filter (xmms_medialib_session_t *session, s4_condition_t *cond; s4_fetchspec_t *spec; s4_resultset_t *ret; + s4_cmp_mode_t cmp; + + /* Case-sensitive keys */ + if (strcmp (filter_key, XMMS_MEDIALIB_ENTRY_PROPERTY_URL) == 0) { + cmp = S4_CMP_BINARY; + } else { + /* Everything else is case-insensitive */ + cmp = S4_CMP_CASELESS; + } cond = s4_cond_new_filter (S4_FILTER_EQUAL, filter_key, filter_val, - sourcepref, S4_CMP_CASELESS, filter_flags); + sourcepref, cmp, filter_flags); spec = s4_fetchspec_create (); s4_fetchspec_add (spec, fetch_key, sourcepref, fetch_flags);