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_rating100 - ratings out of 100 (Read 1036 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_rating100 - ratings out of 100

This component stores ratings on a scale of 0-100 inside the foobar2000 database alongside a timestamp of when the rating was last changed.  (It's really not much more than a modification of the SDK sample component.)  I made this a long time ago because foo_playcount only stores ratings on a scale of 1-5 (which isn't granular enough for the way I use my library) and because I also want the rating timestamp to be available for sorting/searching.

The metadb_io_edit_callback hook is implemented, and ratings are binded to tags as follows:
Code: [Select]
$lower(%artist%$tab()%album%$tab()$if(%discnumber%,%discnumber%,1).%tracknumber%$tab()%title%)

This adds the following 2 fields:
%foo_rating100% - The rating, which is either <none> (initial value) or a number between 0 and 100
%foo_rating100_timestamp% - The timestamp that the rating was last touched.

This adds the following 26 context menu commands inside a "Rating/100" folder, intended to be binded to keyboard shorcuts:
1. 21 commands for "Rate n", where n is every multiple of 5 from 0 to 100
2. 2 commands for +/-1 and 2 commands for +/-5
3. 1 command for "Erase Rating" (where <none> is separate from a rating of 0)

This also adds a main menu command for dumping the ratings database as tuples of the database hash, the rating, the timestamp, and the matching filepath(s).  (However, this is of limited use currently, as there is no import function.)

If there is interest in this component, I'd like to find someone more familiar with the foobar2000 component SDK to maintain it.  (Or better yet, convince Peter to put these features directly into foo_playcount.)

Re: foo_rating100 - ratings out of 100

Reply #1
Visual rating title formatting (also sortable):
Code: [Select]
$if(%foo_rating100%,$repeat(█,$div(%foo_rating100%,20))$select($mod($mul($div(%foo_rating100%,5),5),4),▎,▌,▊)$ifgreater($mod(%foo_rating100%,5),0,▏,)$ifgreater(%foo_rating100%,4,,▏) %foo_rating100%,)
This makes use of block characters which are not rendered correctly in all contexts.  You will want to use a font that is not monospaced to join them together.  It works for me in foobar2000 as a search column / playlist view column.