Skip to main content

Topic: WSH Panel Mod script discussion/help (Read 839420 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1900
1) can't reproduce.

screenshot

the line you reference is completely unrelated so you must be using a slightly outdated version. next time, can you post what code is on the line you mention.

all i can suggest for now is to browse your foobar profile\wsh_lastfm folder in windows explorer and search for and delete all .json files. this will clear all cached files and force a fresh download.

2) i think perhaps you've customised your context menu to hide the playback statistics\rating entries?? you can leave those settings as they are as i can get around that.

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

file changed:
Code: [Select]
marc2003\common6.js

  • Reith
  • [*]
WSH Panel Mod script discussion/help
Reply #1901
I deleted the .json files and it doesn't crash anymore.

And the rating feature works just fine now with that update.  Thank you!
  • Last Edit: 28 November, 2012, 04:47:58 PM by Reith

WSH Panel Mod script discussion/help
Reply #1902
marc2003: the "open image" menu item in your thumbs script has stopped working.

didn't double-click used to open the image too?



thanks for your efforts, i appreciate the work you do and the scripts you share for the foobar2000 community!

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1903
with my old scripts, a single click used to open the main image. with these updated versions, it now requires a double click. the context menu is working fine for me so it should be working as you expect???

the only instance where double clicking does not work is in grid mode and you have an image overlaid on top of the background thumbnails. because that requires a single click to "close" the image, i've disabled the double click action there.

edit: thinking about it, something may have gone wrong with the file associations on your system. all my script does is launch the full path of the file and it's upto windows to decide what program to use based on the file extension. i'd look into that if i was you.
  • Last Edit: 30 November, 2012, 04:36:29 AM by marc2003

WSH Panel Mod script discussion/help
Reply #1904
Thanks for the comments. Nothing wrong with file associations. Images open as expected in explorer and elsewhere.

Open containing folder works in the context menu, and I can open images from there.

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1905
you can browse the marc2003 folder and edit common6.js in a text editor.

on line 798, replace

Code: [Select]
    this.run = function(command) {
        try {
            this.WshShell.Run(command);
        } catch(err) {
        }
    }


with

Code: [Select]
    this.run = function(command) {
            this.WshShell.Run(command);
    }


see what error you get after saving it and reloading the panel. i'd restore the previous function when done testing as well.

WSH Panel Mod script discussion/help
Reply #1906
you can browse the marc2003 folder and edit common6.js in a text editor.

on line 798, replace

Code: [Select]
    this.run = function(command) {
        try {
            this.WshShell.Run(command);
        } catch(err) {
        }
    }


with

Code: [Select]
    this.run = function(command) {
            this.WshShell.Run(command);
    }


see what error you get after saving it and reloading the panel. i'd restore the previous function when done testing as well.


Code: [Select]
Error: WSH Panel Mod (Thumbs by marc2003): The system cannot find the file specified.  File: D:\Apps\No Install\Audio\Players\foobar2000 DUI\marc2003\common6.js
Ln: 799, Col: 13


  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1907
i think i forgot to handle paths with spaces in, try this.

Code: [Select]
    this.run = function(command) {
        try {
            this.WshShell.Run("\"" + command + "\"");
        } catch(err) {
        }
    }


edit:

samples updated with above fix and also a fix for buggy scrolling behaviour in thumbs script.

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

files changed:
Code: [Select]
marc2003\common6.js
  • Last Edit: 04 December, 2012, 05:15:23 AM by marc2003

WSH Panel Mod script discussion/help
Reply #1908
Working, thanks for the fix 

  • morphguy12
  • [*][*]
WSH Panel Mod script discussion/help
Reply #1909
Hey marc, definitely loving your samples! 
Just have a quick questions, where would I start if I wanted to attach similar artists' pictures next to the names on your panel?  I would ultimately like it to auto download them as well like your nowplaying panel too.

Definitely appreciate any input / help...  I'll do the dirty work, I just wanted to pick your brain.
Thanks!!!

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1910
i really don't want to encourage hitting last.fm for loads of artists at once. they've already removed documentation from their api for the artist.getimages method. it still works for now but it's not too encouraging for the future.

i'll explain how to access images you have cached already later. i don't have time right now.

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

there is now an Online update feature on the context menu. as my scripts all now use an external file for the main code, it can update this when triggered. you will be prompted to restart foobar2000 when the download is complete.

files changed:
Code: [Select]
marc2003\common6.js
samples\*.txt (added version numbers to all panels)

  • Last Edit: 05 December, 2012, 05:18:45 AM by marc2003

  • morphguy12
  • [*][*]
WSH Panel Mod script discussion/help
Reply #1911
gotcha, thanks Marc, I wasn't aware of that.
I only need the top three similar artists though, so if that's too much of a load I'll try and just have it look in the wsh_lastfm folder.

Thanks again!

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1912
samples updated: http://dl.dropbox.com/u/22801321/samples.zip

thumbs: bug fix, quite a serious one.  all image related context menu items would not show if no images in folder.

files changed:
Code: [Select]
marc2003\common6.js


if you're using a new version of my scripts (since 5th dec), you can use the Online update feature on the context menu to avoid downloading the full zip.

  • MordredKLB
  • [*][*][*]
WSH Panel Mod script discussion/help
Reply #1913
If this doesn't exist already somewhere let me know and I'll write my own, but does anyone have a ContextMenu setup to do playlist rating?

I'm looking for something like this, but the "Library" menu doesn't have it built in:

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1914
note for users of my playcount sync script: a "fix" i posted in this thread on the 5th december script broke the library import function. use the Online update option on the context menu to fix it.
  • Last Edit: 08 December, 2012, 05:29:39 AM by marc2003

  • morphguy12
  • [*][*]
WSH Panel Mod script discussion/help
Reply #1915
Hey Marc anyway you've got an extra second to start me off for adding pictures to your similar artists code? 
Also to limit the fetch to just 3 artists with their pictures?

Definitely appreciate any help!
Thanks!

  • neothe0ne
  • [*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1916
So does anyone know why the sample scripts MainMenuManager All-In-One.txt and MainMenuManager.txt do not always give you all the menu options?  The "View" file menu especially cuts off at an arbitrary point somewhere in the middle.
  • Last Edit: 09 December, 2012, 07:42:10 PM by neothe0ne

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1917
@morphguy12, make sure you download the latest common6.js to your pc. use Online update on the context menu or extract from the full zip if you don't have that option.

i haven't tested this and also there is quite a major flaw with how i designed my original code for my image scripts. because the artist name source was always your file tags, the case didn't seem important as i thought it was something that isn't going to change. but downloading artist names from last.fm probably isn't going to match your tags 100% of the time.

in your simliar artist panel:

Code: [Select]
images = [];

function on_metadb_changed() {
    if (li.metadb_changed()) {
        //li.metadb returns true or false depending on whether the artist has changed. we don't want to update if the artist hasn't changed.
        images = [];
        files = [];
        for (i = 0; i < Math.min(3, li.items); i++) {
            files[i] = [];
            var folder = p.data_folder + p.eval("$crc32(" + li.names[i] + ")");
            if (p.fso.FolderExists(folder)) files[i] = files[i].concat(utils.Glob(folder + "\\*.jpg").toArray(), utils.Glob(folder + "\\*.jpeg").toArray(), utils.Glob(folder + "\\*.png").toArray(), utils.Glob(folder + "\\*.gif").toArray());
            if (p.fso.FileExists(files[0])) images[i] = gdi.Image(files[0]);
        }
        window.Repaint();
    }
}


then inside the on_paint function, you should have an array called images to use. images[0] being the first, images[1] the second and images[2] the third...

@neothe0ne, never had a problem with the menu not displaying properly.

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1918
samples updated: use Online update or download the full package. http://db.tt/BInQ3Abm

musicbrainz: bugfix, it never checked for new releases. 

files changed
Code: [Select]
marc2003\common6.js

  • morphguy12
  • [*][*]
WSH Panel Mod script discussion/help
Reply #1919
@morphguy12, make sure you download the latest common6.js to your pc. use Online update on the context menu or extract from the full zip if you don't have that option.

i haven't tested this and also there is quite a major flaw with how i designed my original code for my image scripts. because the artist name source was always your file tags, the case didn't seem important as i thought it was something that isn't going to change. but downloading artist names from last.fm probably isn't going to match your tags 100% of the time.

in your simliar artist panel:

Code: [Select]
images = [];

function on_metadb_changed() {
    if (li.metadb_changed()) {
        //li.metadb returns true or false depending on whether the artist has changed. we don't want to update if the artist hasn't changed.
        images = [];
        files = [];
        for (i = 0; i < Math.min(3, li.items); i++) {
            files[i] = [];
            var folder = p.data_folder + p.eval("$crc32(" + li.names[i] + ")");
            if (p.fso.FolderExists(folder)) files[i] = files[i].concat(utils.Glob(folder + "\\*.jpg").toArray(), utils.Glob(folder + "\\*.jpeg").toArray(), utils.Glob(folder + "\\*.png").toArray(), utils.Glob(folder + "\\*.gif").toArray());
            if (p.fso.FileExists(files[0])) images[i] = gdi.Image(files[0]);
        }
        window.Repaint();
    }
}


then inside the on_paint function, you should have an array called images to use. images[0] being the first, images[1] the second and images[2] the third...

@neothe0ne, never had a problem with the menu not displaying properly.


Thanks so much Marc,
Unfortunately I can't get any images to show under paint no matter what kind of code I put in there,

I'll keep trying, but have any suggestions?

Thanks!!

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1920
i'll try and test something over the next few days. the reason i didn't test before that is because i don't have any art to test with. i'm behind a proxy so i can't use the program i bundle with my script. i'll have to grab a few images manually.

samples updated: use the Online update feature on the context menu or download the full zip here. http://db.tt/BInQ3Abm

last.fm biography: bugfix - last.fm logo button didn't work

  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1921
samples updated: use the Online update feature on the context menu or download the full zip here. http://db.tt/BInQ3Abm

simple seekbar /  nyan cat seekbar: bugfix - tooltip only worked on first hover then stopped working after mouse had left area.

files changed:
Code: [Select]
marc2003\common6.js



  • marc2003
  • [*][*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1922
I'll keep trying, but have any suggestions?


there were loads of errors in that. i tested this one...

http://dl.dropbox.com/u/22801321/morphguy12.txt



the placeholder for artists that don't have images should already be on your system as it's bundled in the zip. obviously this was a quick bodge - you can mess around with placement yourself.

  • kaloian79
  • [*]
WSH Panel Mod script discussion/help
Reply #1923
I have one silly problem - i can't add user picture for genre in the script - now playing with last.fm bio. place help me. tenx.

  • neothe0ne
  • [*][*][*][*]
WSH Panel Mod script discussion/help
Reply #1924
I want to create a button which runs a command from the Edit menu.
e.g., fb.RunMainMenuCommand("Edit/...");

I found plman.SetActivePlaylistContext(), however, I want to set the active focused playlist to a specific viewer.  (I want it to select my SimPlaylist instead of my ElPlaylist).  Is this possible?
  • Last Edit: 13 December, 2012, 10:44:45 PM by neothe0ne