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 1406464 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #975
there was a problem with the original version where it would hang if the artist wasn't found. but i fixed that over a year ago.

WSH Panel Mod script discussion/help

Reply #976
I got the one from your latest samples.zip. Can't pinpoint the cause, it just seems to "time out" sometimes. Next time it happens I'll let it stay on and see if it finishes over time.

WSH Panel Mod script discussion/help

Reply #977
Does anybody know any way to merge two playlists using wsh panel mod? I have tried several things, but nothing seems to work. There is no dedicated method in IFbUtils and a sequence of fb.RunMainMenuCommand("Select all"), fb.RunContextCommand("Copy") and fb.RunContextCommand("Paste") does not work. Another strange thing is that fb.GetSelections() after fb.RunMainMenuCommand("Select all") only works with some delay and then only if the window is focused. Any suggestions are very welcome!


WSH Panel Mod script discussion/help

Reply #978
Marc, think I found a bug in your similar artists script. It crashes if no similar artists found. Tried fetching list for artist "Groy" (http://www.last.fm/music/Groy), which is misspelled (should be GR-OY).
Code: [Select]
Error: WSH Panel Mod (Similar Artists by marc2003): Microsoft JScript runtime error:
'artists[...].name' is null or not an object
Ln: 74, Col: 5

similar.json contains:
Code: [Select]
{"similarartists":{"#text":"\n","artist":"GrOy"}}


WSH Panel Mod script discussion/help

Reply #980
I noticed that in the newest versions of your scripts scrolling with mouse wheel works nicely so that the arrow up and down buttons are not necessary anymore. Can you make them optional or at least give me a hint where to take a look in your script to remove them on my own. My first attempt resulted in crashing the script.

WSH Panel Mod script discussion/help

Reply #981
scrolling has always been there - the up/down arrows are a relatively new addition.

anyway, the easiest way is to find the on_size function and change the value for but_x

Code: [Select]
but_x = -50;


should do it.

also, i just fixed a typo in last.fm charts that would it to crash if you entered an invalid username - but then again it serves people right who can't spell it anyway....

WSH Panel Mod script discussion/help

Reply #982
Hmm, i think the problem i meant still exists and i can explain why i thought it was removed. Maybe it depends of my mouse wheel that doesn't lock or latch (sorry, don't found better words on leo dictionary) The less the speed of scrolling the bigger the probability that scrolling has no effect: I have to scroll quickly for an effect what i generally do.

Edit

It seems to be a problem with my mouse! In facets with coverview i have the same phenomen. I could swear that i didn't had the phenomen with facets coverview or with your scripts for quite a time. However, i decided to by a new one because the missing locking/latching annoys me extremely.

WSH Panel Mod script discussion/help

Reply #983
Marc, having a problem with the custom folder mode of your thumbs2 script.

Absolute path that has brackets (like E:\Music\B-C\Calibre\[2010] Even If) doesn't seem to work.

WSH Panel Mod script discussion/help

Reply #984
oh FFS. i did write a function to take care of reserved characters in foobar title formatting but i forgot to use it..... 

on line 111 replace this....

Code: [Select]
folder = fb.TitleFormat(cycle_tf).EvalWithMetadb(g_metadb);


with

Code: [Select]
folder = fb.TitleFormat(tf(cycle_tf)).EvalWithMetadb(g_metadb);


i'll upload fixed versions for all my image scripts soon.

EDIT: fixed versions uploaded. this change means you can't use functions in title formatting so i've updated the text dialog as follows:

Quote
Enter a path to a folder. You can use title formatting tags like %artist% but not functions.

You can specify multiple folders using | as a separator.

         


WSH Panel Mod script discussion/help

Reply #985
i've decided to reverse my decision above and go back to how it was before. that way full title formatting functions can be used and if you want to include ()[] in your path then just wrap them in single quotes.

WSH Panel Mod script discussion/help

Reply #986
another update for last.fm charts. panel would crash if last.fm didn't respond as expected. i really hope i've sorted this once and for all.

in theory, no matter what last.fm does now, none of my panels should crash (i fully expect this statement to come and bite me on the behind hard  )

http://dl.dropbox.com/u/22801321/samples.zip


WSH Panel Mod script discussion/help

Reply #987
Hehe I'm trying hard to find more bugs.  And good call on the decision with reserved chars, rather use functions than absolute paths anyways.

Btw added couple of features to my panels which you might be interested in also. An auto download conditional option (auto_download_lib) to check if the file is in media library, as I don't want to fetch for new files. Maybe add some kind of "delete last.fm data if the artist has not been seen for X days" function?
Code: [Select]
function on_playback_time(time) {
    if(cycle > 0 && arr.length > 1 && (time % cycle == 0)) on_mouse_wheel(-1);
    if(window.GetProperty("auto_download_lib") && !fb.IsMetadbInMediaLibrary(g_metadb)) return;
    if(window.GetProperty("mode") == 101 && time == 1 && arr.length == 0 && window.GetProperty("auto_download")) download_images();
}

And changed the thumbs scaling method to keep original size for small images, unless "Stretch small images to panel size" (scale) option is checked
Code: [Select]
var s = 1;
if (window.GetProperty("scale") || img.width >= width || img.height >= height)
    s = Math.min(width / img.width, height / img.height);
var nw = Math.round(img.width * s);
var nh = Math.round(img.height * s);
pos_x += Math.round((width - nw) / 2);
pos_y += Math.round((height - nh) / 2);

WSH Panel Mod script discussion/help

Reply #988
Marc, an observation and suggestion:

I noticed when playing internet radio stations in Foobar that my Artist information panel (foo_uie_biography set to display artist information from last.fm or wikipedia) and my lyrics panel (foo_uie_lyrics2 set to display lyrics from viewlyrics.com and lyrdb.com) both were able to capture information from what was playing to correctly display the proper information. 

I also had your scripts running for lyrics, thumbs3, similar artists, and news/reviews/blogs, and I did not see those display content related to what was playing.  Your scripts didn't crash, they just displayed "[no image]" for Thumbs3, "nothing found" for News etc, Lyrics displayed the song name and artist correctly but never any lyrics, and Similar Artists tried to find artists that matched with "?".

It's far beyond my abilities to revise your scripts to have them grab the appropriate information from internet radio playback to work when listening to internet radio, but it would be great if you could consider such capabilies in the future.  My optimism tells me that if the older components could do this, perhaps this is not a big deal to add to your scripts (other than Lyrics, since your script works locally and the component can download) but I'm not technically proficient in these matters.

Thanks again for some very useful scripts!

WSH Panel Mod script discussion/help

Reply #989
can you link me to a station so i can test?

edit: you could just try adding this function anywhere in a script and see if it works.

Code: [Select]
function on_playback_dynamic_info_track() {
    on_item_focus_change();
}

WSH Panel Mod script discussion/help

Reply #990
Thanks for the fast reply.  I inserted the code such that I'm confident I didn't put it into the middle of an existing function, and here's what I observed both after hitting "apply", and after exiting and reopening Foobar just in case that mattered:

lyrics - didn't try, since I have no local information for the script to work with
News, etc, Similar Artists, and Thumbs3 - no change - same result as before.

I could briefly see that Thumbs3 tried to fetch images because that flashes on the screen for a second before returning "no image".


How I play an internet radio station:

- in Foobar, go to File>Preferences>Shell Integration>manage file type associations>, check the box for .pls files
- go to shoutcast.com
- go to "help", "settings", and select "play shoutcast stations in default media player"
- find a radio station you want to hear, click on it, and save the .pls file locally
- in Foobar, create a playlist and load this .pls
- double click on the playlist to stream it

an example link:

http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200


WSH Panel Mod script discussion/help

Reply #992
I tried thumbs3, Similar Artists, and News-Reviews-Blogs - all perform perfectly.  Very impressive - thanks!


WSH Panel Mod script discussion/help

Reply #994
samples updated: http://dl.dropbox.com/u/22801321/samples.zip

the following scripts have been updated to support dynamic info in radio streams.

news-reviews-blogs
similar artists
simple biography
thumbs
thumbs2
thumbs3


existing users make sure you extract the marc2003 folder again and overwrite all files.

WSH Panel Mod script discussion/help

Reply #995
The latest updates from post #995 all crash or fail to update with radio stations.  The test scripts from post #992 still work with radio stations.

WSH Panel Mod script discussion/help

Reply #996
did you extract the marc2003 folder again as my post explicitly says? i did test before uploading...

one thing i did break with the last update is the ability to switch between last.fm and custom folder mode in the thumbs/thumbs2/thumbs3 scripts.

i've now merged them all into one script (simply thumbs) where you can select the thumbnail view. it wouldn't surprise me in the slightest if i've broken a load of stuff though.



EDIT2: oh balls. samples taken offline while i fix a major balls up.

WSH Panel Mod script discussion/help

Reply #997
I extracted and overwrote everything as you instructed.  I also just tried deleting everything and then extracting and importing again in case overwriting wasn't happening - same crash results.  Thanks for your efforts!

WSH Panel Mod script discussion/help

Reply #998
i've just taken the download offline because they are seriously messed up. they're not crashing though - but they are creating folders where they're not supposed to. if you use foobar in standard mode, check %appdata%\foobar2000 and delete all randomly numbered folders (or if portable mode, check your foobar folder).

WSH Panel Mod script discussion/help

Reply #999
hopefully fixed it  http://dl.dropbox.com/u/22801321/samples.zip

just to be absolutely sure of a clean setup:

extract the marc2003 folder and overwrite all files when prompted
before importing the script into a panel, first use tools>reset default and close the editor. now right click>properties and click clear
now import the script.

edit: *sigh* custom folder mode still not working as expected.