Skip to main content
Topic: Spider Monkey Panel (foo_spider_monkey_panel) (Read 69066 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #376
Hi :) Some time ago with WSH Panel component, I was using the "Thumbs" script by marc2003.
It's a nice script that displays not only a main pic, but several thumbs of other pics that you can select by clicking on them, etc.. Plus it's really customizable (e.g. I could edit lines 10 & 11 to change data folder and subfolders format).
So of course my question is : is there some port or equivalent script that I could use with Spider Monkey ? Thanks !

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #377
Isn't this Marcs smp version of his thumb.js? (not using it myself)

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #378

So of course my question is : is there some port or equivalent script that I could use with Spider Monkey ? Thanks !

Yes Marc's old scripts are all ported to SMP and found in the default SMP install folder: foobar2000\user-components\foo_spider_monkey_panel\samples\complete

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #379
Got it :) Thanks MojoBass & mjm716 !

There is however one thing I can't get to work :
- With the old WSH script I could set a custom data folder, and then automatically download pics to that folder and subfolders. It worked perfectly.
- With the new SMP script I can set a custom folder structure (in my case it would be "D:\AUDIO\BIOS\artists\$meta(artist,0)"), and then the script displays the already existing pics... but there is no automatic download of new pics (e.g. when there are no pics yet, or where the number of existing pics is lower than the set limit).

If I change "Custom folder" to "Last.fm artist art" I see a "Download now" menu option, but :
- The download is manual, so I'd have to select "Download now" for every new song, which is painful for thousands of artists,
- The pics then get downloaded to %foobar folder%\js_data\artists\ , not to my custom folder.

Can I change this behaviour ? How ?

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #380
@wcs13 ,  marc2003 removed automatic download option (AFAIK people abused it by settings download limit too high, thus violating LastFM rules, which prompted LastFm to block marc's API key), you can probably restore it by comparing the old script with the new one and copying all the relevant changes.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #381
I've been thinking about this. Rather than removing auto-download, maybe this would have been more useful  in marc's script ?

Idea 1 :
- Define two api_key variables : m_api_key = marc's one (somewhere in the middle of the script), and user_api_key = empty (to be filled by the user at the beginning of the script)
- "Download now" would use m_api_key, but "Auto download" would use user_api_key, so it would result in an error until user enters a valid user_api_key
Sure, an evil user could always try to tweak the script into using m_api_key for autoDL, but very few users would go through the hassle. Easier to just get a personal API Key and copy it in the very first lines of the script.

Idea 2 :
An even stricter solution : just define a single user_api_key variable (empty), so no DLs at all until user enters a valid key. But once he does, autoDL would work too.

My point being : if you're a developer, please don't break script's functionality just because of some (ab)users. Stop giving the API Key if needed, but never break functionality.
It harms the good guys, while at the same time any abuser with JS knowledge could restore function using marc's previous WSH script and keep abusing it.

Anyway, I'll wait until somehow this function can be restored : I already have a personal API Key, but I know little about JS so I can't do all those changes on my own. :(

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #382
Anyway, I'll wait until somehow this function can be restored : I already have a personal API Key, but I know little about JS so I can't do all those changes on my own. :(

It could be a loooong wait. WilB's absolutely amazing SMP/Biography script has better downloading capabilities and customization than Marc's script. I use them both myself.
https://hydrogenaud.io/index.php?topic=112914.0

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #383
Last update of complete samples should be attached. Includes automatic download options for Thumbs script.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #384
@wcs13 , @mjm716 , actually marc2003 re-added automatic download to the `Thumbs` script yesterday (he also corrected my misinformation about LFM API key requirement: the script actually parses LFM site manually without using LFM API). But, regretfully, he deleted his GitHub account shortly afterwards =(

@mjm716, I would say that one should use WilB's Bio script if they need everything in a single panel, and use marc2003's scripts if they want to separate various functionality in multiple different panels (e.g. `thumbs` and `last.fm bio` scripts).

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #385
Last update of complete samples should be attached. Includes automatic download options for Thumbs script.
Thanks! (esp. for providing `.git` as well)

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #386
Hello,

Is there a way to disable the default context menu (and NOT replacing it with another) ?


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #387
Quote from: mjm716
It could be a loooong wait
Quote from: snotlicker
Last update of complete samples should be attached. Includes automatic download options for Thumbs script.
Quote from: TheQwertiest
actually marc2003 re-added automatic download to the `Thumbs` script yesterday
Wow guys, that was faster than I expected !  :))
I have indeed updated the SMP samples and now autoDL seems to work again. Thank you !  :)

One question though :
- In "last.fm artist art" mode, art is downloaded to %foobar folder%\js_data\artists
- In "custom folder" mode, art isn't downloaded to the defined custom folder (ex : "D:\AUDIO\BIOS\artists\$meta(artist,0)" ). It just doesn't seem to be downloaded anywhere.
Am I doing something wrong ?

I'd really like the art to be downloaded to my big storage D: drive, and not to my small system C: drive.
Besides, I have several portable foobar installs, and I'd like them all to share the same art folder in order not to download art multiple times.
As a last resort, maybe I could edit the script and change the the default %foobar folder%\js_data\artists. Any hints on what line(s) I should edit ?

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #388
Is there a way to disable the default context menu (and NOT replacing it with another) ?
Implement an empty `on_mouse_rbtn_up` callback that returns `true`. Corresponding docs: https://theqwertiest.github.io/foo_spider_monkey_panel/assets/generated_files/docs/html/module-callbacks.html#~on_mouse_rbtn_up


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #390
Greetings!
I am not good at scripting. I want to create a menu for switching DSP presets. There is a switching code for the output device, but when I replace with "fb.GetDSPPresets()" the menu remains the same.
Code: [Select]
function getDSPPresetsMenu(x, y) {
x = Buttons.top_l.left;
y = Buttons.top_l.top;

    var menu = window.CreatePopupMenu();
    var str = fb.GetDSPPresets();
    var arr = JSON.parse(str);
    var active = -1;
    for (var i = 0; i < arr.length; i++) {
        menu.AppendMenuItem(0, i + 1, arr[i].name);
        if (arr[i].active) active = i;
    }

    if (active > -1) menu.CheckMenuRadioItem(1, arr.length + 1, active + 1);

    var idx = menu.TrackPopupMenu(x, y);
    menu;

    if (idx > 0) fb.RunMainMenuCommand("Playback/DSP settings/" + arr[idx - 1].name);
}

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #391
Hello,

I'm having an issue with fb.IsMainMenuCommandChecked()

The code below allow me to successfuly change the settings - all the defined settings - but it fail to retrieve the state of the "Playback/order/..." stuff. II can't understand why. Foobar's bug or SMP's bug ?
Or me ?

Code: [Select]
		let menu = window.CreatePopupMenu();
let ent = ['Order/Default','Order/Repeat (playlist)','Order/Repeat (track)','Order/Random','Stop after current','Playback follows cursor','Cursor follows playback'];
for (var i = 0; i < ent.length; i++) {
menu.AppendMenuItem(MF_STRING, i+1, ent[i].replace('Order/',''));
if (fb.IsMainMenuCommandChecked('Playback/' + ent[i])) {
menu.CheckMenuItem(i+1, true);
}
if (i == 3){
menu.AppendMenuSeparator();
}
}
const idx = menu.TrackPopupMenu(x, y);
if (idx>0) {
fb.RunMainMenuCommand('Playback/' + ent[idx-1]);
}


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #393
Could somebody please answer this past question? Thank you  :)
- In "last.fm artist art" mode, art is downloaded to %foobar folder%\js_data\artists
- In "custom folder" mode, art isn't downloaded to the defined custom folder (ex : "D:\AUDIO\BIOS\artists\$meta(artist,0)" ). It just doesn't seem to be downloaded anywhere.
Am I doing something wrong ?

I'd really like the art to be downloaded to my big storage D: drive, and not to my small system C: drive.
Besides, I have several portable foobar installs, and I'd like them all to share the same art folder in order not to download art multiple times.
As a last resort, maybe I could edit the script and change the the default %foobar folder%\js_data\artists. Any hints on what line(s) I should edit ?

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #394
@kutuzof , regarding `GetDSPPresets()`: yep, that's a bug. Fixed in the nightly build.

@Smurth , regarding `IsMainMenuCommandChecked()`: yep, that's a bug as well - this command didn't work properly for menu items that are hidden by default. Fixed in the nightly build.

@wcs13 , in `custom folder mode` images are loaded from the folder provided by user, so it doesn't download anything.
Folders for all marc's scripts are defined in `js\helpers.js` (search for `let folders = {};`). Beware that changing these paths will affect all scripts that are using said paths.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #395
@kutuzof , regarding `GetDSPPresets()`: yep, that's a bug. Fixed in the nightly build.

Hi @TheQwertiest , concerning this GetDSPPresets() function, I can see that it is listed in the autocomplete entries, but I cannot find any reference in the docs.  If it wasn't for @kutuzof 's post, I wouldn't know about it. Am I missing some source of information?
I'm late

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #396
Am I missing some source of information?
Yep, you should've read it from my mind :D
Anyways, it's indeed missing from docs. I'll add it soonish.



Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #399
@wcs13 , in `custom folder mode` images are loaded from the folder provided by user, so it doesn't download anything.
Folders for all marc's scripts are defined in `js\helpers.js` (search for `let folders = {};`). Beware that changing these paths will affect all scripts that are using said paths.
It all works perfectly now. You made my day ! :D
I'll remember that other scripts may use those paths, but so far I'm only using Marc's Thumbs and WilB's bio.

 
SimplePortal 1.0.0 RC1 © 2008-2020