{"action":"created","issue":{"url":"https://api.github.com/repos/Alexey-Yakovenko/deadbeef/issues/1516","repository_url":"https://api.github.com/repos/Alexey-Yakovenko/deadbeef","labels_url":"https://api.github.com/repos/Alexey-Yakovenko/deadbeef/issues/1516/labels{/name}","comments_url":"https://api.github.com/repos/Alexey-Yakovenko/deadbeef/issues/1516/comments","events_url":"https://api.github.com/repos/Alexey-Yakovenko/deadbeef/issues/1516/events","html_url":"https://github.com/Alexey-Yakovenko/deadbeef/pull/1516","id":142808352,"number":1516,"title":"Tokenised playlist search","user":{"login":"FauxFaux","id":328180,"avatar_url":"https://avatars.githubusercontent.com/u/328180?v=3","gravatar_id":"","url":"https://api.github.com/users/FauxFaux","html_url":"https://github.com/FauxFaux","followers_url":"https://api.github.com/users/FauxFaux/followers","following_url":"https://api.github.com/users/FauxFaux/following{/other_user}","gists_url":"https://api.github.com/users/FauxFaux/gists{/gist_id}","starred_url":"https://api.github.com/users/FauxFaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FauxFaux/subscriptions","organizations_url":"https://api.github.com/users/FauxFaux/orgs","repos_url":"https://api.github.com/users/FauxFaux/repos","events_url":"https://api.github.com/users/FauxFaux/events{/privacy}","received_events_url":"https://api.github.com/users/FauxFaux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-22T23:16:48Z","updated_at":"2016-03-23T20:51:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Alexey-Yakovenko/deadbeef/pulls/1516","html_url":"https://github.com/Alexey-Yakovenko/deadbeef/pull/1516","diff_url":"https://github.com/Alexey-Yakovenko/deadbeef/pull/1516.diff","patch_url":"https://github.com/Alexey-Yakovenko/deadbeef/pull/1516.patch"},"body":"This patch changes the format of the search query, used in the \"find\" dialog.\r\n\r\nPreviously, it searched for the entire input string in any single metadata tag.\r\n\r\nNow, it tokenises the string into words, and looks for each word in each metadata tag.  Quoting is supported, as is specifying the tag to look in.\r\n\r\nExamples:\r\n\r\nsearch term | action\r\n--- | ---\r\nfoo bar | searches for \"foo\" and \"bar\" independently, so matches \"01. Bar Foo - Quux\"\r\n\"foo bar\" | searches for \"foo bar\" as a whole, like the current search, so doesn't match the above\r\nfoo \"bar baz\" | searches for \"foo\" and \"bar baz\" independently, so matches \"baz bar foo\", but not \"foo bar and baz\"\r\ntitle:foo | searches for a track with \"foo\" in the title, but doesn't look in any other metadata tag\r\ntitle:\"foo bar\" | searches for a track with \"foo bar\" in the title, but doesn't look in any other metadata tag\r\ntitle:foo bar | searches for a track with \"foo\" in the title, and \"bar\" in any metadata tag\r\n\r\nThis appears to work for me, but I'm sure there are problems.  Major things for review:\r\n\r\n * I don't understand what `cmpidx` is doing at all.\r\n * Using `strstr` to match the metadata key names is almost certainly not the best way to do it.\r\n * There's sure to be a bug in the parser for queries; there always is.\r\n * I don't understand why that code was duplicated before (or was it not?), and if the order mattered around cmpidx.  See the \"extract method\" and \"eliminate duplicated\" commits.\r\n * Where's the appropriate place to document this?\r\n\r\ngithub has done a poor attempt of displaying the diff in the pull request; please consider looking at the commits, or using a proper diff viewer.\r\n"},"comment":{"url":"https://api.github.com/repos/Alexey-Yakovenko/deadbeef/issues/comments/200539052","html_url":"https://github.com/Alexey-Yakovenko/deadbeef/pull/1516#issuecomment-200539052","issue_url":"https://api.github.com/repos/Alexey-Yakovenko/deadbeef/issues/1516","id":200539052,"user":{"login":"FauxFaux","id":328180,"avatar_url":"https://avatars.githubusercontent.com/u/328180?v=3","gravatar_id":"","url":"https://api.github.com/users/FauxFaux","html_url":"https://github.com/FauxFaux","followers_url":"https://api.github.com/users/FauxFaux/followers","following_url":"https://api.github.com/users/FauxFaux/following{/other_user}","gists_url":"https://api.github.com/users/FauxFaux/gists{/gist_id}","starred_url":"https://api.github.com/users/FauxFaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FauxFaux/subscriptions","organizations_url":"https://api.github.com/users/FauxFaux/orgs","repos_url":"https://api.github.com/users/FauxFaux/repos","events_url":"https://api.github.com/users/FauxFaux/events{/privacy}","received_events_url":"https://api.github.com/users/FauxFaux/received_events","type":"User","site_admin":false},"created_at":"2016-03-23T20:51:17Z","updated_at":"2016-03-23T20:51:17Z","body":"Debounce makes it almost usable for long queries, but hilights how annoying it is.  I experimented with bounces in the 100-300ms range: https://github.com/FauxFaux/deadbeef/commit/aafc3c996fd26e7e0f69685b7f67e8a8d39508d0"}}