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: Biography Discussion (Read 191945 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: Biography Discussion

Reply #150
Many thanks for your continuous effort and for the new version!

I think you might have misunderstood me, because I only want to use underscores to replace invalid characters so my local album covers (that I already have saved on my hdd) can be loaded. I wasn't talking about the new covers fetched from last.fm with your script. These are fine as-is and can be loaded with the Foobar's album art function.

I guess the difference is that my method with the PSS doesn't use the Foobar's album art function. Basically I just define these global variables in the PSS parent panel:

$set_ps_global(artist.name,$replace(%artist%,'?','_',':','_','/','_','*','_','"','_','\','_','|','_','<','_','>','_'))
$set_ps_global(album.name,$replace(%album%,'?','_',':','_','/','_','*','_','"','_','\','_','|','_','<','_','>','_'))
$set_ps_global(album.artist.name,$replace(%album artist%,'?','_',':','_','/','_','*','_','"','_','\','_','|','_','<','_','>','_'))
$set_ps_global(cover.path,$replace(%path%,%filename_ext%,)'Cover\'$get_ps_global(album.artist.name)' - '$get_ps_global(album.name) '['%date%'].jpg')

And then call it with in the designated PSS panel (with the rest of the global variables like cover positions) like this:

$if(%ps_isplaying%,$drawimage($get_ps_global(cover.left),$get_ps_global(cover.top),$get_ps_global(cover.size),$get_ps_global(cover.size),$get_ps_global(cover.path),nokeepaspect,,))

Here is an example of an album ending with a question mark: http://i.imgur.com/fejLKoH.png.

With this method I am able to replace every illegal character with the underscore and the images will load perfectly. My humble request to you would be if you could somehow (perhaps a setting) let users choose if they prefer using the internal art reader (set by default) or this "other" method. I'm not that knowledgeable about this problematic, but if it can be done with PSS, then I assume JScript panel could use that as well. Cheers!

Re: Biography Discussion

Reply #151
Why can't you use a fixed filename like front.jpg or cover.jpg like normal people?  ;D

Re: Biography Discussion

Reply #152
Apart from ~600 music albums I have, I also have ~2400 individual songs which are in a single directory. For these songs I want to have their covers also in a single directory, so they'd be easily accessible. Therefore their filenames can't have identical names like cover or front. The skin I've been using since I installed Foobar a couple of years ago (foonight) was using this method to display covers (with $drawimage) even before I modified the skin to fit my needs. And since I use underscores to replace invalid characters in all of my files for consistency (songs, lyrics and covers), I would really like to fully benefit from the usage of Biography script's ability to load local cover art as well. I would appreciate it very much if it can be done.

Re: Biography Discussion

Reply #153
Well that's a very unusual way of organising a collection. You could easily use file operations to arrange the files in one folder per album but I'm sure you have inexplicable reasons as to why you can't do that.

Anyway, the component is certainly capable of doing what you want but it would be entirely up to WilB if he wants to modify his script.

Re: Biography Discussion

Reply #154
Apart from ~600 music albums I have, I also have ~2400 individual songs which are in a single directory. For these songs I want to have their covers also in a single directory, so they'd be easily accessible. Therefore their filenames can't have identical names like cover or front. The skin I've been using since I installed Foobar a couple of years ago (foonight) was using this method to display covers (with $drawimage) even before I modified the skin to fit my needs. And since I use underscores to replace invalid characters in all of my files for consistency (songs, lyrics and covers), I would really like to fully benefit from the usage of Biography script's ability to load local cover art as well. I would appreciate it very much if it can be done.
Why not use a custom tag field where you can use whatever name you like and circumvent the use of special characters?

Re: Biography Discussion

Reply #155
Creating a custom tag would just be a band-aid in my opinion. Anyway I prefer to store only official tags (+ musicbrainz tags) in my files, then using scripts in Foobar to display stuff that I need to be displayed in a way which I want it to be displayed. That's the greatness with Foobar, its scripting engine is very robust so it can do basically anything.

Re: Biography Discussion

Reply #156
"a band aid", that's what I used to think until my collection grew and I had too many albums with the same name sharing album covers.

Re: Biography Discussion

Reply #157
I could see myself adding musicbrainz release id tags to the covers in addition to their current names or something similar once (if) this issue arises for me. For now let's just wait for WilB's decision. As marc2003 said, the component should be capable of doing what I suggested, so all my hope goes to WilB ;)

Re: Biography Discussion

Reply #158
@culinko

Have you considered using $findfile with PSS?
From PSS wiki
$findfile(path,[path2,path3,...])
Determinates whether the specified file(s) exist(s) and returns the first file. If you do not have the file does not return anything. (Strictly speaking, "false" returns). Path can be specified. The path allows wildcards.

The below should check both the original path & the path with the foobar2000/JScript Biography replacement of illegal characters. An advantage of this is that covers saved are compatible with both foobar2000 album art reader, if ever you want to use that, as well as your PSS configuration.

Code: [Select]
$set_ps_global(artist.name,$replace(%artist%,'?','_',':','_','/','_','*','_','"','_','\','_','|','_','<','_','>','_'))
$set_ps_global(album.name,$replace(%album%,'?','_',':','_','/','_','*','_','"','_','\','_','|','_','<','_','>','_'))
$set_ps_global(album.artist.name,$replace(%album artist%,'?','_',':','_','/','_','*','_','"','_','\','_','|','_','<','_','>','_'))

$set_ps_global(album2.name,$replace(%album%,/,-,\,-,|,-,:,-,*,x,"",'',<,_,>,_,?,))
$set_ps_global(album2.artist.name,$replace(%album artist%,/,-,\,-,|,-,:,-,*,x,"",'',<,_,>,_,?,))

$set_ps_global(cover.path,
$findfile(
$replace(%path%,%filename_ext%,)Cover\$get_ps_global(album.artist.name) - $get_ps_global(album.name) '['%date%']'.*,
$replace(%path%,%filename_ext%,)Cover\$get_ps_global(album2.artist.name) - $get_ps_global(album2.name) '['%date%']'.*
)
)
I removed ' quotes from the code I wrote as I don't think they're necessary & used wild card for extension. I confirmed that $findfile works as stated although haven't tested the actual code, so it might need tweaking.

There is another way if my memory of PSS is correct where you test if your original path exists using $findfile, & if it doesn't exist try & load the image provided by foobar2000 album art reader; i.e. conditionally set whether to use something like %path%,artreader or $get_ps_global(cover.path) in the $drawimage or $imageabs functions.

If those aren't to your liking, then I can tell you how to edit the code so all illegal characters are replaced with an underscore. It should be a simple one line change. I am reluctant to offer it as an option as someone's sure to set it inadvertently & break things + you can solve the issue, I think, by yourself by a small change to the PSS code as indicated.

HTH

Re: Biography Discussion

Reply #159
I apologize for this but it seems like you misunderstood me again. I don't want to display my local covers + fetched covers from last.fm in PSS. I just described the "PSS method" I use so you can see how the illegal character replacement worked for me not using the foobar's illegal character replacement. The PSS with cover + some basic info is just another panel I use and it's the first one to be displayed as default.

My issue is how can I use the "pss method" in the JScript panel so the "album" section of your Biography script can display my local covers and also the covers fetched from last.fm. With the "pss method" i mean like an ability to use global variables with the JScript panel for the local cover art or something similar. The covers fetched from last.fm are saved and displayed properly with the one line script in the foobar's album art reader so no need to change anything for them.

Re: Biography Discussion

Reply #160
Oops, sorry for double posting.

Re: Biography Discussion

Reply #161
Now I think I understand what you mean.

I can probably add a "Custom Cover Path".

So the script would check the normal path as entered in foobar2000 album art reader.

If nothing found it would then check a custom path that you enter, e.g.
Code: [Select]
Z:\foobar2000\cover\$replace(%album artist%,/,_,\,_,|,_,:,_,*,_,\",_,<,_,>,_,?,_) - $replace(%album%,/,_,\,_,|,_,:,_,*,_,\",_,<,_,>,_,?,_) '['%date%']'

Script will check for .jpg, png & .gif extensions

Please confirm this is what you want before I go any further.

Re: Biography Discussion

Reply #162
Yes, the custom cover path idea is perfect and it's exactly what I had in mind. But I think the scanning needs to be done in the reverse order. I need it to scan the custom path first because the path from the album art reader also loads the covers fetched from last.fm with your Biography script so they would always be displayed first, so my covers wouldn't. I am still missing some covers of my own so I'd really like the last.fm covers to be fetched and displayed as a fallback.

So I imagine the current behavior is something like this:
1. Display local covers via paths from the album art reader
2. If nothing found, fetch the album cover from last.fm
3. The cover from last.fm is now displayed if your album art reader contains the location where it was downloaded

And ideally I would want it to behave like this:
1. Display local covers via paths from the "custom cover path" variable
2. If nothing found, display local covers via paths from the album art reader
3. If nothing found, fetch the album cover from last.fm
4. The cover from last.fm is now displayed if your album art reader (or the custom cover path) contain the location where it was downloaded

You could even add two custom values instead of one to make it consistent with the regular "Image [Cover] Folder" and "Image [Cover] File Name", but it's not necessary for me personally. I just want other people to avoid any confusion as to why the custom cover has both path and file name in one place. The default value could just be empty (e.g. "Custom Image [Cover]=") so nothing is evaluated for people who don't set it up.

Edit: Can I use relative paths for the value? Or do variables like %path% or %filename_ext% work? Because in order for my custom path to work the value would need to look like this:
Code: [Select]
Cover\$replace(%album artist%,/,_,\,_,|,_,:,_,*,_,\",_,<,_,>,_,?,_) - $replace(%album%,/,_,\,_,|,_,:,_,*,_,\",_,<,_,>,_,?,_) '['%date%']'

or this:
Code: [Select]
$replace(%path%,%filename_ext%,)Cover\$replace(%album artist%,/,_,\,_,|,_,:,_,*,_,\",_,<,_,>,_,?,_) - $replace(%album%,/,_,\,_,|,_,:,_,*,_,\",_,<,_,>,_,?,_) '['%date%']'

This is because my folder structure looks like this:
D:\Music\Cover\%album artist% - %album% [%date%].jpg (for covers that belong to individual mp3s that I have)
D:\Music\"album directory"\Cover\%album artist% - %album% [%date%].jpg (for covers that belong to full albums that I have)

Re: Biography Discussion

Reply #163
Actually, you are correct in that the custom cover path can be scanned after the album art reader and not before, as long as it happens before it evaluates that there is no image and fetches one from last.fm (point 3). As soon as I will be able to set up the custom cover path value, I can just manually remove all covers that have been downloaded from last.fm to ensure they won't be loaded before my covers this way.

Re: Biography Discussion

Reply #164
At last I could make the script working in DarkOnev4 theme with the modified script for DarkOne.
Great works!! Thanks a lot WilB for creating such a nice script.

But unfortunately it is not working now after converting the Windows2012 R2 to Core mode. It is working fine in gui mode.
I tried installing JaveRE in core mode but no luck, in GUI mode it works without installing java.
I am getting this message after crushing:

JScript Panel (biography v0.8 by WilB)
Microsoft JScript runtime error:
Automation server can't create object
Line: 1378, Col: 64
<source text only available at compile time>

Any sort of help from our inmates would be highly appreciated.
Thanks once again for this nice script.

Re: Biography Discussion

Reply #165
These scripts need components which are part of Internet Explorer. As IE is not present in core editions, it won't run. Run a desktop OS and you won't have any problems.

And Java is completely unrelated to javascript. If there were any prerequisites to install to make things work, instructions would be provided.

Re: Biography Discussion

Reply #166
These scripts need components which are part of Internet Explorer. As IE is not present in core editions, it won't run. Run a desktop OS and you won't have any problems.

But lyrics view panel is working fine!
Now I need to find how to activate IE in core mode.
Thanks for the feedback.

Re: Biography Discussion

Reply #167
I expect any working components are pure C++ and don't need Internet Explorer.

Re: Biography Discussion

Reply #168
I expect any working components are pure C++ and don't need Internet Explorer.

Sorry failed to get your point as I am very novice in this field.
Is it possible to activate internet explorer in Windows 2012 core mode so that the scripts could run?



Re: Biography Discussion

Reply #171
New Version: JScript Biography 0.8.1

CHANGELOG

CHG: Various refinements, e.g. moved some heading and title settings from panel properties to layout menu to make layout adjustment easier.

ADD: Image [Cover] Check Custom Paths. Default is disabled which gives automatic loading of covers via foobar2000 album art reader and through checking save location, which should suffice for most users. If enabled, additionally checks custom cover paths first. Aimed at users who have front covers saved with illegal character replacement schemes not supported by the foobar2000 album art reader. To use, enable and set paths in "Server Settings" (biography.ini) > ADVANCED heading.

CHG: Album cover auto-download: made set-up easier. Fetched covers are now automatically loaded from the save location, if the location hasn't been added to foobar2000 album art reader front cover search patterns.

Re: Biography Discussion

Reply #172
Thank you SO MUCH for this! I appreciate your continuous effort very much  ;) . Works perfectly for me with the following script:

Code: [Select]
$replace(%path%,%filename_ext%,)Cover\$replace(%album artist% - %album%,/,_,\,_,|,_,:,_,*,_,",_,<,_,>,_,?,_) '['%date%']'

Re: Biography Discussion

Reply #173
New Version: JScript Biography 0.8.1

I recently updated to .81 from .76 and reviews are no longer appearing?

I initially did not reset the biography.ini paths, so files were writing to the default yttm folder paths.

For example the band !!! (bio *did* download) & album "Shake the Shudder" (review *did not* download).
However there are reviews for both LFM+AM available and they both exist in my previous .76 custom path.

I updated the biography.ini to match my old path structure and after verifying that it was writing there correctly (new artist images appeared) the AllMusic review still did not display, even though the review file "!!! - Shake the Shudder.txt" does exist.
Therefore it is not downloading new review, nor is the old review file displaying.

UPDATE: actually I just noticed a 404 error for the review in the console, but that doesn't explain why it is not displaying the existing review?

any ideas?

Re: Biography Discussion

Reply #174
If you are using more than one biography panel please ensure that both are updated to 0.8.1 before updating server settings in biography.ini, to make sure there is no interference from the two versions. Perhaps you also need to update the "NAME" definitions as you didn't mention that. When its all installed & updated just finally check server settings are correct after restarting foobar2000 again.

If that doesn't resolve the issue then I need more info:

Please post the settings in biography.ini & a windows explorer screen shot that enables me to see the exact file path and name its trying to load from. Also please also post a screen shot of the music file properties, i.e. metadata showing the tags for artist, album artist & album.