Skip to content

Commit

Permalink
Update text.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Wil-B committed Jun 13, 2022
1 parent b54e8e9 commit d07f5a9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/text.js
Expand Up @@ -337,7 +337,7 @@ class Text {
if (v[`${w}Line`]) {
const v_w = g.CalcTextWidth(v.text + ' ', this.ratingPos.line ? ui.font.main : ui.font.subHeadSource);
v[`${w}LineX1`] = i < 2 ? panel.text.l + v_w + (this.rating[w] >= 0 && (this.ratingPos.subHeading || this.ratingPos.line) ? but.rating.w2 : 0) + this.bio.sp : panel.text.l + this.rev[`${w}_w`].nohd + this.bio.sp; // noHd
v[`${w}LineX2`] = Math.max(v[`${w}LineX1`], panel.text.l + panel.text.w);;
v[`${w}LineX2`] = Math.max(v[`${w}LineX1`], panel.text.l + panel.text.w);
}
});
v.offset = 0;
Expand Down Expand Up @@ -489,6 +489,9 @@ class Text {
if (!isNaN(this.rating.am) && this.rating.am != 0 && this.rating.am != -1) this.rating.am *= 2;
else this.rating.am = -1;
this.getRatingStyle('am');
} else {
this.rating.amStr = '';
if (f != -1) this.rev.amAlb = this.rev.amAlb.slice(f + 3);
}
}
this.rev.am = this.rev.amAlb;
Expand Down Expand Up @@ -1320,7 +1323,7 @@ class Text {
if (this[n][type]) this[n].loaded[type] = true;
}
break;
case ppt.sourceAll:
case ppt.sourceAll: {
let setLoaded = false;
[types, types_1, types_2, types_3][ppt[`source${n}`]].forEach((v, i, arr) => {
const splitter = i < arr.length - 1 ? '<---------->' : '';
Expand All @@ -1334,6 +1337,7 @@ class Text {
}
});
break;
}
}

Object.values(this[n].loaded).some((v, i) => {
Expand Down Expand Up @@ -1448,7 +1452,7 @@ class Text {
return !ppt.artistView && ppt.classicalMusicMode && (this.rev.loaded.am && !this.rev.amFallback || this.rev.loaded.wiki && !this.rev.wikiFallback) && !panel.alb.ix;
}

isMainAvail(n, v) {
isMainAvail(n) {
return $.source.amLfmWiki.some(v => this[n][v] && ppt[`source${n}`] != 3);
}

Expand Down Expand Up @@ -1532,6 +1536,8 @@ class Text {
this.rating.lfm *= 2;
this.getRatingStyle('lfm');
}
} else {
this.rating.lfmStr = '';
}
this.rev.lfmAlb = ppt.score ? this.rev.lfmAlb.replace('Rating: ', '') : this.rev.lfmAlb.replace(/^Rating: .*$/m, '').trim();
}
Expand Down

0 comments on commit d07f5a9

Please sign in to comment.