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

Re: Biography Discussion

Reply #151
Hey WilB, thank you so much for this amazing Biography!

I already tweaked the hell out of it, amazing how many settings you added for us. However I still have a couple of questions/requests for you, in hope that the script can be even more amazing.

1. I'd like to be able to add the date tag to album covers from last.fm. I tried adding "date=$meta(date,0)" or "date name=$meta(date,0) to [NAMES] in biography.ini and then using it in "Image [Cover] File Name" afterwards but unfortunately it didn't work.

2. I use underscores for invalid characters in my local album covers. However, your script uses dashes. Is there a way to change this somewhere so it would also use underscores? I tried using the $replace function for each tag in my local cover art script in preferences->display->album art->front cover but strangely it didn't work.

3. I would like to download only 1 image per artist and not 5. I'd really appreciate if there was an option for this in order to save some bandwidth.

Thank you for considering any of the requests, much appreciated!

Re: Biography Discussion

Reply #152
@YOGAM. I am pleased that the additions you requested have proved useful.

@ocram35. The "both if available" option should be in the next release. There should also be a "Lock To Single Source" option that provides another way to avoid the text falling back to the same source when only one source is found & both review types (or both bio types) are displayed.

@DJ FRANK G. That feature was added a while ago... To display biographies for multi-artist tags, enable "Show More Tags" ("Menu > Sources > Server Settings > [MISCELLANEOUS] heading > Show More Tags=1" [can also be accessed by directly opening biography.ini]). If there are multiple values, the artist view will then show a discrete watermark style button > click to choose name. This works by expanding all fields referenced by the artist name definition and includes multi-values.

@aeidein New heading choices in the next release will allow rating display in a button, with the allmusic/last.fm button text hidden.

@culinko

1) The following styles should work.
Code: [Select]
Image [Cover] File Name=cover - %date%
Image [Cover] Folder Location=$directory_path(%path%)\%date%
I think the first is on the lines you wanted and adds the date to the file name. The date can also be added to the path as in second example, but due to a bug you'll have to wait for the next release for that method to work, since I forgot to add the ability to create cover paths that don't already exist. Ensure the foobar2000 album art reader is set to recognise whatever you use.

2) The script conforms to the foobar2000 method for replacement of invalid characters for maximum compatibility with the foobar2000 album art reader (documented here, except doc has an error in that ? is stripped and not replaced by _) .

For information:
/ \ |: get replaced by a -
* gets replaced by x
" gets replaced with ''
< > get replaced by an _
? is stripped

Note that the foobar2000 album art reader will always do these hard coded replacements, and so you can't apply a replace function to the original character, since its already replaced. If you want to continue with your method & use the foobar20000 method that JScript biography also uses, consider adding an extra pattern to the album art reader so both will work. But my recommendation would be to consider just using the foobar2000 method that the script also uses for maximum compatibility.

3) This issue has come up a couple of times. The ability to set the number of artist images fetched should be in the next release.

Re: Biography Discussion

Reply #153
Thanks very much for your helpful reply!

I've managed to make the date work with the following: "Image [Cover] File Name=album artist name - album name$if(%date%, '['%date%']')" and then adding the following two strings: "'D:\(my path)\'%album artist%' - '%album%$if(%date%, '['%date%']')'.png'" and "'D:\(my path)\'%album artist%' - '%album%$if(%date%, '['%date%']')'.jpg'" to the Front cover search patterns in Foobar2000. Some of my albums are currently missing the date tag, that's why there is the condition, but I will drop it once I fill up the tags properly some day. Btw. do you know if there is any way in Foobar2000 to include both png and jpg so I'd have just one string instead of two separate ones? I know that you can use a wildcard, such as ".*" (I think it should work?), but I would like to list just png+jpg since I don't think there will be any other formats downloaded anyway.

Thanks for letting me know about the Foobar2000 internal replacement, I didn't know it worked like this. However, I prefer underscores to replace every illegal character (even in the mp3 files), so I will have to do what you suggested: "consider adding an extra pattern to the album art reader so both will work". Unfortunately, I don't understand what do you mean by the album art reader. Isn't the album art reader the entry in "preferences->display->album art->front cover" list? If you can point me in the right direction that would be awesome.

Great that you will add the feature for setting the number of artist pictures in the new version!

Re: Biography Discussion

Reply #154
1) Wildcard is simplest.

2) "preferences->display->album art->front cover" list - yes that's what I mean by the foobar2000 album art reader.

Re: Biography Discussion

Reply #155
Unfortunately, by modifying the script in preferences->display->album art->front cover I only managed to make ? " < > work, but not : * / \ |

This was my original string for the local cover art: 'Cover\'%album artist%' - '%album%$if(%date%, '['%date%']')'.jpg'
This is the new string: 'Cover\'$replace(%album artist%' - '%album%$if(%date%, '['%date%']'),'?','_',':','_','/','_','*','_','"','_','\','_','|','_','<','_','>','_')'.jpg'

By reading some of the other topics (https://hydrogenaud.io/index.php/topic,71931.0.html and https://hydrogenaud.io/index.php/topic,70522.0.html) I discovered that some of the replacements apparently happen before I can even use my $replace function, but interestingly enough I am using the $replace function in my Panel Stack Splitter (Columns UI) without any problems: $set_ps_global(album.artist.name,$replace(%album artist%,'?','_',':','_','/','_','*','_','"','_','\','_','|','_','<','_','>','_')) works like a charm. Additionally, Lyric Show 3 plugin for Foobar2000 also replaces all invalid characters (except \) with underscores (and using the $replace function replaces that one as well without any problems). Mp3Tag also lets you specify your replacement character with the $validate function. I also tried to use my global variable from PSS (with $get_ps_global) in the album art reader but it wouldn't work either.

Looking at the topics I linked, looks like I am not the only one who likes to use underscores for every illegal character and I really hope it could be done somehow. Is there anything else that can be done in order to make it work? I would be very grateful if this was possible somehow.

Re: Biography Discussion

Reply #156
Lyrics3 both saves the lyric files and loads them. That's not what's happening here. The script saves the files but cover images are loaded by foobar2000 album art reader. So the save names have to be compatible with the foobar2000 album art reader & significantly in this case its automatic replacements. Note that automatic replacements are done before processing of the album art search pattern (e.g. see foobar2000 FAQ). PSS can also I believe use the foobar2000 artreader: artreader & artreader_front choices.

I ran some tests to check that the script was working correctly.
I created Z:\foobar2000\cover
Bio server settings were set as:
Image [Cover] Folder Location=Z:\foobar2000\cover
Image [Cover] File Name=%album artist% - %album%$if(%date%, '['%date%']')

I set foobar2000 album art front cover pattern as:
Z:\foobar2000\cover\%album artist% - %album%$if(%date%, '['%date%']').*

I played: "Scorpions - Deadly Sting: The Mercury Years" (album artist - album)
Cover saved as: Scorpions - Deadly Sting- The Mercury Years [1987].png
Note : changed to - in cover file name. Cover loaded correctly.
I ran some further tests with other invalid characters & all was fine
So invalid characters were correctly handled.

Your suggestion of changing all invalid characters to _ created problems with foobar2000 album art reader and seemed to completely fail when the invalid character was ?
For example I tried again: "Scorpions - Deadly Sting: The Mercury Years"
This time, : was replaced by _ The resulting cover name was:
Scorpions - Deadly Sting_ The Mercury Years [1987].png
I changed the foobar2000 album art front cover pattern to:
Z:\foobar2000\cover\%album artist% - $replace(%album%,-,_)$if(%date%, '['%date%']').*
That worked and in this case cover loaded. Note that the replace takes account of the foobar2000 internal replacement of : to - and applies the replace on the -
So if the foobar2000 replacement characters are known, then they can be replaced. So you need a replacement function something like: $replace(%album%,-,_,x,_,'',_) But this is unnecessarily complex.
Also with your suggested underscore method I tried: "Scorpions - Deadly Sting? The Mercury Years" as album artist - album. The cover was named Scorpions - Deadly Sting_ The Mercury Years [1987].png, reflecting a replacement of ? to _ But I could not get the foobar2000 album art reader to load the cover upon playing "Scorpions - Deadly Sting? The Mercury Years". The reason seems to be because foobar2000 replaces ? with nothing before the search pattern is processed and so there's no character to be then able to substitute. There may be way round this that I haven't thought of yet.

For an extreme example see here.

So while its easy enough to change the script so invalid characters are replaced by _ that complicates or breaks interaction with foobar2000 album art reader.

In summary as far as use of this script is concerned you shouldn't have to worry about doing any replacements in order to load the cover, just use the simple title formatting.

HTH

Re: Biography Discussion

Reply #157
New Version: JScript Biography 0.8

CHANGELOG

CHG: Dark & light themes: blur image background can now be locked to always use that of the cover. Enable in panel properties (Image Blur...).
ADD: "Prefer Both" sources option ("Menu > Sources > Biography or Review"). If enabled, text contains both biographies or both reviews where available. Heading can be clicked or menu used to toggle order. A title auto-shows in this mode to discern text sources. The title & font style can be set in panel properties ("Title...).
ADD: "Lock To Single Source" option for biographies & reviews ("Menu > Sources > Biography or Review"). If locked, heading can still be clicked or menu used to toggle source, but auto fall back to other source is disabled.
CHG: Improved heading: now supports full title formatting for greater flexibility. More choices including option of line after text. Settings are in panel properties ("Heading...").
ADD: %BIO_ALBUMARTIST%, %BIO_ARTIST% & %BIO_ALBUM% to allow use of "Server Settings" in headings. Specific to JScript Biography.
ADD: Quick Access to change text source. Top menu item. Context specific: N/A in image only mode.
ADD: Improvements as an album art viewer, e.g. cover source can now be selected from "Back", Disc", "Icon", "Artist" as well as the standard "Front" (Menu > Sources > Cover).
ADD: Option to set the number of artist images fetched ("Server Settings" [biography.ini]).
ADD: Option to allow rating display in a button, with the allmusic/last.fm button text hidden (panel properties > heading items > set BtnName to 0 Or delete/change button text in panel properties > ADV.Heading... for the required views).

Due to the new requested features, biography.ini will be reset. The previous version will be backed up in the same location. Note the new title format "NAMES" that have been changed to improve clarity and headings. If save paths are altered from the default, ensure the new "Names" are used.

Some panel properties have changed & redundant removed. This affects the heading settings and 1 minor rating property. Defaults unchanged. Export panel properties, before updating, if you need a record.

Re: Biography Discussion

Reply #158
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 #159
Why can't you use a fixed filename like front.jpg or cover.jpg like normal people?  ;D

 

Re: Biography Discussion

Reply #160
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 #161
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 #162
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 #163
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 #164
"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 #165
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 #166
@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 #167
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 #168
Oops, sorry for double posting.

Re: Biography Discussion

Reply #169
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 #170
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 #171
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 #172
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 #173
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 #174
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.