Help - Search - Members - Calendar
Full Version: foo_customdb: How to transfer tags to/from DB
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
odyssey
I really love tagging and sometimes I want to tag the most outrages things. Even assignments for autoplaylists, so my playlists wouldn't get lost even if I moves my files (which I do a lot)...

So I've taken a look into the foo_customdb component that is a separate database holding your tags without writing them to files.

First you should decide how you want to define a key (a unique identifier) for a tag. This is customizable which is cool, because then you can even define a key to match more than just one file/item. Here are a few examples:

ALBUMRATING: "%artist% %album%"
RATING: "%artist% %title%"

If you don't move your files around a lot, you could simply use "location" to store values for each file, but personally I would like a better ability to track a file no matter where it is. To achieve this, I use foo_biometrics which can store a unique fingerprint in the %fingerprint_fooid% tag. However the tag itself is quite long and you might want to use a shorter key, so you can use the function $crc32(%fingerprint_fooid%) to define the key. However, it's important that you only allow writing to files that contain this tag, so make sure that you under Action define the "Set value:" to "$if(%fingerprint_fooid%,value,)".

Since I already have a lot of tags that I may need to store in foo_customdb, I was wondering if it was possible to transfer those tags back and forth if I ever decides maybe even to abandon the component or something else. This is actually possible! You simply define an action and define the "Set value:" to "$if(%fingerprint_fooid%,%tag_stored_in_file%,)".

Also it's possible to move the tags back in the files using the normal Properties dialog and "Automatically Fill Values". You define a Source from "Other" and sets the tagname you have defined in foo_customdb and defines the tag that it should be written to in the "Pattern". Unfortunately I have not been able to make this work using Masstagger.

Note that if you want to store a value in foo_customdb, you need to use it's own context menu. If you try to set a tag anywhere else (CUI, Properties etc.), it will be written directly to the file.

Please note that this component (0.0.9a) is currently listed under Problematic Components and it may cause crashes. I have experienced crashes after configuration if I don't restart foobar2000 before using the changes.
2E7AH
It's good for me to see foo_custom usage examples here. The component has open database format which can be easily manipulated and if there is reason for some action there seems to be quite possibilities open.

I found this page in the past and may be useful if someone is interested - example how to transfer some tag info to custom db and manipulate db

2E7AH
Here is hotness algorithm for foo_custom:

CODE
$puts(baselinefrequency,90)$puts(baselinedecay,28)$puts(lp,[%last_played%])$puts(fp,[%first_played%])$puts(pc,[%play_count%])$puts(rating,[%rating%])$puts(avgrating,3)$puts(lp_mod,$sub($add($add($mul($year($get(lp)),365),$mul($month($get(lp)),30)),$day_of_month($get(lp))),730000))$puts(fp_mod,$sub($add($add($mul($year($get(fp)),365),$mul($month($get(fp)),30)),$day_of_month($get(fp))),730000))$puts(date_diff,$sub($add($add($mul($year(%now%),365),$mul($month(%now%),30)),$day_of_month(%now%)),730000))$puts(baselinefrequency,$mul($get(baselinefrequency),24))$puts(baselinedecay,$mul($get(baselinedecay),24))$puts(lp_age,$add($substr($get(lp),12,13),$mul(24,$get(lp_mod))))$puts(fp_age,$add($substr($get(fp),12,13),$mul(24,$get(fp_mod))))$puts(age,$sub($get(lp_age),$get(fp_age)))$puts(now_age,$add($time(%now%),$mul(24,$get(date_diff))))$puts(recentness,$sub($get(now_age),$get(lp_age)))$puts(decay,$div($div($mul($get(pc),$get(baselinefrequency),$get(baselinedecay),$if2($get(rating),$get(avgrating)),100),$mul($max($get(age),$get(baselinefrequency)),$get(avgrating))),100))$puts(rawhotness,$div($mul($max($sub($get(decay),$get(recentness)),0),100),$get(decay)))$puts(forecast,$div($mul($max($sub($get(decay),$add($div($max(0,$sub($get(baselinedecay),$get(recentness))),2),$get(recentness))),0),100),$get(decay)))$put(hotness,$div($add($get(rawhotness),$get(forecast)),2))




It uses: %last_played%, %first_played%, %play_count%, %rating%
It can be used for creating autoplaylists: i.e. %HOT% GREATER 90
It can be used for creating Autorating (also in custom_db): $div($add(%HOT%,4),20)

Following odyssey's "Album rating" idea, which also come to my mind in past but had no idea how to manage it, I can't make it work without context menu. What I was thinking is that "Album rating" should be some average of tracks ratings or auto ratings, but I can't make it work automatically - don't know if it's possible or is there some trick
odyssey
As you can only define one value using the context menus, you can't get an average rating from a set of rating on a album. However, I think you can combine your first idea here with a neat select (or grouping maybe) to determine an average as such. I will have to find out the way the guide works, because I'm not familar with SQLite SQL usage - just some other proprietary SQL i work with everyday, but I'll probably manage it wink.gif
2E7AH
QUOTE (odyssey @ Oct 8 2009, 21:53) *
However, I think you can combine your first idea here with a neat select (or grouping maybe) to determine an average as such.

You mean in the custom_db itself? It won't be hard but it doesn't sound like automatic solution

I tried using key: "%artist%, %album%" and hoped that it would solve by itself, but unfortunately not. If update is set to "Media Library (modified)" it accepts the value of only the last track modified.

But maybe using "playback" for update action and some script (like simplified hotness) can make this Album rating field - and that would only count from the time the field is made and on (because of playback update) - So this may sound like automatic solution: when Album rating field is created with "playback" update, populate the Album rating fields in custom_db by hand and than let the field autoupdate on playcount. I will try that and see if it works.
2E7AH
OK, I've tried that: First it wasn't very easy as I thought. Lacking SQL skills, I exported custom_db to CSV and done the calculations in Excel.

I needed items with "fieldname" HOT and HOT_ALBUM so I can average the HOT_ALBUM with HOT values from it's tracks. (I wouldn't explain how I've done that, but if someone is interested I could, although I would like to know how this can be done using SQL)

After the averaging I imported the values in custom_db. Now what to use as value for HOT_ALBUM?
I ended using this simple code:
CODE
$if(%totaltracks%,$div($add($mul(%hot_album%,$sub(%totaltracks%,1)),%hot%),%totaltracks%))

It's not perfect but it generally works and I done all this quickly so if we involve little thinking it can be more correctly presented. Only consideration that timing should be set to more than 60s (i.e. 65s) so it can catch the playback statistics update wink.gif

So we can now use this HOT_ALBUM as indicator for Album hotness, in autoplaylists, or for Album autorating (which was the idea): i.e. $div($add(%HOT_ALBUM%,4),20), but it's not good for using as column as the update is not for that use, but we can have it as a tag field which can be accessed from anywhere.



Only that setted HOT_ALBUM value will not auto-decay - for that we'll need update on "Media Library (modified)" which can be used instead "playback" update if someone wants, but as I said it's not perfect and it can be improved with modifying hotness code for Album use, and for now this is just example
odyssey
SQL isn't really that hard when you get into it. You should be able to sum data with a select string. Something like:

SELECT SUM(column_name) FROM TABLE WHERE something=something_else GROUP BY whatever

smile.gif
fbuser
@2E7AH

Does the timing work accurately for you?
I have the problem, that I'm not able to find a setting, where playcount is updated, when a track is completely played. If I you choose 9999 seconds as threshold, not all tracks are updated. The same problem occurs for using a percentage threshold. 100% doesn't work at all, and for 99% it is a similar problem as for a seconds threshold. The latter one is apperantly a resolution problem. It occurs mainly for short tracks less then 100 seconds.
2E7AH
QUOTE (odyssey @ Oct 9 2009, 08:49) *
SELECT SUM(column_name) FROM TABLE WHERE something=something_else GROUP BY whatever

It seems easy but can you make that example to work for this table (average HOT_ALBUM with it HOT tracks):



QUOTE (fbuser @ Oct 9 2009, 08:53) *
Does the timing work accurately for you?

I use official statistics, but trying now it's probably bug: 98, 99 and 100% doesn't update the field for length <= 90s and 100% doesn't update any length.
odyssey
You will have to perform it outside foobar (or by a shortcut, or maybe even using a script). You need to extract the info using a SELECT and then adding the calculated values using INSERT INTO. customdb will just return the value from the db, so you can't sum when you view it. As I said before, I need to take a closer look into SQLite, and it probably won't be before this weekend.
2E7AH
I don't mean to do that with foobar.
OK, I'll look in some SQL books on my PC - it's good to know the basic syntax
odyssey
The SQLiteStudio you linked to seems to be a handy tool wink.gif
Kent Wang
How do you show the fields from customdb in playlist view, in the columns? E.g., I want to show ratings in the columns view.
2E7AH
Just use the field name: if it is RATING than something like this:

CODE
$if(%rating%,$repeat(★,%rating%)$repeat(☆,$sub(5,%rating%)))
Kent Wang
Thanks.

The problem was very strange. If I restart once, it would show, but if I restart again, it wouldn't, and then it would alternate. I think this was because I had RATING set to Location (foo_custominfo compatibility) instead of the custom value. I solved this by creating a TEMP value, setting TEMP to RATING, change RATING to custom value (the customdb default, instead of the foo_custominfo compatibility), then setting RATING to TEMP.

Now that I have this working I think it's a lot better than using the Playback Statistics component and slightly better than the outdated foo_custominfo.
2E7AH
QUOTE (odyssey @ Oct 8 2009, 11:39) *
Please note that this component (0.0.9a) is currently listed under Problematic Components and it may cause crashes. I have experienced crashes after configuration if I don't restart foobar2000 before using the changes.

I tried to manage custom tags (artist, album, title and comment) for non-taggable files (MID, WAV...). So I added the fields and in actions set value to $if($or($stricmp(%codec%,mid),$stricmp(%codec%,pcm)),%field name%). Tried to restart foobar as suggested but nothing happens. I guess it's not my day today wink.gif

I deleted customdb_sqlite.db and tried again: now new db is created with size or 4096 bytes, then failure.dmp with size 0 bytes and failure.txt with size 3 bytes (EF BB BF). And that's it.

I'm glad that I didn't deleted some file tags that I managed thorough this custom db, but I definitely lost all it settings. So be careful, again smile.gif

[edit] and thanks to foo_jesus I didn't saw too much trouble
fbuser
QUOTE (2E7AH @ Oct 21 2009, 18:18) *
$if($or($stricmp(%codec%,mid),$stricmp(%codec%,pcm)),%field name%). Tried to restart foobar as suggested but nothing happens.
If there isn't a typo in your post, nothing happened because of a syntax error. Probably you wanted to use: $if($or($stricmp(%codec%,mid),$stricmp(%codec%,pcm)),%field name%,)
2E7AH
With "nothing happened" I meant foobar doesn't start.

$if($or($stricmp(%codec%,mid),$stricmp(%codec%,pcm)),%field name%)

is the same as:

$if($or($stricmp(%codec%,mid),$stricmp(%codec%,pcm)),%field name%,)

and the problem is in the fields names used I think: ARTIST, ALBUM and TITLE
fbuser
Good to know, I never recognized that the last comma is optional.
2E7AH
OK smile.gif
The problem was in field names indeed: if I use ARTIST, ALBUM and TITLE it happens again and with _ARTIST, _ALBUM and _TITLE i.e. it's all right. Maybe the cause is in just one of this names, but I would suggest avoiding field names that conflicts tag names
fbuser
I just wanted to suggest you something like that, because I successfully tested it that way. But you were faster.
mgl2k
Hello,

first of all thanks for this great component.

I'm trying to get tags with multiple values to work with this component so I can use these tags in the Album List panel of the DUI, but I haven't had any luck so far.
Example: A file with a tag named %style% and the value "a;b" should appear in the Album List panel in the two branches with the names "a" and "b".
Problem: The %<style>% syntax of Album List doen't show anything for CustomDB-tags. Showing %style% is no problem.

Is this possible? Is there anything you can do about it or can this problem only be addressed in the Album List component?

Thanks again for this component, very much appreciated.
Tonto
This component is way cool and really important to me, so this insight is really cool (in fact, reading this thread helped me understand the component much better!)

But I am wondering! WHY DO I, or, DO I have to use the customdb context menu?

I want to use the lyricsdb component to download the lyrics to the customdb, and also for tagging/properties to write information to the customdb, and similar things. Is there any way that I am able to do this?

Thanks
odyssey
QUOTE (Tonto @ Nov 9 2009, 04:08) *
But I am wondering! WHY DO I, or, DO I have to use the customdb context menu?

Yes. This also makes it easier to understand that this component works separately from other tags, but still provides great integration with foobar2000.

QUOTE (Tonto @ Nov 9 2009, 04:08) *
I want to use the lyricsdb component to download the lyrics to the customdb, and also for tagging/properties to write information to the customdb, and similar things. Is there any way that I am able to do this?

In this case I recommend you to create a folder to store your lyrics in. lyricsdb component also allows you to define an identifier to associate specific lyrics, so you can link a file the same way I explained in the first post. This is probably the best way, as it's not stored in the tags, but still possible to access through foobar2000.

Alternatively you have to do a lot of work, first tagging to files and then moving the tags to customdb. Another alternative is to store them in files and create a script or something that will update the SQLite database for you, but this requires that foobar2000 is shut down. Also I don't see what you will gain from this compared to just storing the lyrics in files, but maybe you can elaborate? smile.gif
drmrbrewer
I've tried this out and find it very interesting indeed. Seems to work. Couple of questions.

This for me is the most important part -- the ability to get at my data if/when required, and write it into the files themselves:

QUOTE (odyssey @ Oct 8 2009, 09:39) *
Since I already have a lot of tags that I may need to store in foo_customdb, I was wondering if it was possible to transfer those tags back and forth if I ever decides maybe even to abandon the component or something else. This is actually possible! You simply define an action and define the "Set value:" to "$if(%fingerprint_fooid%,%tag_stored_in_file%,)".

Also it's possible to move the tags back in the files using the normal Properties dialog and "Automatically Fill Values". You define a Source from "Other" and sets the tagname you have defined in foo_customdb and defines the tag that it should be written to in the "Pattern". Unfortunately I have not been able to make this work using Masstagger.


However, I can't get this to work. For the first option above, could you be so kind as to post a screenshot showing the settings you use in the Action tab, for the example custom tag "RATING_CD"? I couldn't get the second option to work either.

And is there a good (free) SQLite database viewer / editor you can recommend?

Thanks,

Mike
odyssey
You create the field properties:



If I understood you correctly, you want to tie ratings to a certain file, so you might use something unique of the file. Personally I prefer %fingerprint_fooid% generated by foo_biometrics (by scanning and tagging your files), but any given value that will refer to this file should do. Note that this identifier is very powerful. You can make it match any pattern you want to - If you want to apply a rating to an album, you could use %album% as the identifier instead.

Then you create the action to copy your existing tags to the customdb:



This is only temporary. The value you want to set already exists in the tag we know, so we just call it as we would anywhere else: %rating%
The update method was 2E7AH's idea. When you have set this and restarted foobar2000, the values should be transferred immediately. I didn't test this, but I'm quite sure it's true smile.gif You can remove this action when they are transferred. Make sure they are properly transferred with a column displaying the fieldname %rating_cd%

Finally you want to setup a way to tag files using the contextmenu:





Regarding an SQLite editor... Well, there's a few, but why do you want to do it? You should only do updating through foobar2000. Anyway, if you are curious, you should read up on the SQL syntax and use the sqlite3.exe you can download from SQLite's official homepage.
drmrbrewer
This series of screenshots is very useful. I will check out the biometrics plugin. For the time being I rather like the idea of using artist-album-track as the key, since it will apply to any duplicates. That concept is very powerful -- as you've pointed out -- since you annotate based on album, or artist, or artist-album, etc, covering multiple tracks with each key.

Anyhow, the help I am really after is how I get the custom tags written into the files themselves. For example, in 5 years' time I decide I don't want to use this component anymore, and I want my custom ratings written into ID3 tags for permanence, how do I do it? You did state two methods in your original post, but I can't get either to work. Some screenshots showing those methods would be great, again using the RATING_CD example -- i.e. writing the custom RATING_CD information into the file's ID3 tag so that you can then e.g. see it in foobar2000's Properties like any other tag.

Thanks!

Mike

P.S. I'll check out the SQLlite DB viewer -- reason is that I want my data to be as open as accessible as possible, and if it ever came to it (e.g. foobar2000 and customdb component vanished overnight) I would still be able to extract my data from the database file itself. I'd just like to poke around rolleyes.gif

Edit to correct typo
odyssey
QUOTE (drmrbrewer @ Nov 11 2009, 23:43) *
Anyhow, the help I am really after is how I get the custom tags written into the files themselves. For example, in 5 years' time I decide I don't want to use this component anymore, and I want my custom ratings written into ID3 tags for permanence, how do I do it? You did state two methods in your original post, but I can't get either to work. Some screenshots showing those methods would be great, again using the RATING_CD example -- i.e. writing the custom RATING_CD information into the file's ID3 tag so that you can then e.g. see it in foobar2000's Properties like any other tag.



QUOTE (drmrbrewer @ Nov 11 2009, 23:43) *
P.S. I'll check out the SQLlite DB viewer -- reason is that I want my data to be as open as accessible as possible, and if it ever came to it (e.g. foobar2000 and customdb component vanished overnight) I would still be able to extract my data from the database file itself. I'd just like to poke around rolleyes.gif

Just keep a backup of the SQLite database. If foobar2000 config is destroyed, you just recreate the pages with the same values. That's the power of using an identifier in the files that are unique to the files and not to something internal in the db (e.g. the file location, which I think is one of the official playcount's weaknesses).
drmrbrewer
Thanks. Works well. I'm also curious about another method of writing custom tags to files which you mentioned in your OP:

QUOTE (odyssey)
You simply define an action and define the "Set value:" to "$if(%fingerprint_fooid%,%tag_stored_in_file%,)".


I couldn't get that to work (I replaced %fingerprint_fooid% with %rating_cd% because I don't use the fingerprint method). After some playing to try and get the right settings, I ended up with a context menu item that crashed foobar2000, so that when I restarted foobar2000, the bad context menu item was still there, but the corresponding setting in customdb was NOT. So, I had no way (I could see) of removing the bad context menu item. Since I am still testing, I could just delete the customdb database file and start from scratch.

How would I remove that bad menu item without having to delete my entire custom DB? This makes me slightly nervous -- database corruption I don't know how to fix.

Thanks,

Mike
odyssey
QUOTE (drmrbrewer @ Nov 12 2009, 08:40) *
Thanks. Works well. I'm also curious about another method of writing custom tags to files which you mentioned in your OP:

QUOTE
You simply define an action and define the "Set value:" to "$if(%fingerprint_fooid%,%tag_stored_in_file%,)".


This is not a way to transfer tags from customdb to files. There is only one way (maybe more, but I didn't test them) to do that, and I already explained that. The action menu is ONLY for storing tags in the customdb, hence you shouldn't write the customdb-field to itself as you are currently trying to.

Also remember always to restart foobar2000 when the component tells you to.

QUOTE ( @ Nov 12 2009, 08:40) *
How would I remove that bad menu item without having to delete my entire custom DB? This makes me slightly nervous -- database corruption I don't know how to fix.

The foobar2000 configuration and customdb-file are not dependant on each other. As I also explained before, if you mess up the foobar2000 config, it doesn't (at least it shouldn't) invalidate the customdb database-file.

Just to clear up, the "bad context menu" does not reside in the customdb-file - it's purely in foobar2000 config, so deleting the database does not get rid of it.

Anyway, always backup your data. Use a backupservice that uses versioning so you can always go back to a certain point in time. There are many great services offering this on internet.
drmrbrewer
QUOTE (odyssey @ Nov 12 2009, 12:06) *
This is not a way to transfer tags from customdb to files. There is only one way (maybe more, but I didn't test them) to do that, and I already explained that. The action menu is ONLY for storing tags in the customdb, hence you shouldn't write the customdb-field to itself as you are currently trying to.


OK, I now see that this method mentioned in your OP was to move tags from the file to customdb, not the other way.

QUOTE (odyssey @ Nov 12 2009, 12:06) *
The foobar2000 configuration and customdb-file are not dependant on each other. As I also explained before, if you mess up the foobar2000 config, it doesn't (at least it shouldn't) invalidate the customdb database-file.

Just to clear up, the "bad context menu" does not reside in the customdb-file - it's purely in foobar2000 config, so deleting the database does not get rid of it.


So the various actions you define in the customdb settings are stored in the foobar2000 config, not the customdb database? The problem I was having is that I set up a new context menu item in customdb, which created an entry in the customdb dialog and a corresponding new context menu appeared. I then used that new context menu, and it caused foobar2000 to crash. When I restarted foobar2000, the entry in the customdb dialog was gone, but the context menu was still showing. So, how would you get rid of that phantom context menu? Me deleting the customdb database and restarting did seem to address the problem, though maybe it was some coincidence.

On another issue, if I decide that using a biometric-based database key is too much hassle (extra components, more to go wrong or be obsoleted), and settle on the simplicity of an artist-album-title combo for the key, what happens when you rename a track (e.g. to correct a typo)? Presumably the tags for the old combo are still stored in the db, but no track points to those tags? That is how I think it would probably work. My next question would be: is there a way of locating any orphaned tags, i.e. those which are not referenced by any track in the foobar2000 library? I don't like the idea of hidden garbage building up in any database.

Thanks,

Mike
odyssey
QUOTE (drmrbrewer @ Nov 12 2009, 14:30) *
On another issue, if I decide that using a biometric-based database key is too much hassle (extra components, more to go wrong or be obsoleted), and settle on the simplicity of an artist-album-title combo for the key, what happens when you rename a track (e.g. to correct a typo)? Presumably the tags for the old combo are still stored in the db, but no track points to those tags? That is how I think it would probably work. My next question would be: is there a way of locating any orphaned tags, i.e. those which are not referenced by any track in the foobar2000 library? I don't like the idea of hidden garbage building up in any database.

You got it right. You have to decide what you think is the best way for you. You can use file-location (similar to official playcount) to store ratings, which can be lost when you move files, use the title identifier with the risk of loss when you rename it or as i suggest use the fingerprint that will ALWAYS be the same for a particular file no matter where it resides. You can even erase the tag, which will hide the tags, but once you've fingerprinted the file, the tags will re-appear.

That said, I hardly doubt foo_biometrics will become obsolete. It's not exactly an ongoing development (rather an experiment), but it's musicmusic that's behind the component (developer of columnsui), so I'm fairly sure it will be updated regularly if new SDK's requires it.
drmrbrewer
OK, and to address the question of how to clean up a custom db to find and remove any old tags that are no longer referenced by any track in your collection? I'm guessing this is going to be difficult, so that you'll be left with a lot of "space debris" floating around in your database.

With the fingerprint key scheme, is there an easy way to ensure that each track is analysed, and fingerprint written, or is it a manual process? E.g. if I add a new track to my collection, do I have to remember to fingerprint it, or will the component be triggered on a new import?

Mike

P.S. it looks like customdb is at least being actively developed still -- it's quite new? Does the author ever drop in to these forums?
odyssey
QUOTE (drmrbrewer @ Nov 12 2009, 15:50) *
OK, and to address the question of how to clean up a custom db to find and remove any old tags that are no longer referenced by any track in your collection? I'm guessing this is going to be difficult, so that you'll be left with a lot of "space debris" floating around in your database.

Sounds like you're a perfectionist wink.gif Me too.... However, I think you should just try to get used to a certain amount of "orphaned" entrys in the db. It shouldn't slow down the database that much as it's relatively few values we're talking about.

QUOTE (drmrbrewer @ Nov 12 2009, 15:50) *
With the fingerprint key scheme, is there an easy way to ensure that each track is analysed, and fingerprint written, or is it a manual process? E.g. if I add a new track to my collection, do I have to remember to fingerprint it, or will the component be triggered on a new import?

YES sweat.gif w00t.gif with foo_new_file_stamper_mod. You just set it to "Save fingerprints to file" in it's property-page, and any new added file will be analyzed. It works really really well! (Umm... except that if you, like me, have net-streams defined in files e.g. asx, biometrics will crash on it).

To analyze all your existing files, create an autoplaylist with
CODE
FINGERPRINT_FOOID MISSING AND %length_seconds% GREATER 10


QUOTE (drmrbrewer @ Nov 12 2009, 15:50) *
P.S. it looks like customdb is at least being actively developed still -- it's quite new? Does the author ever drop in to these forums?

No, not really and it hasn't had an update since this spring. I still hope for multivalue support and no restarting foobar2000.
2E7AH
QUOTE (drmrbrewer @ Nov 12 2009, 16:50) *
OK, and to address the question of how to clean up a custom db to find and remove any old tags that are no longer referenced by any track in your collection? I'm guessing this is going to be difficult, so that you'll be left with a lot of "space debris" floating around in your database.

component can take care of that (database tab):
drmrbrewer
Thanks, guys.

QUOTE (odyssey @ Nov 12 2009, 17:21) *
To analyze all your existing files, create an autoplaylist with
CODE
FINGERPRINT_FOOID MISSING AND %length_seconds% GREATER 10


How do I create such a custom autoplaylist? I have so far only worked out how to do it from the Album List context menu, but that is tied to a branch in that list. I've been wondering how to create a completely free-form autoplaylist like the above.

Mike

Edit: Aha. Do you just right-click on the All Music (root) branch and create autoplaylist from there?
drmrbrewer
Now another question ;-)

I am moving towards a system where I have my own ratings embedded into tags in the file (let's say, in tag "mike rating").

And then each other user of my PC can listen to my music, and use my ratings by default, but they can also override my ratings with their own (stored in customdb under tag "user rating").

So, the logic is: if "user rating" exists, use that. Otherwise, use "mike rating".

I've worked out how to display this "combined" rating in a column, using this pattern:

$if(%user rating%,$repeat(●,%user rating%)$repeat(o,$sub(5,%user rating%)),$if(%mike rating%,$repeat(●,%mike rating%)$repeat(o,$sub(5,%mike rating%)),ooooo))

However, I now want to filter the users' autoplaylists based on this "combined" rating, too.

For just me (in my own account), I'd use the following in the filter:

%mike rating% GREATER 1

(since my highest rating is 3*)

However, what do I use as the filter for a "combined" rating for the user accounts? I can't see that you can use IF/THEN logic in the filter. Perhaps I need an auto-calculated field (calculate using the IF/THEN logic), and filter on that?

Thanks for any help!

Mike
Benji99
Hey guys, I have a question about this plugin,

When I first read about this, I got a really cool idea. I like to store lots of additional (and would like to store more) information about artists, composers, etc that are not vital. (For example artist date of birth, death, composer country, reviews, biographies, etc... into the Custom DB instead of directly to tags

I was thinking of using Python grabber scripts to get and store the information in the custom DB.
Can this be done fairly easily? Meaning I'd like the custom DB tags to act and behave somewhat like regular tags.

Thanks!
odyssey
QUOTE (Benji99 @ Nov 12 2009, 23:20) *
I was thinking of using Python grabber scripts to get and store the information in the custom DB.

That's a really cool idea! Actually you should be able to inject values directly in the db-file if you need to do external work (at least i managed to do so, even while foobar2000 was running using the official sqlite3.exe)

QUOTE (Benji99 @ Nov 12 2009, 23:20) *
Can this be done fairly easily? Meaning I'd like the custom DB tags to act and behave somewhat like regular tags.

They do happy.gif If you define a field with %composer_cd%, then it will show anywhere you use this tag (except for masstagger afair).
odyssey
QUOTE (drmrbrewer @ Nov 12 2009, 23:08) *
However, I now want to filter the users' autoplaylists based on this "combined" rating, too.

QUOTE (drmrbrewer @ Nov 12 2009, 23:08) *
However, what do I use as the filter for a "combined" rating for the user accounts? I can't see that you can use IF/THEN logic in the filter. Perhaps I need an auto-calculated field (calculate using the IF/THEN logic), and filter on that?

How about %mike_rating% GREATER 1 OR %user_rating% GREATER 1 ??? You should take a look at the help pages to understand the query-logic.
2E7AH
QUOTE (Benji99 @ Nov 13 2009, 00:20) *
I was thinking of using Python grabber scripts to get and store the information in the custom DB.

good idea
while sqlite3 module is included in python 2.5 (used by python grabber) it's not included in python grabber
however it works seamlessly, and I'll include it optionaly in my future/modified scripts based on key %album artist% %album% (%title%)
drmrbrewer
QUOTE (odyssey @ Nov 13 2009, 00:19) *
How about %mike_rating% GREATER 1 OR %user_rating% GREATER 1 ??? You should take a look at the help pages to understand the query-logic.


OK, I got it. The logic is not quite as you say, because if %user rating% has been set then it overrides %mike rating%, rather than adds to %mike rating%.

The following seems to do what I want:

(%user rating% GREATER 1) OR (%user rating% MISSING AND %mike rating% GREATER 1)

Incidentally, I make a distinction between "MISSING" and "EQUAL 0". If the user has explicitly set the user rating to 0, that is a positive statement that he/she doesn't like the track. If the user rating is just missing, it is probably just because the user hasn't got around to applying a rating yet (or is happy to accept my rating).

Mike
drmrbrewer
QUOTE (2E7AH @ Nov 12 2009, 18:00) *
QUOTE (drmrbrewer @ Nov 12 2009, 16:50) *
OK, and to address the question of how to clean up a custom db to find and remove any old tags that are no longer referenced by any track in your collection? I'm guessing this is going to be difficult, so that you'll be left with a lot of "space debris" floating around in your database.

component can take care of that (database tab):



Just tried this, and it doesn't seem to do anything to clear out unlinked data. I changed a track name so that it no longer matched the key in the database, and so that its custom rating vanished from display. No other tracks matched the old key either. So there is orphaned data in the database now. I ran the above tool, trying each of the three options, and the orphaned data remained. When I renamed the track to what it was, the rating came back.

So, I don't really think the above tool is for this purpose.

Mike
2E7AH
It doesn't say: "Remove entries without key", does it?
If you remove your custom tag field value or custom tag field itself, its db entry(ies) will gone when using the tool
drmrbrewer
QUOTE (2E7AH @ Nov 14 2009, 08:00) *
It doesn't say: "Remove entries without key", does it?


No, but I was only following your suggestion ;-)

QUOTE (2E7AH @ Nov 14 2009, 08:00) *
If you remove your custom tag field value or custom tag field itself, its db entry(ies) will gone when using the tool


Remove where? I'm really interested in finding and removing any data in the database that doesn't match to any key in any track in your collection, and I'm not sure anything yet suggested will enable this?

Mike

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.