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: foo_custominfo (Read 189884 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_custominfo

Reply #125
Using foo_uie_quicksearch, this can be done with a simple script(Change %play_counter% to your tag, if you use something else):
Code: [Select]
%play_counter% GREATER 0 AND "$cinfo(play_counter)" GREATER 0

You can use the same for foo_playlist_tree, but then you'll have to write play_counter instead of %play_counter%.
You should still look over the result, though, so you don't mess anything up.

We know Fermion hasn't logged on in four months. Would it be proper asking for someone to (re)write Custominfo, maybe?

foo_custominfo

Reply #126
is there a way to tag directly the song?
to tag the song in the metadata???

foo_custominfo

Reply #127
is there a way to tag directly the song?
to tag the song in the metadata???


You can use foo_playcount.dll either official of mod. Though, I prefer to have the statistics to be saved in "database only".


foo_custominfo

Reply #129
thanks i have foo_playcount.dll mod but it doesn't tag the rating in the metadata


It's kind of weird, since I had the same problem too, that's why I use foo_custominfo after neither official playcount nor unofficial worked for me. I'm quite new to this forum, but I felt quite curious why other members do not suffered the same problem, so I was thinking the problem was me or my configuration. Glad I'm not alone.

Forgot to mention, what was not working is play counter, not rating.

foo_custominfo

Reply #130
Download link is currently dead [server claims file doesn't exist].

foo_custominfo

Reply #131
Download link is still dead... where can we download foo_custominfo ? Is it a deprecated component or is it still usable with foobar 0.9.5 ?

foo_custominfo

Reply #132
It is usable with 0.9.5. I uploaded the latest known version. Get it here or here.

foo_custominfo

Reply #133
Thanks Einstein ! 

foo_custominfo

Reply #134
Just like atahualpa I'm in trouble right now. Unfortunately I excluded every file type from the foobar database. After realizing and reverting this all my play counts and ratings are gone. But when browsing the database with a text editor, all the values are still there. I followed Slotos' advice to use an sqlite browser to undelete the data but it seems as if they are not accesible in that way too.
So I'll ask atahualpa's question again: Is there a way to retrieve the data from the db-file?

P.S. to the developer: How about an option to identify songs by their tags?

foo_custominfo

Reply #135
Hello 'I don't mind', welcome to HA Forums BTW...

The best would be implementing that retrieval option directly into the component's prefs. What does the dev think ?

foo_custominfo

Reply #136
Jose hidalgo, you should be more attentive. Developer have finished his work with this component long time ago. And he doesn't owe you anything, so your "what does the dev think" is actually a "bit" selfish. You could be at least thankful for that he created this component at all.

I don't mind, can you please mail your database to slotos@gmail.com? I'd like to try working it out.
Sharing delusions since 1991.

foo_custominfo

Reply #137
Thanks for your help guys.

Are the sources of this plugin public (or legally reversable) so that the cummunity could go on with the work on this promising concept?

foo_custominfo

Reply #138
Hey, good news!
I managed to recover my database. I used a Ruby script to parse the database-file and store the information in a newly generated custominfo.txt. It's a dirty hack, but it worked for me. Until now I just implemented the recovery of the two values "RATING" and "PLAY_COUNTER" but every other value would be just the same.
If you should use the script it might happen that you'll have to customize the first line in the text file after it's generation. Just refer to an original custominfo.txt what's the right value there.
Feel free to ask if you should have the same problem and you're not able to use the script sucessfuly.

P.S: Thanks to Slotos, who offered to help me (and had exactly the same idea that I had  )

edit: There seems to be a little problem with songs that are divided into subsongs: The meta information for the first track is not restored. I'll look over this issue...

Code: [Select]
file = File.open('custominfo_sqlite.db',"r")
raw = file.readlines("file")
data = Array.new()
raw.each { |temp|
if temp.include? "RATING"
    pos = temp.index("RATING")
    if temp[pos-1,1].unpack('c')[0] > 50
        url = "file"+temp[0..pos-1]
        subsong = "0"
    else
        url = "file"+temp[0..pos-2]
        subsong = temp[pos-1,1].unpack('c')[0]
    end
    name = "RATING"
    value = temp[pos+6,3].to_i.to_s
    data << [url,subsong,name,value]
elsif temp.include? "PLAY_COUNTER"
    pos = temp.index("PLAY_COUNTER")
    if temp[pos-1,1].unpack('c')[0] > 50
        url = "file"+temp[0..pos-1]
        subsong = "0"
    else
        url = "file"+temp[0..pos-2]
        subsong = temp[pos-1,1].unpack('c')[0]
    end
    name = "PLAY_COUNTER"
    value = temp[pos+12,3].to_i.to_s
    data << [url,subsong,name,value]
end

}
file.close()
raw = nil

output = File.open('temp.dat','w')
count = 0
while true
    temp = data.pop
    break if temp == nil
    count += 1
    url = temp[0]
    subsong = temp[1]
    names = [temp[2]]
    values = [temp[3]]
    remi = Array.new()
    data.size.times { |i|
        if data[i][0] == url && subsong == data[i][1]
            if names.include?(data[i][2])
                remi << i
                values[names.index(data[i][2])] = [values[names.index(data[i][2])],data[i][3]].max
            else
                remi << i
                names << data[i][2]
                values << data[i][3]
            end
        end
    }
    remi.reverse!
    remi.each { |i|
        data.delete_at(i)
    }
    output << "#{url}\x0D\x0A#{subsong}\x0D\x0A#{names.size}\x0D\x0A"
    names.size.times { |i|
        output << "#{names[i].size}\x0D\x0A#{names[i]}\x0D\x0A#{values[i].size}\x0D\x0A#{values[i]}\x0D\x0A"
    }
end
output.close()
output = File.open('custominfo.txt','w')
output << "D08C788A-7F13-40C5-B3B2-E4B4ED99E6F7\x0D\x0A#{count}\x0D\x0A" << IO.read("temp.dat")
unlink("temp.dat")

foo_custominfo

Reply #139
Bravo 'I don't mind'.  Now that you've solved your problem, maybe you could think about improving this great little piece of script (adding additional fields for instance, solving the subsongs issue), then providing the final version directly as a downloadable file ? Thanks in advance.

foo_custominfo

Reply #140
Great work, I don't mind. Seems like I should learn Ruby, it's not the first time I've seen it being really useful =)
Sharing delusions since 1991.

foo_custominfo

Reply #141
I have analyzed the structure a bit further but I'm not able to tell where the length of the url is stored. So if somebody could find this, it will be easy to write a completely generic script. Until now I just know that the 6 bytes before the url itself refer to the subsong, the length of the name field and length of the value field. Before those there are 2 unknown bytes and then there is a x81 in most of of the cases.

Unfortunately I don't have much time atm as I'm writing my thesis. But everybody should feel free to add anything to the script he wants. It's open source

foo_custominfo

Reply #142
Why not just use an SQLite library to access the database file instead of writing a custom parser?

foo_custominfo

Reply #143
Good question! The sqlite browsers I tried were unable to find any data within the file. Maybe a library could do that, but I din't try.

foo_custominfo

Reply #144
There are no means in the SQLite-API to recover deleted records. So there exists no library to undelete those  records. As for filesystems deleting data does not mean to completely overwrite them. So as far as you don't overwrite old data your are able to recover deleted data with a parser (and what "I don't mind" does).

foo_custominfo

Reply #145
Perhaps someone could help me with my database, too? I've been using foo_playback_custom and at some point of time changed tags from uppercase to lowercase, which introduced horrible confusion into my DB. There are now double entries for every song's first/last played and playcounter and because of that the plugin in question fails to read them correctly.

Unfortunately, I know next to nothing of SQLite, but I can set down the task quite easily hoping someone generous (and knowledgeable) would help me out. The task is quite straightforward:

to find all entries duplicated in upper and lowercase, of which
1) to choose the one first_played entry which is less that the other one
2) to choose the one last_played entry which is more than the other one
3) to sum both upper and lowercase play_counter entries
and place the result in a new, clean custominfo DB.

Can someone be so kind as to look at my DB and compose the abovementioned query to fix it?

foo_custominfo

Reply #146
I am getting a 404 page when I click the download link.  Is there somewhere else I should be looking?