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: WSH Panel Mod script discussion/help (Read 1399797 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #475
Hey all, I have a quick question I hope someone can help me with.  I'm trying to use the UpdateFileInfoSimple function to write data to some of my file tags, but I occasionally receive the following error when the file being changed is currently playing:

Code: [Select]
Could not update tags (Sharing violation) on: 
"<filename>"


It doesn't happen all the time, but when it does it's annoying.  Is there any way to suppress this error message?  Thanks.

WSH Panel Mod script discussion/help

Reply #476
you'd get the same dialog if you tried updating the tags manually. there's nothing i don't think there is anything you can do in WSH panel mod to suppress it.

of course, you could look at what's locking the files in the first place. maybe some other components or 3rd party programs??

WSH Panel Mod script discussion/help

Reply #477
Whatever is locking the files is only temporary.  If I try re-running the script after getting that error it almost always works.  So there's no way in WSH Panel Mod to test whether a file is locked?

WSH Panel Mod script discussion/help

Reply #478
Whatever is locking the files is only temporary.


so you have an idea what it is? this is what you need to look at to prevent the errors.

like i said, the message you're seeing is a standard foobar dialog so as far as WSH panel mod is concerned, the "UpdateFileInfoSimple" function has run successfully.

WSH Panel Mod script discussion/help

Reply #479
No I don't, but I guess I'll have to figure it out.  I just figured that foobar was locking it because it was currently playing.  I guess that's not the case.  Thanks for your help.

WSH Panel Mod script discussion/help

Reply #480
i've made scripts that can update the tags of the currently playing file so it's definitely not that.

WSH Panel Mod script discussion/help

Reply #481
marc2003, I think your samples zip is missing a few files. All I see is the pdf and the v2 folder.

WSH Panel Mod script discussion/help

Reply #482
i just checked and you're right. i have no idea what happened there. anyway, i've updated it....

 


WSH Panel Mod script discussion/help

Reply #485
Something I would like to see: A script that allowed me to love/unlove/ban/unban tracks on last.fm. These api calls do exist and if fb2k had them, it would put it above all other last.fm compatible players.


WSH Panel Mod script discussion/help

Reply #487
So does anyone feel like taking marc2003's "thumbs 2" and turning it into a graphical browser for the media library... 

WSH Panel Mod script discussion/help

Reply #488
there is already EsPlaylist which can browse the library and show covers. it's impossible for WSH panel mod to do anything like that.

WSH Panel Mod script discussion/help

Reply #489
thumbs / thumbs2 bugfix. ' ( ) [ ] weren't handled correctly in custom folder mode.
Hey, thank you for constantly improving your script.

but...

this doesn't work anymore:
Code: [Select]
$replace(%path%,%filename_ext%,)Cover

something bad from my side, that i should now change?

WSH Panel Mod script discussion/help

Reply #490
doh, i'm an idiot. i'll have to revert back to how it was before.

http://cid-649d3bfeaf541fbb.office.live.co...ide/samples.zip

if your folder path contains those characters '()[], they'll have to be escaped manually much like when you want to display them when using foobar normally.


WSH Panel Mod script discussion/help

Reply #492
i was messing about using absolute folder paths which had () in the name. i made that change totally forgetting it would break anything using title formatting functions. 

edit: BTW i uploaded another new version earlier. it contains a bugfix for the "thumbs" script only. "cycle" mode was broken but now it's fixed.

WSH Panel Mod script discussion/help

Reply #493
Marc, I'm playing with your scripts and I have one quick question: in the rating script, how would I go about aligning the stars to the center of the panel?

WSH Panel Mod script discussion/help

Reply #494
Marc, I'm playing with your scripts and I have one quick question: in the rating script, how would I go about aligning the stars to the center of the panel?




put this line to function on_size

left_margin = ww/2-bw*5/2;

like this

function on_size() {
   ww = window.Width;
   wh = window.Height;
    left_margin = ww/2-bw*5/2;
}

WSH Panel Mod script discussion/help

Reply #495
Great, thank you!

WSH Panel Mod script discussion/help

Reply #496
i've just uploaded a new version of the rating script as well. it's centered horizontally and vertically and the hover effect only responds when actually over the stars as opposed to the whole panel like it was before.

EDIT: just uploaded another new version. it now checks if foo_playcount is installed and will prompt you if it isn't.

WSH Panel Mod script discussion/help

Reply #497
I would like to know if someone can help me : I try to measure the width of a string that contains \n :

var txt = "line 1\nline2";

I tried with CalcTextWidth but it returns the width of line 1 + line 2 but I'd like to obtain the value of the greater line ! I tried also with CalcTextHeight but I don't understand how it works and can't find samples here !!

WSH Panel Mod script discussion/help

Reply #498
split the text into an array like this...

Code: [Select]
var some_text = "some text\nsome more text";
arr = some_text.split("\n");

arr[0] //some text
arr[1] //some more text


you could loop through the array and check the length of each line and keep the longest one.

WSH Panel Mod script discussion/help

Reply #499
Thank you Marc ! Works fine