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
| |-+  Audio Playback, Database and Playlists
| | |-+  Tagnavi_custom.config: last played
« previous next »
  • Print
Pages: [1]

Author Topic: Tagnavi_custom.config: last played  (Read 3332 times)

Offline SoulSkorpion

  • Member
  • *
  • Posts: 18
Tagnavi_custom.config: last played
« on: August 09, 2007, 08:47:18 AM »
I'm trying to create a custom database view where it shows only songs that I haven't heard in the last four days. Looking at the existing items in the tagnavi.config, my understanding is that it can access the last played time, but I can't figure out the syntax from the examples there. I tried looking at the wiki and I see that the lastplayed tag is available, but the comment of "Incremental number. Works, but not sorted correctly when used in filter" is cryptic and unhelpful.

Google and forum searches for tagnavi syntax haven't turned anything up, other than posts from 2006 saying that it's still experimental. Any hints about how the syntax works in this department would be greatly appreciated.
Logged
Hardware: Sansa e280
Rockbox version: r14620-070905

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: Tagnavi_custom.config: last played
« Reply #1 on: August 09, 2007, 09:51:39 AM »
Quote from: SoulSkorpion on August 09, 2007, 08:47:18 AM
I'm trying to create a custom database view where it shows only songs that I haven't heard in the last four days.

Not currently possible, as the DB doesn't store the time stamp when a song was last played (not useful for targets without RTC)

I wrote a patch once: http://www.rockbox.org/tracker/task/6301 (6_dayssince.patch - doesn't apply anymore) for that but abandoned the idea as I didn't find it very useful.

Quote
and I see that the lastplayed tag is available, but the comment of "Incremental number. Works, but not sorted correctly when used in filter" is cryptic and unhelpful.

Well, there is a number that increments whenever a song is played and is assigned to that songs lastplayed field. Feel free to clarify the wiki. :)
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Tagnavi_custom.config: last played
« Reply #2 on: August 09, 2007, 10:05:26 AM »
Unfortunately, there is no 'Real-Time' information stored in the database, only 'relative' (either to now or to the last database update).

A quick 101 on the lastplayed tag, as used in the default Database config:

Code: [Select]
%format "fmt_lastplayed"  "%06d%s - %s" lastplayed artist title %sort = "inverse" %limit = "99" %strip = "6"
This formatting string uses (but strips from view) the lastplayed value to create a list of tracks in the order in which they were listened to.
It then inverts it, to display the most recent first.
It then limits it to 99 tracks

Code: [Select]
"Recently played tracks" -> title = "fmt_lastplayed" ? playcount > "0"
This database menu item then uses the formatting string defined above to choose the tracks, in this case going directly to the track title.
The conditional 'playcount > "0" ensures that tracks that have never been listened to are excluded.
This is necessary because the lastplayed value for all non-listened-to tracks is zero and they can show up in the listing if not explicitly taken out.

So, to plainly answer your question, no, you can't specify by actually how long ago you last listened to them, only relatively how long ago compared to all the tracks you have listened to.
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline Job Van Dam

  • Member
  • *
  • Posts: 167
Re: Tagnavi_custom.config: last played
« Reply #3 on: August 09, 2007, 01:53:48 PM »
I'm wondering is it possible to show the number of tracks in each genre?
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Tagnavi_custom.config: last played
« Reply #4 on: August 09, 2007, 02:39:01 PM »
Not as far as I know...
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline SoulSkorpion

  • Member
  • *
  • Posts: 18
Re: Tagnavi_custom.config: last played
« Reply #5 on: August 09, 2007, 07:56:25 PM »
Quote from: bascule on August 09, 2007, 10:05:26 AM
Unfortunately, there is no 'Real-Time' information stored in the database, only 'relative' (either to now or to the last database update).
Quote
So, to plainly answer your question, no, you can't specify by actually how long ago you last listened to them, only relatively how long ago compared to all the tracks you have listened to.
Oh right. Thanks.

Quote
%format "fmt_lastplayed"  "%06d%s - %s" lastplayed artist title %sort = "inverse" %limit = "99" %strip = "6"
This was the part I couldn't work out. It looks a bit like a sprintf string... ah, and there are three fields after it that get substituted in, right? I didn't realise that lastplayed was just a digit, and I was trying to figure out how the format string could contain a date.

What causes these details to be stripped from view or is that automatic?
« Last Edit: August 10, 2007, 01:10:06 AM by SoulSkorpion »
Logged
Hardware: Sansa e280
Rockbox version: r14620-070905

Offline pabouk

  • Member
  • *
  • Posts: 387
Re: Tagnavi_custom.config: last played
« Reply #6 on: August 10, 2007, 03:43:27 AM »
Quote from: SoulSkorpion on August 09, 2007, 07:56:25 PM
What causes these details to be stripped from view or is that automatic?
The part '%strip = "6"' removes the first 6 characters from the view. Unfortunately it is not possible to strip a variable number of character using something like regular expressions.

Please read the documentation Wiki - DataBase and/or Daily Built Manuals.
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Tagnavi_custom.config: last played
« Reply #7 on: August 10, 2007, 04:26:21 AM »
Quote from: SoulSkorpion on August 09, 2007, 07:56:25 PM
... ah, and there are three fields after it that get substituted in, right?

What causes these details to be stripped from view or is that automatic?

Yes for substitution. Each %whatever token is rendered using the respective tag in the subsequent text.

I was hoping that by using the phrase '...formatting string uses (but strips from view)...' that the reader would automatically associate the %strip token as the one doing that function...  :P

* bascule ...must ...try ...harder to be understood
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline SoulSkorpion

  • Member
  • *
  • Posts: 18
Re: Tagnavi_custom.config: last played
« Reply #8 on: August 10, 2007, 06:02:01 AM »
Quote from: bascule on August 10, 2007, 04:26:21 AM

I was hoping that by using the phrase '...formatting string uses (but strips from view)...' that the reader would automatically associate the %strip token as the one doing that function...  :P

* bascule ...must ...try ...harder to be understood

Well, if it helps, what I initially thought that part meant was that it would strip out the sixth arg of something. Seeing as there were only three fields being operated on, that confused me :)
Logged
Hardware: Sansa e280
Rockbox version: r14620-070905

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Tagnavi_custom.config: last played
 

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

Page created in 0.098 seconds with 15 queries.