Merge branch 'ciderapp:upcoming' into upcoming

This commit is contained in:
KaHim Chan 2022-01-26 22:46:41 +08:00 committed by GitHub
commit 17a85a1d60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 ""
}