Hydrogenaudio Forums

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: kgena_ua on 2017-11-19 07:05:02

Title: Rating panel
Post by: kgena_ua on 2017-11-19 07:05:02
Rating panel
Title: Re: Rating panel
Post by: kgena_ua on 2017-11-19 10:31:02
@marc2003,
did I make the right thing to edit tags for  jscript panel v1.3.0,
if you are viewing my posts
Title: Re: Rating panel
Post by: always.beta on 2017-11-19 12:48:02
I think it's better.
1. Click on the same location to cancel the rate mark instead of "db". 2. Add title artist Information Display 3.Highlight when the mouse hovers over the stars
Title: Re: Rating panel
Post by: jazzthieve on 2017-11-19 13:50:27
Small request, the ability to color code each rating value. I usually have my ratings color coded from cold colors to warm the higher the rating is (5 is red while 1 is dark blue and the rest is something in between those colors).
Title: Re: Rating panel
Post by: marc2003 on 2017-11-19 15:12:43
I don't think checking file attributes is necessary. Anyone using a script to write tags should take on the responsibility to make sure they're writeable.

Not tested but you could rewrite your function something like this...

Code: [Select]
function setRating(){
if ((nrating != rating) && metadb) {
var items = plman.GetPlaylistSelectedItems(plman.ActivePlaylist);
if (rating_mode == 0) {
//fb.RunContextCommandWithMetadb supports handle or handle list so no need to loop
fb.RunContextCommandWithMetadb("Playback Statistics/Rating/" + (nrating == 0 ? "<not set>" : nrating), items);
} else if (rating_mode == 1) {
var value = nrating == 0 ? "" : nrating;
if ("UpdateFileInfoFromJSON" in items) { // JScript Panel 1.3+
items.UpdateFileInfoFromJSON(JSON.stringify({
"rating" : value
}));
} else if ("UpdateFileInfoSimple" in items) { // JScript Panel v1.0.6 - v1.2.4 support UpdateFileInfoSimple for handle lists
items.UpdateFileInfoSimple("rating", value);
} else { // must be ancient JScript Panel or WSH panel mod, we need to loop and use the handle method
for (var i = 0; i < items.Count; i++) {
items.Item(i).UpdateFileInfoSimple("rating", value);
}
}
}
items.Dispose();
rating = nrating;
}
}

You could remove the setMetaRating function.
SimplePortal 1.0.0 RC1 © 2008-2019