diff options
author | waker <wakeroid@gmail.com> | 2012-05-16 19:46:20 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-05-16 19:46:20 +0200 |
commit | 44ce52f45732fa0c293da88afb384c6cbc9c8b9f (patch) | |
tree | 3b20924155f9be34125a075f317c2b789107ce6a /playlist.c | |
parent | 6782ecbe890097a47d4b2348506afba94ec4ad05 (diff) |
added filename handling to search_process
Diffstat (limited to 'playlist.c')
-rw-r--r-- | playlist.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -3543,9 +3543,20 @@ plt_search_process (playlist_t *playlist, const char *text) { if (*text) { DB_metaInfo_t *m = NULL; for (m = it->meta; m; m = m->next) { - if (m->key[0] == ':' || m->key[0] == '_' || m->key[0] == '!') { + int is_uri = !strcmp (m->key, ":URI"); + if ((m->key[0] == ':' && !is_uri) || m->key[0] == '_' || m->key[0] == '!') { break; } + const char *value = m->value; + if (is_uri) { + value = strrchr (value, '/'); + if (value) { + value++; + } + else { + value = m->value; + } + } if (strcasecmp(m->key, "cuesheet") && strcasecmp (m->key, "log")) { char cmp = *(m->value-1); @@ -3565,8 +3576,8 @@ plt_search_process (playlist_t *playlist, const char *text) { break; } } - else if (utfcasestr_fast (m->value, lc)) { - //fprintf (stderr, "%s -> %s match (%s.%s)\n", text, m->value, pl_find_meta_raw (it, ":URI"), m->key); + else if (utfcasestr_fast (value, lc)) { + //fprintf (stderr, "%s -> %s match (%s.%s)\n", text, value, pl_find_meta_raw (it, ":URI"), m->key); // add to list it->next[PL_SEARCH] = NULL; it->prev[PL_SEARCH] = playlist->tail[PL_SEARCH]; |