Rockbox General > Rockbox General Discussion
How can I identify (and delete) tracks already played?
bluebrother:
--- Quote from: DrRemulak on June 30, 2008, 07:17:37 PM ---That sounds like a decent solution. Can you point me in the right direction towards creating a playlist based on playcount? I tried and didn't get very far.
--- End quote ---
You need to create a tagnavi_custom.config file to create a custom search in the database. Check the wiki, can't tell you off the top of my head how it works (and have a look at the default tagnavi.config)
DrRemulak:
Hmmm.... well I thought I was able to successfully create the custom tagnavi but it didn't work.
I created the file similar to what's listed here for Example 3:
http://www.rockbox.org/twiki/bin/view/Main/DataBase#Examples
However, I don't think the runtime stats are ever getting updated on my player. I did enable 'Gather Runtime Data' in the database settings but maybe I'm missing something else.
The reasons why I don't think the runtime stats are being updated
1. The 'Recently Played Tracks' view (which is already in Rockbox, not something I created) doesn't show anything even after I play a few tracks.
2. I tried to backup the runtime stats by performing Export Modifications in the Database settings menu. It created a small file with no stat data in it.
Any ideas why the runtime stats are not being updated?
Thanks.
bascule:
You may need to restart your player (or at least wait until a re-buffer has happened), in order to ensure that the data has been committed to the database.
DrRemulak:
--- Quote from: bascule on July 01, 2008, 11:39:59 AM ---You may need to restart your player (or at least wait until a re-buffer has happened), in order to ensure that the data has been committed to the database.
--- End quote ---
Tried those. No change. Not sure why I can't see runtime updates.
EDIT1: OK, I tried again and now it's working. The only thing did differently was to take it out of shuffle mode. Maybe that was the issue. Will try again later.
I created the playlist of tracks that had been played and saved it as an m3u file. Then I edited it to be a batch file to delete the tracks. It worked! I will probably write an AutoIt script to automate the process of deleting the files once the playlist file has been created.
Thanks!
EDIT2: Here's the AutoIt script to delete files from a playlist generated by Rockbox:
--- Code: ---;Delete already played files by using playlist generated by Rockbox
;
$message="Choose playlist file containing tracks to be deleted"
$var = FileOpenDialog($message,@ScriptDir,"All (*.*)", 1)
If @error Then
MsgBox(4096,"","No File(s) chosen")
Exit
EndIf
$file = FileOpen($var, 0)
; Check if file opened for reading OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf
Global $microdir = ""
While 1
$line = FileReadLine($file)
If @error = -1 Then ExitLoop
$line = StringReplace($line, "/", "\")
$microchk = StringLeft($line,12)
if StringCompare($microchk,"\<microSD1>\")=0 then
$line = StringTrimLeft($line,12)
if StringLen($microdir)=0 then
$microdir=FileSelectFolder("Choose drive folder containing microSD1 card.","")
endif
$line = $microdir & $line
endif
If FileExists($line) then
FileDelete($line)
else
MsgBox(4096,"",$line & " does not exist")
endif
Wend
FileClose($file)
$answer = MsgBox(4,"Delete?","Delete playlist file?",20)
if $answer=6 then
FileDelete($var)
endif
--- End code ---
EDIT 3: Modified script to delete files from microSD card. Obviously the card has to be out of the player and inserted as a drive on your PC (e.g. via USB adapter.)
Also note that you must use AutoIt 3.2.4.0 or greater because of UTF-8 support. Rockbox saves the playlist in UTF-8 format and previous versions of AutoIt would only use ANSI, thus choking on the playlist text.
Navigation
[0] Message Index
[*] Previous page
Go to full version