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

Re: Biography Discussion

Reply #25
As a quick test, shift + right click & choose Configure... from the menu. Insert the following so it ends up on line 489 (i.e. it should be immediately after a "return" on the line above).
Code: [Select]
fb.trace("artist: " + a + " LASTFM BIO LOAD FROM FILE: LOCATION: " + lfm_a)
Click Ok to close the window. Show the foobar2000 console. Ensure Biography Source is set to Prefer last.fm and play some music to load a last.fm biography. This should output from where the last.fm biography is being loaded.

Re: Biography Discussion

Reply #26
But line 489 happens to be in the middle of a function...
Do you really want me to insert it AFTER the "if" line and BEFORE the "l_text" line ?

Re: Biography Discussion

Reply #27
Yes that's where it needs to be.

Re: Biography Discussion

Reply #28
OK, I have tried it. It seems to work. Here's the relevant console output :
JScript Panel (biography v0.3 beta by Wilb): initialised in 29 ms
artist: Taio Cruz LASTFM BIO LOAD FROM FILE: LOCATION: C:\Program Files \foobar2000 \yttm\biography\lastfm\t\Taio Cruz.txt
JScript Panel (biography v0.3 beta by Wilb): initialised in 28 ms
artist: Taio Cruz LASTFM BIO LOAD FROM FILE: LOCATION: C:\Program Files \foobar2000 \yttm\biography\lastfm\t\Taio Cruz.txt
JScript Panel (biography v0.3 beta by Wilb): initialised in 32 ms
artist: Taio Cruz LASTFM BIO LOAD FROM FILE: LOCATION: C:\Program Files \foobar2000 \yttm\biography\lastfm\t\Taio Cruz.txt
artist: Tank LASTFM BIO LOAD FROM FILE: LOCATION: C:\Program Files \foobar2000 \yttm\biography\lastfm\t\Tank.txt


Now here's the interesting part :
- Notice how "Program Files " has a space at the end
- Notice how "foobar2000 " has a space at the end
- Notice how the .txt files have a space at the end too (they do, really)

Indeed, I have found that my "C:\Program Files " folder has a space at the end. Weird, but well, OK.
I have 3 program folders : "Program Files ", "Program Files (x86)" and "Programmes" (Windows default folder in french for x64 apps, which links to "Program Files")
BUT in my "Program Files " (or "Programmes") folder, there seems to be NO foobar2000 folder ! Look !
Even with "Show invisible files" and "Show protected system files" options enabled, it doesn't change anything. :o

Re: Biography Discussion

Reply #29
I'm glad you know what's going on. Space after .txt is, I think, just the console output adding it, but the other spaces are likely real.

You get weird things if some software creates folders with spaces at the end & sometimes you can't remove the offending folders, correct the issue or do other things etc without using command prompt. I don't think windows explorer lets you create folders with spaces at the end, but some software can. My scripts take care to trim names of leading/trailing spaces before creating folders.

Re: Biography Discussion

Reply #30
Here's the thing : if I manually enter the path "C:\Program Files \foobar2000 \yttm\" in a Windows explorer window, I finally find the Holy Grail ! :o (see attached file).
That folder is invisible to Windows explorer AND Windows search AND Windows command line prompt, even with the "Show invisible files" option enabled. WOW.

What I don't understand, is WHY your script keeps storing its files in "C:\Program Files \foobar2000 \yttm\", when it should be storing them in "C:\Program Files (x86)\foobar2000 (ecoute)\yttm\" ! (which also exists BTW). That's where the problem lies IMHO. I have no foobar installation in "C:\Program Files \foobar2000 ". I have however several foobar installation folders in "C:\Program Files (x86)", and the one where your script is installed is "C:\Program Files (x86)\foobar2000 (ecoute)". That's where your "real" yttm folder is. ;)

Do you think you could correct that, by making sure that your script always stores by default all its files within the only "real" yttm folder where biography.ini resides ? Parsing biography.ini folder path should be enough.
Once you do that, I'll just have to manually delete the "fake" yttm folder, and things should get back to normal.
Thank you. :)

Re: Biography Discussion

Reply #31
The script uses the JScript parameter: fb.ProfilePath to get the foobar2000 install location.

Try putting this at the end of the script:
Code: [Select]
fb.trace("fb.ProfilePath: " + fb.ProfilePath)
What does it point at?

Re: Biography Discussion

Reply #32
here's what it points at (console output) :
fb.ProfilePath: C:\Program Files (x86)\foobar2000 (ecoute)\

Re: Biography Discussion

Reply #33
I can confirm the script is creating a new "Program Files " (note space)

Very annoying and difficult to remove.

 :-X

Re: Biography Discussion

Reply #34
Thanks mjm716 ! This was driving me nuts. Let's hope WilB can sort this out ASAP.

Also, please share your method of removing the new "Program Files " with space WITHOUT removing the real "Program Files". I'm saying this because both folders in my computer seem to have the same number of subfolders (45). I would have thought about symbolic linking, except that my real "Program Files" weights about 4 GB while the "Program Files " with space weights only about 50 MB. So I don't know what to do.

Thank you.

Re: Biography Discussion

Reply #35
I had to move the folder to the desktop using unlocker (http://www.emptyloop.com/unlocker/)
Then, again using unlocker, I could delete it from the desktop.

Trying to delete it directly either crashed explorer or would attempt to delete my entire Programs folder.

Re: Biography Discussion

Reply #36
Hehe, this thread has made me realise my own implementation of such a feature was broken as well. At least mine was totally harmless as it never created any folders - it only tried to read from ones that already existed. If the profile path contained brackets, it would have silently failed...

@WilB, don't pass fb.ProfilePath through any title formatting function because it's choking on the brackets in Program Files (x86) and foobar2000 (ecoute). Here's my fix although I suspect yours will be more complex...

https://github.com/19379/foo-jscript-panel/commit/b51740ab758dc769b75b804bbdef44ecb53cb7b4


Re: Biography Discussion

Reply #37
@marc2003 Yes I realised what the problem was late afternoon yesterday & concur with your finding.

Apologies to anybody affected by the parsing error. I am just testing a fixed version that will be released shortly.

I have previously used this to delete folders with spaces at end of name - at command prompt try typing, e.g.
Code: [Select]
rd /s "\\?\C:\Program Files "
Replace path (i.e. C:\Program Files ) as required & take especial care not to remove anything you want.

It worked for me when I had an issue, but I am not sure if it always works though.

Re: Biography Discussion

Reply #38
@WilB & @marc2003 : I'm happy to have helped find a bug. It's always nice to feel useful. :)

@mjm716 : I have Unlocker as well, so I guess I could move the "Program Files " folder to the desktop. But when you try to delete it from the desktop, how can I make sure that it doesn't delete the real "Program Files" (without space) folder ?

@WilB : same question. How to be sure that rd /s "\\?\C:\Program Files " won't delete the real "Program Files" folder as well ?

Re: Biography Discussion

Reply #39
New Version: JScript Biography 0.4 beta

CHANGELOG

ADD: Option to set cache expiry in line with tedgo suggestion.
ADD: Album reviews & covers: added ability to include partial matches of the album name. This uses last.fm autocorrect for that source else a script algorithm. Default is on.
ADD: Left & right arrow keys can now be used to cycle through artist photos. PgUp & PgDn works for text as before. Panel has to have focus etc
CHG: Multi-value tags will now work without altering biography.ini.
CHG: Some optimisations.
FIX: Path parsing issue that affected a few users.

New options are in biography.ini which will be reset. The previous version will be backed up in the same location.

Download link: Biography 0.4 beta

Edit: If you are one of the few who downloaded before 18:12 today (December 8th) please re-download (fixed arrow key bug)

Re: Biography Discussion

Reply #40
Thanks ! But please, let me ask this again in the name of the users affected by the parsing issue :
@mjm716 : I have Unlocker as well, so I guess I could move the "Program Files " folder to the desktop. But when you try to delete it from the desktop, how can I make sure that it doesn't delete the real "Program Files" (without space) folder ?
@WilB : same question. How to be sure that rd /s "\\?\C:\Program Files " won't delete the real "Program Files" folder as well ?
I want to be 100% sure that I won't delete or damage my real "Program Files" (without space), which would ba catastrophic...

Re: Biography Discussion

Reply #41
Very nice, works lovely.

Have one question about it. If we have two instances if Biography on different panels, while playing a track, can one fetch normally using the %artist% (or $meta(artist,0)) tag, while the second one fetching using..lets say %performer% tag? Some of my classical tracks are tagged with multiple 'artists' such as composers, conductors, performers,etc, and wondered if Biography might be able to fetch art/bio for all of them...

Thanks!

Re: Biography Discussion

Reply #42
I have a similar question. I'd like to have 3 Biography panels : 1 for english bio, 1 for french bio, and 1 for pictures.
Right now I guess we'd need two different biography.ini files, because we need to edit biography.ini to change the biography server.
But two biography.Ini files mean two separate yttm directories, and some trouble editing the files, the paths and so on.
So (feature request), would it be possible in a future version, for each biography panel to manually select its own biography server (e.g. by right click) instead of having to modify the one and only biography.ini ?
Thanks again. :)

Re: Biography Discussion

Reply #43
Great script!

Re: Biography Discussion

Reply #44
Hi @WilB,
I just login to say thanks for this wonderful script!

I'm not sure if you take feature request but I'll list it anyway :P
1. Change font. Make it possible for users to select a font, that is not depending on CUI or DUI font.
   A font selection dialog is nice, yet just a text field in the `Panel Properties` is alright too.
2. Add a property to specify where to store downloaded data.
   I see the data (texts, images) are stored in `<fb2k_path>\yttm`. IMO that path may not be optimal when using portable fb2k (fb2k folder just gets bigger & bigger). And defaulting to system temp path or user temp path is probably a good idea.
3. Add a property for setting double click to switch between album & artist page, I wanted to mimic old plugin behavior.
4. Ever thought using a public source repository or even github?

Re: Biography Discussion

Reply #45
@WilB , sorry to insist, but you haven't answered since the other day.

You may be busy, but I'm especially concerned about the "Program Files " issue. I understand it was a bug. These things can happen, it's not "your fault". :) However, because of this bug, some people lime me are now left with a "Program Files " folder that we don't know how to delete 100% safely.

I don't blame you for that bug. However, since you're responsible for it, we should expect you to give your users a safe way of "undoing" what this bug has done. We need you to provide that solution, and also to explain us why it would be 100% safe. We can't risk losing our real "Program Files" folders : the consequences would be catastrophic for every person involved. :(

Thanks for your understanding, and I look forward to reading you. :)

Re: Biography Discussion

Reply #46
Have you searched on Google or Bing or the like for an answer?

Re: Biography Discussion

Reply #47
No, sorry : it's up to WilB to provide a solution AND most importantly, to guarantee that it works safely.
For that, he may do some testing on his side :
- Install version 0.3 and have it create the wrong "Program Files " folder
- Find a way to remove it 100% safely
- Explain exactly how he did (or even better, provide a batch script or something)

That is definitely up to him, sorry. I'm a user, I'm no expert and I won't take such risks.

Re: Biography Discussion

Reply #48
It's worth pointing out that it's beta software & as is standard you use at your own risk, taking on responsibility. In your case I believe the reason for a particular problem with Program Files is the non-standard way you installed foobar2000 into that location that exposed an unforeseen bug.

Notice contained within the plug-in:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Nonetheless I have tried to be helpful by posting a solution several posts ago. You want a 100% guarantee with computers & all sorts of different scenarios - I'm afraid I can't give that. If you don't like my way, then somebody else posted a different method. As Jailhouse said, you can always do your own research as well.

But I retested with both these folders present.

"Z:\Program Files "
"Z:\Program Files"

Open command prompt. Click the top left box. Choose edit. Correct the path in the example below as required and paste it in. Press enter. Confirm the action when prompted.

Code: [Select]
rd /s "\\?\Z:\Program Files "

I tried it a few times. It worked for me. You may have to refresh windows explorer to see the correct results.

Re: Biography Discussion

Reply #49
Thanks WilB. I was only expecting some commitment on your side, a proof that you had already tried it at least. I guess now we have that commitment, even if it's not a 100% guarantee.

Yes, we use software at our own risks. You are absolutely right.
That means we can't complain if the software destroys our computer or opens a black hole into a new dimension.
But that doesn't mean that you, as developer, don't have the responsibility to fix the bugs of your software once they are been reported, especially when they have consequences outside of foobar.
And by "fixing" I also mean "fixing the consequences they may have had on your users, provided these consequences can be fixed".
That's what you have done, and so I thank you again for taking responsibility. Good job ! :)

I don't agree with the "non-standard" : foobar can be installed in either user folder or portable mode. Both are supported installation modes, and as such, foobar components must be able to function in either installation mode.

Thanks for your fix. I'll try it ASAP. :)

 
SimplePortal 1.0.0 RC1 © 2008-2019