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 241940 times) previous topic - next topic
IP974 and 4 Guests are viewing this topic.

Re: Biography Discussion

Reply #1101
I've noticed that the plugin doesn't seem to handle certain special characters correctly.

For instance, i get the following error in my console when attempting to retrieve the album review for: https://www.allmusic.com/album/closure-continuation-mw0003617672

Quote
Biography Server: allmusic review: Closure/Continuation / Porcupine Tree: not found

Is there a workaround or is this a bug? I'd create a github issue, but there doesn't appear to be a way to do it.

I wasn't going to bring it up until the Allmusic bug was solved but now that you've brought it up, YES this is another Biography bug. I discovered it a couple weeks ago with the artist AC/DC and I actually got ChatGPT to fix it.

EDIT... I just checked my notes and it was the lyrics not loading that was the problem. So this is not your issue, BUT this is a separate issue that needs to be addressed.

You have to replace the function findFile in text.js to this...

Code: [Select]
	findFile(v, n) {
const type = /_\.(lrc|txt)$/.test(v.pth) ? 0 : /\.(lrc|txt)$/.test(v.pth) ? 1 : 2;
        let pth = '';
let item = n == 'bio' ? v.pth.replace(/%BIO_ARTIST%|%BIO_ALBUMARTIST%/gi, '%BIO_ARTIST%') : v.pth.replace(/%BIO_ALBUMARTIST%|%BIO_ARTIST%/gi, '%BIO_ALBUMARTIST%');

const a = $.tfEscape(name.artist(!v.lyrics ? panel.id.focus : false, !v.lyrics ? false : true).replace(/\//g, '_'));
const aa = $.tfEscape(name.albumArtist(!v.lyrics ? panel.id.focus : false, !v.lyrics ? false : true).replace(/\//g, '_'));
const l = $.tfEscape(name.album(!v.lyrics ? panel.id.focus : false, !v.lyrics ? false : true).replace(/\//g, '_'));
const tr = $.tfEscape(name.title(!v.lyrics ? panel.id.focus : false, !v.lyrics ? false : true).replace(/\//g, '_'));
item = item // substitue bio var + check advanced radio stream parser (tfBio & tfRev do lookUps not parser)
.replace(/((\$if|\$and|\$or|\$not|\$xor)(|\d)\(|\[)[^$%]*%bio_artist%/gi, a ? '$&#@!%path%#@!' : '$&').replace(/%bio_artist%/gi, a)
.replace(/((\$if|\$and|\$or|\$not|\$xor)(|\d)\(|\[)[^$%]*%bio_albumartist%/gi, aa ? '$&#@!%path%#@!' : '$&').replace(/%bio_albumartist%/gi, aa)
.replace(/((\$if|\$and|\$or|\$not|\$xor)(|\d)\(|\[)[^$%]*%bio_album%/gi, l ? '$&#@!%path%#@!' : '$&').replace(/%bio_album%/gi, l)
.replace(/((\$if|\$and|\$or|\$not|\$xor)(|\d)\(|\[)[^$%]*%bio_title%/gi, tr ? '$&#@!%path%#@!' : '$&').replace(/%bio_title%/gi, tr);

switch (type) {
case 0:
pth = item.replace(/_\.(lrc|txt)$/, '.$1');
break;
case 1:
pth = item.replace(/\.(lrc|txt)$/, '_.$1');
break;
}
let pths = !v.lyrics ? [item] : [item, pth];
return pths.some(w => {
const wildCard = /[*?]/.test(w);
if (!wildCard) {
this[n].readerItem = panel.cleanPth(w, !v.lyrics ? panel.id.focus : false, !v.lyrics ? '' : 'lyr').slice(0, -1).replace(/#@!.*?#@!/g, '');
return $.file(this[n].readerItem);
} else {
let p = panel.cleanPth(w.replace(/\*/g, '@!@').replace(/\?/g, '!@!'), !v.lyrics ? ppt.focus : false, !v.lyrics ? '' : 'lyr').slice(0, -1);
p = p.replace(/@!@/g, '*').replace(/!@!/g, '?').replace(/#@!.*?#@!/g, '');
const arr = utils.Glob(p);
if (!arr.length) return false;
this[n].readerItem = arr[0];
return $.file(this[n].readerItem);
}
});
}

I don't know if this is a proper fix or not but it works.


 

Re: Biography Discussion

Reply #1103
Just to clarify, when I say "Another Biography bug" I'm not saying that in a snide or pissy way. It's a complex program and there are bound to be bugs.