i guess this will work better

This commit is contained in:
vapormusic 2022-01-26 21:44:37 +07:00
parent 1badd13f69
commit 5e87c858ba
2 changed files with 7 additions and 3 deletions

View file

@ -244,7 +244,7 @@ export default class LastFMPlugin {
*/
onNowPlayingItemDidChange(attributes: object): void {
if (!this._store.lastfm.filterLoop){
this._lastfm.cachedAttributes = []}
this._lastfm.cachedAttributes = false}
this.scrobbleSong(attributes)
this.updateNowPlayingSong(attributes)
}

View file

@ -444,8 +444,12 @@
// month = new Intl.DateTimeFormat(this.app.cfg.general.language.replace('_','-'), {month: 'long'}).format(releaseDate);
// date = releaseDate.getDate();
// year = releaseDate.getFullYear();
return prefix + new Intl.DateTimeFormat(this.app.cfg.general.language?.replace('_','-') ?? 'en-US', {day:'numeric',month: 'long', year: 'numeric'}).format(releaseDate);
let formatted = ''
try {formatted = new Intl.DateTimeFormat(this.app.cfg.general.language?.replace('_','-') ?? 'en-US', {day:'numeric',month: 'long', year: 'numeric'}).format(releaseDate);}
catch(e){
formatted = new Intl.DateTimeFormat('en-US', {day:'numeric',month: 'long', year: 'numeric'}).format(releaseDate);
}
return prefix + formatted
} catch (e) {
return ""
}