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:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Submenus in 'New Podcasts' section?
« previous next »
  • Print
Pages: [1] 2

Author Topic: Submenus in 'New Podcasts' section?  (Read 4237 times)

Offline pdedecker

  • Member
  • *
  • Posts: 15
Submenus in 'New Podcasts' section?
« on: March 09, 2007, 01:20:14 PM »
Let's say I have added this to my Database menu:
Quote
#! rockbox/tagbrowser/2.0

# Un-listened to files sorted by duration, shortest files at the top
%format "fmt_podcast" "%08d%s (%s)" length title filename %strip = "8"
# Listened-to files sorted by playing order, most recently played at the top
%format "fmt_podcast_old" "%06d%s (%s)" lastplayed title filename %sort = "inverse" %strip = "6"

%menu_start "custom" "Podcasts"
"New Podcasts" -> title = "fmt_podcast" ? filename ~ "/podcast" & playcount == "0"
"Old Podcasts" -> title = "fmt_podcast_old" ? filename ~ "/podcast" & playcount != "0"
Can I change the code so that every show (Daily Source Code, Pacific Coast Hellway, ...) will have its own submenu in the 'New Podcasts' menu? Assume that I store every show in a different directory (for example: [root]/Podcasts/DailySourceCode/).
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Submenus in 'New Podcasts' section?
« Reply #1 on: March 09, 2007, 03:45:57 PM »
Does each show have a common tag, for example, album, that you can use to divide them by?

Otherwise, if you've got your filetree organized, why not browse by it?
Logged

Offline pdedecker

  • Member
  • *
  • Posts: 15
Re: Submenus in 'New Podcasts' section?
« Reply #2 on: March 10, 2007, 02:10:51 AM »
Because I want to seperate the new and old ones. Here's an example:

Database > Custom view... > New Podcasts > Daily Source Code > DSC #600
Database > Custom view... > New Podcasts > Pacific Coast Hellway > pch384
Database > Custom view... > New Podcasts > Pacific Coast Hellway > pch383
Database > Custom view... > Archived Podcasts > Daily Source Code > DSC #599
Database > Custom view... > Archived Podcasts > Pacific Coast Hellway > pch382
Database > Custom view... > Archived Podcasts > Pacific Coast Hellway > pch381
Database > Custom view... > Archived Podcasts > Pacific Coast Hellway > pch380
etc.

Quote
Does each show have a common tag, for example, album, that you can use to divide them by?
It might, I'll have to check that. But I was thinking of filtering them by path.
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Submenus in 'New Podcasts' section?
« Reply #3 on: March 10, 2007, 04:34:00 AM »
You can only filter the database view by using attributes of the files that are available. I'm not quite sure what criteria you are using to differentiate between New Podcasts and Archived Podcasts.

If you do it by pathname, i.e., physically moving 'Archived' podcast files to a separate folder, then you can use the filname to filter them as per ypur original example.

If the difference is that you have listened to them, then use the playcount tag.

If you let me exactly what your criteria are for differentiation, I'll try and come up with something for you...
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline pdedecker

  • Member
  • *
  • Posts: 15
Re: Submenus in 'New Podcasts' section?
« Reply #4 on: March 10, 2007, 04:49:44 AM »
Quote
If the difference is that you have listened to them, then use the playcount tag.
Yup, that's what I need.

Quote
If you let me exactly what your criteria are for differentiation, I'll try and come up with something for you...
Here's how I want my podcasts to be indexed:
Quote
IF genre = "Podcast" AND playcount == "0" AND path = "[root]/Podcasts/Daily Source Code" THEN
--> Show in Custom view... > New Podcasts > Daily Source Code

IF genre = "Podcast" AND playcount == "0" AND path = "[root]/Podcasts/Pacific Coast Hellway" THEN
--> Show in Custom view... > New Podcasts > Pacific Coast Hellway

IF genre = "Podcast" AND playcount != "0" AND path = "[root]/Podcasts/Daily Source Code" THEN
--> Show in Custom view... > Archived Podcasts > Daily Source Code

IF genre = "Podcast" AND playcount != "0" AND path = "[root]/Podcasts/Pacific Coast Hellway" THEN
--> Show in Custom view... > Archived Podcasts > Pacific Coast Hellway
Of course, I have many more podcasts that I listen to, but you get the idea. :)
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Submenus in 'New Podcasts' section?
« Reply #5 on: March 10, 2007, 01:45:28 PM »
Because you want to do it by filepath and not tag, then you will need to have a number of separate formatting strings and/or menu items. I'm not sure if that's OK.

Quote from: pdedecker on March 10, 2007, 04:49:44 AM
Of course, I have many more podcasts that I listen to, but you get the idea. :)
This is what concerns me, if you need as many formatting strings as you have different podcasts, it will be unworkable.

It would be really good to check the tagging and post back, because if they are well tagged, the job is a lot easier.

Unfortunately, I'm busy at the moment, but I will work on it...
« Last Edit: March 10, 2007, 01:47:01 PM by bascule »
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline pdedecker

  • Member
  • *
  • Posts: 15
Re: Submenus in 'New Podcasts' section?
« Reply #6 on: March 11, 2007, 04:12:22 AM »
Quote from: bascule on March 10, 2007, 01:45:28 PM
Unfortunately, I'm busy at the moment, but I will work on it...
I can understand.
Quote from: bascule on March 10, 2007, 01:45:28 PM
This is what concerns me, if you need as many formatting strings as you have different podcasts, it will be unworkable.
Actually, I use these PodShow channel feeds which combine some podcasts into one larger feed.
Quote from: bascule on March 10, 2007, 01:45:28 PM
It would be really good to check the tagging and post back, because if they are well tagged, the job is a lot easier.
I'll have to check that. I'm pretty sure that I can use the album tag to filter out the podcasts I need though.
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Submenus in 'New Podcasts' section?
« Reply #7 on: March 12, 2007, 12:07:18 PM »
Without tags, it'll be messy like this:
Code: [Select]
%menu_start "custom" "Podcasts"
"New DSC Podcasts" -> title = "fmt_podcast" ? filename ~ "/podcast/Daily Source Code" & playcount == "0"
"New Hellway Podcasts" -> title = "fmt_podcast" ? filename ~ "/podcast/Pacific Coast Hellway" & playcount == "0"
"New other Podcasts" -> title = "fmt_podcast" ? filename ~ "/podcast/other" & playcount == "0"
etc., etc...

With tags, and assuming podcast name is in the album tag and show name is in the title:
Code: [Select]
%menu_start "custom" "Podcasts"
"New Podcasts" -> album ? filename ~ "/podcast" & playcount == "0" -> title = "fmt_podcast"
"Old Podcasts" -> album ? filename ~ "/podcast" & playcount != "0" -> title = "fmt_podcast_old"
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline pdedecker

  • Member
  • *
  • Posts: 15
Re: Submenus in 'New Podcasts' section?
« Reply #8 on: March 12, 2007, 04:04:19 PM »
Can I add 'New podcasts' and 'Old podcasts' to the main menu of the database? If yes, why is this code not working:
Quote
#! rockbox/tagbrowser/2.0

"New podcasts"  ==> "newPods"
"Archived podcasts"  ==> "oldPods"

# Un-listened to files sorted by duration, shortest files at the top
%format "fmt_podcast" "%08d%s (%s)" length title filename %strip = "8"
# Listened-to files sorted by playing order, most recently played at the top
%format "fmt_podcast_old" "%06d%s (%s)" lastplayed title filename %sort = "inverse" %strip = "6"

%menu_start "newPods" "New podcasts"
"Comedy Package" -> album ? filename ~ "/Podcasts/- Comedy Package - A PodShow Channel" & playcount == "0" -> title = "fmt_podcast"
"Technology Package" -> album ? filename ~ "/Podcasts/- Technology Package - A PodShow Channel" & playcount == "0" -> title = "fmt_podcast"
"Music Package" -> album ? filename ~ "/Podcasts/- Music Package - A PodShow Channel" & playcount == "0" -> title = "fmt_podcast"

%menu_start "oldPods" "Archived podcasts"
"Comedy Package" -> album ? filename ~ "/Podcasts/- Comedy Package - A PodShow Channel" & playcount != "0" -> title = "fmt_podcast_old"
"Technology Package" -> album ? filename ~ "/Podcasts/- Technology Package - A PodShow Channel" & playcount != "0" -> title = "fmt_podcast_old"
"Music Package" -> album ? filename ~ "/Podcasts/- Music Package - A PodShow Channel" & playcount != "0" -> title = "fmt_podcast_old"
« Last Edit: March 12, 2007, 04:20:24 PM by pdedecker »
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Submenus in 'New Podcasts' section?
« Reply #9 on: March 12, 2007, 04:33:01 PM »
You can either:
Call your custom menu "custom" and it will always and only appear under the 'Custom view...' menu item. (I assume this is what you've done, as you mentioned custom view above)
or
You can make your custom menu into the root menu, replacing the original. Instructions for this are on the Wiki page. You obviously then have to have all the options you want in your custom menu, but the code could be copied from the tagnavi.config file.

EDIT: On second reading, I think you may mean that the code you posted is your whole tagnavi.config code? If it is then it will not work, as you are missing some of the required code items. Again, see the Wiki page linked in my sig - it tells you all you need to know.
« Last Edit: March 12, 2007, 04:36:08 PM by bascule »
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline pdedecker

  • Member
  • *
  • Posts: 15
Re: Submenus in 'New Podcasts' section?
« Reply #10 on: March 13, 2007, 11:53:29 AM »
Quote
You can either: (...)
I want "New podcasts" and "Archived podcasts" appear in the main menu. Is that possible?
Quote
On second reading, I think you may mean that the code you posted is your whole tagnavi.config code?
No, I didn't touch tagnavi.config. The file I posted was tagnavi_custom.config.

[Edit] I changed the file based on what I've read on that page. I don't see the menus I added on my iPod so what did I do wrong this time? These are the contents of tagnavi.config. I emptied tagnavi_custom.config for now.
Quote
#! rockbox/tagbrowser/2.0
# ^ Version header must be the first line of every file

# Tag Browser configuration file, do not edit as changes will be lost!
# Instead, you can modify "/.rockbox/tagnavi_custom.config" which will never
# get overwritten automatically.

# Basic format declarations
%format "fmt_title"       "%02d. %s" tracknum title ? tracknum > "0"
%format "fmt_title"       "%s" title
%format "fmt_mostplayed"  "(%3d) %s - %s" playcount artist title %sort = "inverse" %limit = "100"
%format "fmt_lastplayed"  "%06d%s - %s" lastplayed artist title %sort = "inverse" %limit = "99" %strip = "6"
%format "fmt_best_tracks" "%02d. %s (%3d)" tracknum title autoscore
%format "fmt_played"      "(%3d/%d) %s" autoscore playcount title
%format "fmt_score"       "(%3d) %s" autoscore title

# MANUALLY ADDED FORMATTING FOR PODCASTS
%format "fmt_podcast" "%08d%s (%s)" length title filename %strip = "8"
%format "fmt_podcast_old" "%06d%s (%s)" lastplayed title filename %sort = "inverse" %strip = "6"
# END OF EDIT

# Include our custom menu
%include "/.rockbox/tagnavi_custom.config"

#
# === Begin of "Search by..." sub menu
#

# Define the search sub menu
%menu_start "search" "Search by..."
"Artist" -> artist ? artist ~ "" -> album -> title = "fmt_title"
"Album" -> album ? album ~ "" -> title = "fmt_title"
"Title" -> title ? title ~ ""
"Filename" -> filename ? filename ~ ""
"Score" -> title = "fmt_score" ? autoscore > ""

# ^ An empy line ends the menu

#
# === Begin of main menu
#

# Define the title of the main menu
%menu_start "main" "Browse by..."
"Artist"   -> artist   -> album  -> title = "fmt_title"
"Album"    -> album    -> title = "fmt_title"
"Genre"    -> genre    -> artist -> album -> title = "fmt_title"
"Composer" -> composer -> album -> title = "fmt_title"
"Track"    -> title
"Year"     -> year ? year > "1000" & year < "2008" -> artist -> album -> title = "fmt_title"
"Search..." ==> "search"
"New podcasts" ==> "newPods"
"Archived podcasts" ==> "oldPods"
"Most played tracks" -> title = "fmt_mostplayed" ? playcount > "0"
"Last played tracks" -> title = "fmt_lastplayed" ? playcount > "0"
"Never played tracks" -> artist ? playcount == "0" -> album -> title = "fmt_title"
"Best tracks" -> artist ? playcount > "1" & autoscore > "85" -> album -> title = "fmt_best_tracks"
"List played tracks" -> title = "fmt_played" ? playcount > "0"
"Custom view..."  ==> "custom"

# START OF EDIT
%menu_start "newPods" "New podcasts"
"Comedy Package" -> album ? filename ~ "/Podcasts/- Comedy Package - A PodShow Channel" & playcount == "0" -> title = "fmt_podcast"
"Technology Package" -> album ? filename ~ "/Podcasts/- Technology Package - A PodShow Channel" & playcount == "0" -> title = "fmt_podcast"
"Music Package" -> album ? filename ~ "/Podcasts/- Music Package - A PodShow Channel" & playcount == "0" -> title = "fmt_podcast"

%menu_start "oldPods" "Archived podcasts"
"Comedy Package" -> album ? filename ~ "/Podcasts/- Comedy Package - A PodShow Channel" & playcount != "0" -> title = "fmt_podcast_old"
"Technology Package" -> album ? filename ~ "/Podcasts/- Technology Package - A PodShow Channel" & playcount != "0" -> title = "fmt_podcast_old"
"Music Package" -> album ? filename ~ "/Podcasts/- Music Package - A PodShow Channel" & playcount != "0" -> title = "fmt_podcast_old"
# END OF EDIT

# And finally set main menu as our root menu
%root_menu "main"
« Last Edit: March 13, 2007, 12:09:19 PM by pdedecker »
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Submenus in 'New Podcasts' section?
« Reply #11 on: March 13, 2007, 03:27:05 PM »
It's because the sub-menus are after the main menu in the file...

Quote from: http://www.rockbox.org/twiki/bin/view/Main/WebHome?topic=DataBase
The order of the different sections in the file is crucial because the file is interpreted whilst loading in the order in which it is written. The order should generally follow the list below. The important point is that for a line to display, all of it's contents should have previously been defined. E.g., if a main menu item points to a sub-menu, then the sub-menu must be defined in the file prior to the main menu.
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline pdedecker

  • Member
  • *
  • Posts: 15
Re: Submenus in 'New Podcasts' section?
« Reply #12 on: March 14, 2007, 01:57:23 PM »
I changed it:
Quote
#! rockbox/tagbrowser/2.0
# ^ Version header must be the first line of every file

# Tag Browser configuration file, do not edit as changes will be lost!
# Instead, you can modify "/.rockbox/tagnavi_custom.config" which will never
# get overwritten automatically.

# Basic format declarations
%format "fmt_title"       "%02d. %s" tracknum title ? tracknum > "0"
%format "fmt_title"       "%s" title
%format "fmt_mostplayed"  "(%3d) %s - %s" playcount artist title %sort = "inverse" %limit = "100"
%format "fmt_lastplayed"  "%06d%s - %s" lastplayed artist title %sort = "inverse" %limit = "99" %strip = "6"
%format "fmt_best_tracks" "%02d. %s (%3d)" tracknum title autoscore
%format "fmt_played"      "(%3d/%d) %s" autoscore playcount title
%format "fmt_score"       "(%3d) %s" autoscore title

# Include our custom menu
%include "/.rockbox/tagnavi_custom.config"

#
# === Begin of "Search by..." sub menu
#

# Define the search sub menu
%menu_start "search" "Search by..."
"Artist" -> artist ? artist ~ "" & filename !~ "/Podcasts/" & filename !~ "/Other/" -> album -> title = "fmt_title"
"Album" -> album ? album ~ "" & filename !~ "/Podcasts/" -> title = "fmt_title"
"Title" -> title ? title ~ "" & filename !~ "/Podcasts/"
"Filename" -> filename ? filename ~ "" & filename !~ "/Podcasts/"
"Score" -> title = "fmt_score" ? autoscore > "" & filename !~ "/Podcasts/"

# START OF EXTRA MENUS
%menu_start "newPods" "New podcasts"
"Comedy Package" -> album ? filename ~ "/Podcasts/- Comedy Package - A PodShow Channel" & playcount == "0" -> title = "fmt_podcast"
"Technology Package" -> album ? filename ~ "/Podcasts/- Technology Package - A PodShow Channel" & playcount == "0" -> title = "fmt_podcast"
"Music Package" -> album ? filename ~ "/Podcasts/- Music Package - A PodShow Channel" & playcount == "0" -> title = "fmt_podcast"

%menu_start "oldPods" "Archived podcasts"
"Comedy Package" -> album ? filename ~ "/Podcasts/- Comedy Package - A PodShow Channel" & playcount != "0" -> title = "fmt_podcast_old"
"Technology Package" -> album ? filename ~ "/Podcasts/- Technology Package - A PodShow Channel" & playcount != "0" -> title = "fmt_podcast_old"
"Music Package" -> album ? filename ~ "/Podcasts/- Music Package - A PodShow Channel" & playcount != "0" -> title = "fmt_podcast_old"
# END OF EXTRA MENUS

# ^ An empy line ends the menu

#
# === Begin of main menu
#

# Define the title of the main menu
%menu_start "main" "Rockbox Database"
"Artist"   -> artist ? filename !~ "/Podcasts/" & filename !~ "/Other/" -> album  -> title = "fmt_title"
"Album"    -> album ? filename !~ "/Podcasts/" & filename !~ "/Other/" -> title = "fmt_title"
"Genre"    -> genre ? filename !~ "/Podcasts/" & filename !~ "/Other/" -> artist -> album -> title = "fmt_title"
"Composer" -> composer ? filename !~ "/Podcasts/" & filename !~ "/Other/" -> album -> title = "fmt_title"
"Track"    -> title ? filename !~ "/Podcasts/" & filename !~ "/Other/"
"Year"     -> year ? year > "1000" & year < "2008" & filename !~ "/Podcasts/" & filename !~ "/Other/" -> artist -> album -> title = "fmt_title"
"Search..." ==> "search"
"Most played tracks" -> title = "fmt_mostplayed" ? playcount > "0" & filename !~ "/Podcasts/" & filename !~ "/Other/"
"Last played" -> title = "fmt_lastplayed" ? playcount > "0"
"Never played tracks" -> artist ? playcount == "0" & filename !~ "/Podcasts/" & filename !~ "/Other/" -> album -> title = "fmt_title"
"Best tracks" -> artist ? playcount > "1" & autoscore > "85" & filename !~ "/Podcasts/" & filename !~ "/Other/" -> album -> title = "fmt_best_tracks"
"List played" -> title = "fmt_played" ? playcount > "0"
"Last added tracks" -> artist ? entryage == "0" & filename !~ "/Podcasts/" & filename !~ "/Other/" -> album -> title = "fmt_title"
"Custom view..."  ==> "custom"

# And finally set main menu as our root menu
%root_menu "main"
It still doesn't work. Why? :)
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Submenus in 'New Podcasts' section?
« Reply #13 on: March 15, 2007, 04:45:58 AM »
You have not actually placed a call to the new menus in the Main menu. You will need the following lines added:

Quote
"Album"    -> album ? filename !~ "/Podcasts/" & filename !~ "/Other/" -> title = "fmt_title"
"New podcasts" ==> "newPods"
"Archived podcasts" ==> "oldPods"

"Genre"    -> genre ? filename !~ "/Podcasts/" & filename !~ "/Other/" -> artist -> album -> title = "fmt_title"

You also haven't defined your podcast display format strings:
"fmt_podcast" and "fmt_podcast_old" appear, but are not described in the formatting section at the beginning of the file.

I know this is design decision you have made, but it really would be easier to leave the tagnavi.config alone and just put it all in the tagnavi_custom.config. What you are doing will work, but it makes it more confusing and you are at risk of losing it all if you upgrade your build without taking a copy of the .config file.
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline pdedecker

  • Member
  • *
  • Posts: 15
Re: Submenus in 'New Podcasts' section?
« Reply #14 on: March 15, 2007, 11:52:56 AM »
Quote from: bascule on March 15, 2007, 04:45:58 AM
You have not actually placed a call to the new menus in the Main menu.
Crap, I'm such an idiot. Now, I see the menus and they work as desired, but the playcounts don't update. That of course causes the "Archived podcasts" menu to stay empty (I can see the categories though). It's exactly the same with my music since my "Last played" playlist is empty. Did I, perhaps, forget to enable some option?
Logged

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Submenus in 'New Podcasts' section?
 

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

Page created in 0.082 seconds with 15 queries.