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
| | |-+  Creating custom Tagcache query?
« previous next »
  • Print
Pages: [1] 2 3

Author Topic: Creating custom Tagcache query?  (Read 13027 times)

Offline afruff23

  • Member
  • *
  • Posts: 171
Creating custom Tagcache query?
« on: October 05, 2006, 05:23:32 PM »
The tagnavi.config syntax is very confusing, even with that guide in the wiki. Any help is appreciated. Thanks.

Hi, I would like to create a tagcache menu item called "Electronica". I would like it to work by adding any songs tagged with house, trance, electronica, IDM, etc. (I have many other genres, but an example consisting of more than 2 genres under this menu item will help me do the rest on my own). The menu item should be called "Electronica" as stated before. The first level should display artists. The second level should display albums. The third level should display tracks.

Also, I would like to create another tagcache menu item called "Genre Albums". This would have the first level be genres. The second level would be albums. The third level should display tracks.

Thanks again.
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Creating custom Tagcache query?
« Reply #1 on: October 06, 2006, 05:39:25 AM »
--#1--
Quote from: afruff23 on October 05, 2006, 05:23:32 PM
The tagnavi.config syntax is very confusing, even with that guide in the wiki. Any help is appreciated. Thanks.
The Wiki has not yet been updated with the V 2.0 syntax changes...
Quote
Quote from: roolku on September 24, 2006, 10:59:32 AM
When I am having more time next month I was planning to update the wiki (unless someone beats me to it).

--#2--
Quote from: afruff23 on October 05, 2006, 05:23:32 PM
Hi, I would like to create a tagcache menu item called "Electronica". I would like it to work by adding any songs tagged with house, trance, electronica, IDM, etc. (I have many other genres, but an example consisting of more than 2 genres under this menu item will help me do the rest on my own). The first level should display artists. The second level should display albums. The third level should display tracks.

I think this should work, but I haven't tested it ;)
Code: [Select]
"Electronica"  -> artist ? genre = "house" & genre = "trance" & genre = "IDM" -> album -> title = "%02d %s" tracknum title

--#3--
Quote from: afruff23 on October 05, 2006, 05:23:32 PM
Also, I would like to create another tagcache menu item called "Genre Albums". This would have the first level be genres. The second level would be albums. The third level should display tracks.

This will work:
Code: [Select]
"Genre Albums"        -> genre -> album -> title = "%02d %s" tracknum title
« Last Edit: October 06, 2006, 05:43:49 AM by bascule »
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: Creating custom Tagcache query?
« Reply #2 on: October 06, 2006, 05:59:35 AM »
Quote from: bascule on October 06, 2006, 05:39:25 AM
The Wiki has not yet been updated with the V 2.0 syntax changes...

Maybe I can find some time today...

Quote
I think this should work, but I haven't tested it ;)
Code: [Select]
"Electronica"  -> artist ? genre = "house" & genre = "trance" & genre = "IDM" -> album -> title = "%02d %s" tracknum title

Unfortunately this won't work. It should be

Quote
I think this should work, but I haven't tested it ;)
Code: [Select]
"Electronica"  -> artist ? genre = "house" | genre = "trance" | genre = "IDM" -> album -> title = "%02d %s" tracknum title

However the | (OR) operator has not been implemented (yet). Unfortunatly this is not easy to do either.

For your special case I can envision a "oneof" operator, where you supply a list of possible values e.g.

Code: [Select]
"Electronica"  -> artist ? genre oneof "house|trance|IDM" -> album -> title = "%02d %s" tracknum title

I might give it a try and make a patch to see how well it works.
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Creating custom Tagcache query?
« Reply #3 on: October 06, 2006, 06:14:36 AM »
Quote from: roolku
Unfortunately this won't work.

Of course it won't, I was forgetting my database queries logic there :)  Thanks for putting me straight. Oh well, one out of two isn't too bad.
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline ww2-

  • Member
  • *
  • Posts: 5
Re: Creating custom Tagcache query?
« Reply #4 on: October 06, 2006, 07:37:27 AM »
Quote from: roolku on October 06, 2006, 05:59:35 AM
Quote from: bascule on October 06, 2006, 05:39:25 AM
The Wiki has not yet been updated with the V 2.0 syntax changes...

Maybe I can find some time today...

Please do. =)
Logged

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: Creating custom Tagcache query?
« Reply #5 on: October 06, 2006, 09:22:27 AM »
Quote from: ww2- on October 06, 2006, 07:37:27 AM
Please do. =)

Okay, I have made a start. I think everything is covered, but it could probably do with some clarification and examples. If you find any errors please let me know (or fix them on the wiki)

Cheers
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Creating custom Tagcache query?
« Reply #6 on: October 06, 2006, 11:12:56 AM »
Thanks for that roolku, it looks pretty comprehensive to me.
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline afruff23

  • Member
  • *
  • Posts: 171
Re: Creating custom Tagcache query?
« Reply #7 on: October 06, 2006, 05:38:50 PM »
Thank you for updating the wiki. It's a bit clearer now. An "or" or "oneof" operator would be great.
Logged

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: Creating custom Tagcache query?
« Reply #8 on: October 06, 2006, 07:44:41 PM »
Quote from: afruff23 on October 06, 2006, 05:38:50 PM
Thank you for updating the wiki. It's a bit clearer now.

A pleasure.

Quote
An "or" or "oneof" operator would be great.

Here you go: http://www.rockbox.org/tracker/task/6137  :)
Logged

Offline afruff23

  • Member
  • *
  • Posts: 171
Re: Creating custom Tagcache query?
« Reply #9 on: October 06, 2006, 08:20:43 PM »
Thank you! Do you think this will ever get into CVS builds?
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Creating custom Tagcache query?
« Reply #10 on: October 07, 2006, 02:17:11 PM »
So what's all this then...?
Quote from: roolku in the TagCache Wiki
...followed by a heading (in quotes). The heading is displayed if the option is enabled in the settings...

I wondered why the menu name was mentioned twice, but I can find no such setting in the menus or a freshly-created .cfg file.

Is this done via some mysterious other config file?

I'd really like to be be able to have a title/heading for  the Tag Cache menus.
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: Creating custom Tagcache query?
« Reply #11 on: October 07, 2006, 04:56:44 PM »
Quote from: afruff23 on October 06, 2006, 08:20:43 PM
Thank you! Do you think this will ever get into CVS builds?

Your guess is as good as mine. :)
As far as I can see I haven't violated any quidelines, so it is just a case of a developer (Slasheri?) knowing about and liking it.

Quote from: bascule on October 07, 2006, 02:17:11 PM
So what's all this then...?
Quote from: roolku in the TagCache Wiki
...followed by a heading (in quotes). The heading is displayed if the option is enabled in the settings...

I wondered why the menu name was mentioned twice, but I can find no such setting in the menus or a freshly-created .cfg file.

Is this done via some mysterious other config file?

I'd really like to be be able to have a title/heading for  the Tag Cache menus.

General Settings/File View/Show Path :)

Not the most obvious setting I suppose...

Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Creating custom Tagcache query?
« Reply #12 on: October 08, 2006, 04:01:35 PM »
Quote from: roolku on October 07, 2006, 04:56:44 PM
General Settings/File View/Show Path :)

Not the most obvious setting I suppose...


No, it's not, but it works a treat... thanks!
I had always assumed that Show Path was just for the File Browser, not Tag Cache.
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: Creating custom Tagcache query?
« Reply #13 on: October 09, 2006, 07:54:35 AM »
Quote from: afruff23 on October 06, 2006, 08:20:43 PM
Thank you! Do you think this will ever get into CVS builds?

I just got the email that it has been accepted.

better go and update the wiki...
Logged

Offline afruff23

  • Member
  • *
  • Posts: 171
Re: Creating custom Tagcache query?
« Reply #14 on: October 09, 2006, 05:03:05 PM »
Thank you so much!

However, I seem to be having a prolem. I did not edit the tagnavi.config file. The changes are all in tagnavi_custom.config

This line:
Code: [Select]
"Electronica Artists" -> artist ? genre @ "Ambient|Big Beat|Breakbeat|Breaks|Electronic|House|IDM|Psychedelic|Rave|Techno|Trance|Electronica|Synthpop" -> album -> title = "%02d. %s" tracknum title

does not work. Instead, it displays ALL artists(not excluding any). Whenever you select an artist, the cursor moves back to the top of the list.

This does work however:
Code: [Select]
"A" -> artist ? genre @ "Progressive Rock|Trance" -> album -> title = "%02d. %s" tracknum title

There are no extraneous spaces or end of lines in case you are wondering.
Logged

  • Print
Pages: [1] 2 3
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Creating custom Tagcache query?
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.094 seconds with 15 queries.