Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Write playback history to file (Read 332 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Write playback history to file

I'm lookin for a plugin that can write the playback history to a file.

A couple of years ago I had it already working, but after my HDD crashed I had to customize foobar from scratch.
Unfortunately I can't remember which plugin I have used and if it's still working with the latest foobar.

Here are three components I found, but they don't seem to do what I want:
foo_playcount
foo_playback_custom
foo_playlisthistory

Does something I need even exist?



Re: Write playback history to file

Reply #3
https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_Reference#Time_and_date_functions
Quote
$date(time)
Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.
$time(time)
Retrieves the time part (formatted as HH:MM:SS or HH:MM) from a date/time string
Join both :)
Code: [Select]
$date(%datetime%) $time(%datetime%)

Re: Write playback history to file

Reply #4
Unfortunately that's not working, I just get a "?"

See Screenshot on OneDrive

Any other ideas?
Well, I could write a script that takes the datetime string and converts it to what I need, but maybe there's a simpler solution.

Re: Write playback history to file

Reply #5
Was expecting %datetime% followed TF format like the dates retrieved by other plugins (*).  obviously without that format it doesn't work. Use substring and extract what you need manually, there is no other way. You will need multiple calls to extract every part.
https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_Reference#.24substr.28str.2Cfrom.2Cto.29

X

 (*) YYYY-MM-DD hh:mm:ss

EDIT:
You need to create a a substitution for all 12 months. Like the first line. Have no idea what format the plugin uses, if it's always 3 chars, etc. so adjust as needed.
Code: [Select]
$if($stricmp($substr(%datetime%,5,7),Oct),$puts(month,10),)
$right(%datetime%,4)-$get(month)-$left($right(%datetime%,16),2) $left($right(%datetime%,13),8)

X

 

Re: Write playback history to file

Reply #6
I've got it:
Code: [Select]
$puts(txt,%datetime%)
$puts(weekday,$left($get(txt),3))
$puts(month,$right($left($get(txt),7),3))
$puts(day,$right($left($get(txt),10),2))
$puts(time,$left($right($get(txt),13),8))
$puts(year,$right($get(txt),4))

$get(day).
$ifequal($stricmp($get(month),jan),1,01,)
$ifequal($stricmp($get(month),feb),1,02,)
$ifequal($stricmp($get(month),mar),1,03,)
$ifequal($stricmp($get(month),apr),1,04,)
$ifequal($stricmp($get(month),may),1,05,)
$ifequal($stricmp($get(month),jun),1,06,)
$ifequal($stricmp($get(month),jul),1,07,)
$ifequal($stricmp($get(month),aug),1,08,)
$ifequal($stricmp($get(month),sep),1,09,)
$ifequal($stricmp($get(month),oct),1,10,)
$ifequal($stricmp($get(month),nov),1,11,)
$ifequal($stricmp($get(month),dec),1,12,)
.$get(year)
 $get(time)
$tab()
%artist% - %title%$crlf()

Finally ,this is exactly what I need:



P.S.: Working with variables makes life much easier 😉