diff --git a/src/main/base/store.ts b/src/main/base/store.ts index 4436b3fc..f60b2d7d 100644 --- a/src/main/base/store.ts +++ b/src/main/base/store.ts @@ -13,7 +13,8 @@ export class Store { "language": "en_US", // electron.app.getLocale().replace('-', '_') this can be used in future "playbackNotifications": true, "update_branch": "main", - "resumeOnStartupBehavior": "local" + "resumeOnStartupBehavior": "local", + "privateEnabled": false, }, "home": { "followedArtists": [], diff --git a/src/main/plugins/discordrpc.ts b/src/main/plugins/discordrpc.ts index 2fca5026..cec2d6d3 100644 --- a/src/main/plugins/discordrpc.ts +++ b/src/main/plugins/discordrpc.ts @@ -207,7 +207,7 @@ export default class DiscordRichPresence { this.connect((DiscordRichPresence._store.general.discord_rpc == 1) ? '911790844204437504' : '886578863147192350'); console.debug(`[Plugin][${this.name}] Ready.`); ipcMain.on('updateRPCImage', (_event, imageurl) => { - if (DiscordRichPresence._store.visual.showuserinfo){ + if (!DiscordRichPresence._store.general.privateEnabled){ fetch('https://api.cider.sh/v1/images' ,{ method: 'POST', @@ -238,7 +238,7 @@ export default class DiscordRichPresence { * @param attributes Music Attributes (attributes.status = current state) */ onPlaybackStateDidChange(attributes: object): void { - if (DiscordRichPresence._store.visual.showuserinfo){ + if (!DiscordRichPresence._store.general.privateEnabled){ this._attributes = attributes this.updateActivity(attributes)} } @@ -248,7 +248,7 @@ export default class DiscordRichPresence { * @param attributes Music Attributes */ onNowPlayingItemDidChange(attributes: object): void { - if (DiscordRichPresence._store.visual.showuserinfo){ + if (!DiscordRichPresence._store.general.privateEnabled){ this._attributes = attributes this.updateActivity(attributes)} } diff --git a/src/main/plugins/lastfm.ts b/src/main/plugins/lastfm.ts index 79bd5893..019a7b2c 100644 --- a/src/main/plugins/lastfm.ts +++ b/src/main/plugins/lastfm.ts @@ -119,7 +119,7 @@ export default class LastFMPlugin { } else { return console.log('[LastFM] Did not add ', attributes.name, '—', artist, 'because now playing a other song.'); } - }, Math.round(attributes.durationInMillis * (self._store.lastfm.scrobble_after / 100))); + }, Math.round(attributes.durationInMillis * Math.min((self._store.lastfm.scrobble_after / 100),0.8))); } private async updateNowPlayingSong(attributes: any) { @@ -258,7 +258,7 @@ export default class LastFMPlugin { * @param attributes Music Attributes */ nowPlayingItemDidChangeLastFM(attributes: any): void { - if (this._store.visual.showuserinfo){ + if (!this._store.general.privateEnabled){ attributes.status = true if (!this._store.lastfm.filterLoop) { this._lastfm.cachedNowPlayingAttributes = false; diff --git a/src/renderer/index.js b/src/renderer/index.js index b7f9ae24..70111773 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -612,6 +612,7 @@ const app = new Vue({ } else { // Get Hide User from Settings this.chrome.hideUserInfo = !this.cfg.visual.showuserinfo + this.mk.privateEnabled = this.cfg.general.privateEnabled } if (this.cfg.visual.hw_acceleration == "disabled") { document.body.classList.add("no-gpu") @@ -626,7 +627,7 @@ const app = new Vue({ this.chrome.userinfo = (await app.mk.api.v3.music(`/v1/me/social-profile`)).data.data[0] } catch (err) { } - this.mk.privateEnabled = !this.cfg.visual.showuserinfo + this.mk._bag.features['seamless-audio-transitions'] = this.cfg.audio.seamless_audio // API Fallback diff --git a/src/renderer/views/pages/settings.ejs b/src/renderer/views/pages/settings.ejs index 2b85851c..dbc4e240 100644 --- a/src/renderer/views/pages/settings.ejs +++ b/src/renderer/views/pages/settings.ejs @@ -20,7 +20,7 @@ {{$root.getLz('term.privateSession')}}
- +