Skip to main content
Topic: Biography Discussion (Read 89546 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Biography Discussion

Reply #550
Hi, does somebody know if @WilB is still active, or if somebody else is carrying on with this great project ? Thanks !
Hi, just wanted to say again how wonderful this script is !  :D

However, at the moment I'm only using it for displaying bios, and I'm using marc2003's Thumbs script for displaying artist pics.
The reason is in these two pics (see attached pics).

If someday @WilB could add this function to his script, I would be very grateful and happy to use only one script for all my purposes.

Thanks in advance !

Re: Biography Discussion

Reply #551
I found a strange issue when it will not write tags (shift-rt click, "write tags to selected tracks") to artist names with special characters. e.g. Altın Gün  (note the i + u)

Re: Biography Discussion

Reply #552
I have noticed that downloaded images are often low-res, even when there are lots of hi-res images for the same artist on last.fm.
For some artists there are hundreds of images available, but the component just seems to pick the first ones.
Is there an option to either favor hi-res images, or the most upvoted ones, or to set a minimum res ?
If not, it would be a nice add-on. Thanks !

Re: Biography Discussion

Reply #553
I've stumbled upon some new odd behavior related to Auto-Save.

In my biography.ini file, I have:

Code: [Select]
[COVERS: MUSIC FILES]
Auto-Save=1
Auto-Save Folder=$directory_path(%path%)
Auto-Save File Name=cover

I believe the intended behavior is that cover.png file will be saved in the folder of the track.  That seems like a swell idea.  It works fine when the path of the track is on the local machine.  However, when the path of the track is a UNC path to a another machine (example:  "\\myServer\music\01.flac", the cover.png file is actually getting stored to "D:\_\myServer\music\cover.png".  It is creating that entire path.  "D:" happens to be the local drive that contains my portable Foobar2000 directory in a sub directory.

I tried changing the Auto-Save Folder to "$replace(%path%,%filename_ext%,)" but that did not resolve the problem.

At some earlier point, cover.png was not saved at all for UNC paths.  This behavior started in recent weeks.

(Foobar2000 1.5.2, Spider Monkey Panel 1.2.3, Biography 1.1.3, Windows 10 1909)

Any thoughts?

Re: Biography Discussion

Reply #554
I'm not picking this script apart but I can confirm there is no issue saving to UNC paths. You can try it at the most basic level yourself with a blank panel and this code snippet - just adjust the filename and then double click the panel to run the code. It leaves a command prompt window open which would show any errors.

Code: [Select]
// backslashes must be doubled up
var filename = "\\\\nausicaa\\music\\foxes.jpg";

var WshShell = new ActiveXObject('WScript.Shell');

function on_mouse_lbtn_dblclk() {
    WshShell.Run("cmd /k cscript //nologo \"" + fb.ProfilePath + "yttm\\foo_lastfm_img.vbs\" https://lastfm.freetls.fastly.net/i/u/aaa9574806bdfad3eb7168c21aca09de \"" + filename + "\"");
}

edit: here's an example of an error you'd get if the share was read-only





I'm using Windows 10 2004 but that shouldn't make any difference.

Re: Biography Discussion

Reply #555
I'm not picking this script apart but I can confirm there is no issue saving to UNC paths. You can try it at the most basic level yourself with a blank panel and this code snippet - just adjust the filename and then double click the panel to run the code. It leaves a command prompt window open which would show any errors.

Thanks for the assistance, snotlicker!

Your suggestion helped me eliminate Spider Monkey Panel and Foobar as sources of the problem. 

Instead I picked apart "Biography 1.1.3.js" and found this line in cleanPth(), part of line 519, and confirmed it is the source of the problem:
Code: [Select]
while (pth.includes("\\\\")) pth = pth.replace(/\\\\/g,"\\_\\"); 

Commenting that out stopped making the fake path "D:\_\", but did not result in the artwork being saved to the UNC path either.  Before I debug further, I will wait for the Biography maintainers to respond, since this function is used many times in the program, and I'm not familiar with all of the scenarios.

Re: Biography Discussion

Reply #556
@quah
I'll take a look.

@mjm716
Tag writer normalises names toUpperCase(), so artists of same spelling but are of different case are treated the same. I thought windows file handling was case insensitive, but as you can see below the file saved as Altın Gün isn't found after converting to upper case.

Code: [Select]
Z:\fb2k15\yttm\biography\lastfm\a\Altın Gün.txt File Exists true
Z:\fb2k15\yttm\biography\lastfm\a\ALTIN GÜN.txt File Exists false

I can probably remove the case check. Possibly it could also be related to exotic character handling in SMP, since the standard fso.FileExists(f) is used for the check.

Re: Biography Discussion

Reply #557
@quah

I don't have a device with UNC paths, so please can you try replacing all of the two following lines.

Replace line 15 [buildPath...] with:
Code: [Select]
buildPth : pth => {console.log("buildPth input pth", pth); let result, tmpFileLoc = "", UNC = pth.startsWith("\\\\"); if (UNC) pth = pth.replace("\\\\", ""); console.log("UNC",UNC); const pattern = /(.*?)\\/gm; while ((result = pattern.exec(pth))) {tmpFileLoc = tmpFileLoc.concat(result[0]); if (UNC) {tmpFileLoc = `\\\\${tmpFileLoc}`; UNC = false;} console.log("buildPth output tmpFileLoc",tmpFileLoc); s.create(tmpFileLoc);}},

Replace line 519 [if (!pth) return...] with
Code: [Select]
if (!pth) return ""; console.log("cleanPth input", pth); let UNC = pth.startsWith("\\\\"); if (UNC) pth = pth.replace("\\\\", ""); if (!pth.endsWith("\\")) pth += "\\"; const c_pos = pth.indexOf(":"); pth = pth.replace(/[/|:]/g, "-").replace(/\*/g, "x").replace(/"/g, "''").replace(/[<>]/g, "_").replace(/\?/g, "").replace(/\\\./g, "\\_").replace(/\.+\\/, "\\").replace(/\s*\\\s*/g, "\\"); if (c_pos < 3 && c_pos != -1) pth = s.replaceAt(pth, c_pos, ":"); while (pth.includes("\\\\")) pth = pth.replace(/\\\\/g,"\\_\\"); if (UNC) pth = `\\\\${pth}`; console.log("cleanPth output", pth); return pth.trim();

Hopefully it will work. If not there are some console.log traces in there which might help, and that can be removed if all is OK.

Regarding embedded album art. That should display fine. It's working here. It may depend on embedded vs external setting: foobar2000 preferences > advanced > display > album art > embedded vs external

Re: Biography Discussion

Reply #558
@quah

I don't have a device with UNC paths, so please can you try replacing all of the two following lines.

Replace line 15 [buildPath...] with:
Code: [Select]
buildPth : pth => {console.log("buildPth input pth", pth); let result, tmpFileLoc = "", UNC = pth.startsWith("\\\\"); if (UNC) pth = pth.replace("\\\\", ""); console.log("UNC",UNC); const pattern = /(.*?)\\/gm; while ((result = pattern.exec(pth))) {tmpFileLoc = tmpFileLoc.concat(result[0]); if (UNC) {tmpFileLoc = `\\\\${tmpFileLoc}`; UNC = false;} console.log("buildPth output tmpFileLoc",tmpFileLoc); s.create(tmpFileLoc);}},

Replace line 519 [if (!pth) return...] with
Code: [Select]
if (!pth) return ""; console.log("cleanPth input", pth); let UNC = pth.startsWith("\\\\"); if (UNC) pth = pth.replace("\\\\", ""); if (!pth.endsWith("\\")) pth += "\\"; const c_pos = pth.indexOf(":"); pth = pth.replace(/[/|:]/g, "-").replace(/\*/g, "x").replace(/"/g, "''").replace(/[<>]/g, "_").replace(/\?/g, "").replace(/\\\./g, "\\_").replace(/\.+\\/, "\\").replace(/\s*\\\s*/g, "\\"); if (c_pos < 3 && c_pos != -1) pth = s.replaceAt(pth, c_pos, ":"); while (pth.includes("\\\\")) pth = pth.replace(/\\\\/g,"\\_\\"); if (UNC) pth = `\\\\${pth}`; console.log("cleanPth output", pth); return pth.trim();

Hopefully it will work. If not there are some console.log traces in there which might help, and that can be removed if all is OK.

Regarding embedded album art. That should display fine. It's working here. It may depend on embedded vs external setting: foobar2000 preferences > advanced > display > album art > embedded vs external

 
 

Thanks very much WilB for your assistance! 

Your patch is working well and covers are being saved for UNC and non-UNC paths. 

By the way, in Windows you can use a UNC path to access the local disk by using the local hostname.  Example: "\\My_PC\C\Users".  If you open the track that way in Foobar, it will use the UNC path and not try to convert it to a non-UNC path.  I suppose if you disabled enough file sharing features in Windows, it might break UNC, and perhaps that's your setup.

In playing with this stuff, I just figured out why embedded art was not working for me: In the context menu of the Bio panel, if "Sources > Cover: Cycle" is set to "Cycle Above", I don't see embedded art.  If I change the setting to "Front", then I see the embedded art. 

Thanks again and let me know if I can help test further.

Re: Biography Discussion

Reply #559
Hey,
I cannot install the component.
I have this message:
JScript Panel v2.3.6.1 (id:986144)
Erreur de compilation Microsoft JScript:
Erreur de syntaxe
File: <main>
Line: 3, Col: 1
Line 3: const requiredVersionStr = '1.2.2'; function is_compatible(requiredVersionStr) {const requiredVersion = requiredVersionStr.split('.'), currentVersion = utils.Version.split('.'); if (currentVersion.length > 3) currentVersion.length = 3; for (let i = 0; i < currentVersion.length; ++i) if (currentVersion != requiredVersion) return currentVersion > requiredVersion; return true;} if (!is_compatible(requiredVersionStr)) fb.ShowPopupMessage(`Biography requires v${requiredVersionStr}. Current component version is v${utils.Version}.`);



Re: Biography Discussion

Reply #562
Thank's, it's ok with spider monkey panel...

 
SimplePortal 1.0.0 RC1 © 2008-2020