Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Problem filtering by year
« previous next »
  • Print
Pages: 1 [2]

Author Topic: Problem filtering by year  (Read 711 times)

Offline amachronic

  • Developer
  • Member
  • *
  • Posts: 200
Re: Problem filtering by year
« Reply #15 on: March 19, 2022, 07:02:58 AM »
Quote from: Bilgus on March 19, 2022, 12:23:14 AM
Looked at it poked at it came away with:
Above my pay grade ???
(math pays off sometimes I guess lol)

But seriously, instead of an ad-hoc operator to solve this problem (which won't address the general issue) you just need to move the "filter clauses" to a separate group.
I call them filter clauses because tagtree wants them to be filters but the tagcache can't support that.
https://github.com/Rockbox/rockbox/blob/master/apps/tagtree.c#L1486
instead of prepending them to the main clause group with tagcache_search_add_clause like tagtree is currently doing there, you can create an entirely separate clause group in the tagcache, add a new function tagcache_search_add_filter_clause to add stuff to it, and evaluate that group in addition to the main one.

I think that would mean adding another check_clauses() above the current one here
https://github.com/Rockbox/rockbox/blob/master/apps/tagcache.c#L1382
like so
Code: [Select]
            /* check filter clauses first */
            if (!check_clauses(tcs, idx, tcs->filter_clause, tcs->filter_clause_count))
                continue;
            if (!check_clauses(tcs, idx, tcs->clause, tcs->clause_count))
                continue;


That will solve the problem in this case and most simple cases. A more general solution will probably require an AST to represent the query expression and that's a lot of refactoring.
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 731
Re: Problem filtering by year
« Reply #16 on: March 19, 2022, 07:41:25 AM »
Sounds to me that you have an idea, feel free to run with it.

Edit--
Filters can only be used with entries you can point at with a seek index into a db.tcd, virtual tags and number tags dont index into a tcd file AFAIU

Further I'm unsure how you decide the users intention without adding another operator or parens

« Last Edit: March 19, 2022, 08:04:09 AM by Bilgus »
Logged

Offline amachronic

  • Developer
  • Member
  • *
  • Posts: 200
Re: Problem filtering by year
« Reply #17 on: March 19, 2022, 10:52:43 AM »
OK, I'll put this stuff on the bugtracker then so it isn't forgotten.

re. the user's intention: right now the ANDs always bind more tightly than ORs so there is no ambiguity, it's just that tagnavi docs are very unclear about this, and it is too easy to get confused. Supporting parens would be better of course, and tie in nicely with AST-based queries.
Logged

  • Print
Pages: 1 [2]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Problem filtering by year
 

  • SMF 2.0.18 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.022 seconds with 17 queries.