Merge branch 'ciderapp:develop' into develop
This commit is contained in:
commit
20fd0c05da
8 changed files with 74 additions and 50 deletions
|
@ -88,7 +88,7 @@ export class BrowserWindow {
|
||||||
y: undefined,
|
y: undefined,
|
||||||
minWidth: 900,
|
minWidth: 900,
|
||||||
minHeight: 390,
|
minHeight: 390,
|
||||||
frame: (process.platform === "linux"),
|
frame: false,
|
||||||
title: "Cider",
|
title: "Cider",
|
||||||
vibrancy: "fullscreen-ui",
|
vibrancy: "fullscreen-ui",
|
||||||
transparent: process.platform === "darwin",
|
transparent: process.platform === "darwin",
|
||||||
|
@ -130,7 +130,6 @@ export class BrowserWindow {
|
||||||
this.startWebServer();
|
this.startWebServer();
|
||||||
|
|
||||||
BrowserWindow.win = new bw(this.options);
|
BrowserWindow.win = new bw(this.options);
|
||||||
BrowserWindow.win.setMenuBarVisibility(false)
|
|
||||||
const ws = new wsapi(BrowserWindow.win)
|
const ws = new wsapi(BrowserWindow.win)
|
||||||
ws.InitWebSockets()
|
ws.InitWebSockets()
|
||||||
// and load the renderer.
|
// and load the renderer.
|
||||||
|
|
|
@ -9,6 +9,7 @@ export class Store {
|
||||||
"close_button_hide": false,
|
"close_button_hide": false,
|
||||||
"open_on_startup": false,
|
"open_on_startup": false,
|
||||||
"discord_rpc": 1, // 0 = disabled, 1 = enabled as Cider, 2 = enabled as Apple Music
|
"discord_rpc": 1, // 0 = disabled, 1 = enabled as Cider, 2 = enabled as Apple Music
|
||||||
|
"discord_rpc_clear_on_pause": true,
|
||||||
"language": "en_US", // electron.app.getLocale().replace('-', '_') this can be used in future
|
"language": "en_US", // electron.app.getLocale().replace('-', '_') this can be used in future
|
||||||
"playbackNotifications": true,
|
"playbackNotifications": true,
|
||||||
"update_branch": "main"
|
"update_branch": "main"
|
||||||
|
|
|
@ -69,6 +69,10 @@ ipcMain.on('nowPlayingItemDidChange', (_event, attributes) => {
|
||||||
CiderPlug.callPlugins('onNowPlayingItemDidChange', attributes);
|
CiderPlug.callPlugins('onNowPlayingItemDidChange', attributes);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ipcMain.on('lfmItemChange', (_event, attributes) => {
|
||||||
|
CiderPlug.callPlugins('lfmItemChange', attributes);
|
||||||
|
});
|
||||||
|
|
||||||
app.on('before-quit', () => {
|
app.on('before-quit', () => {
|
||||||
CiderPlug.callPlugins('onBeforeQuit');
|
CiderPlug.callPlugins('onBeforeQuit');
|
||||||
console.warn(`${app.getName()} exited.`);
|
console.warn(`${app.getName()} exited.`);
|
||||||
|
|
|
@ -162,9 +162,23 @@ export default class DiscordRichPresence {
|
||||||
|
|
||||||
// Check if its pausing (false) or playing (true)
|
// Check if its pausing (false) or playing (true)
|
||||||
if (!attributes.status) {
|
if (!attributes.status) {
|
||||||
|
if (DiscordRichPresence._store.general.discord_rpc_clear_on_pause) {
|
||||||
this._client.clearActivity()
|
this._client.clearActivity()
|
||||||
.catch((e: any) => console.error(`[DiscordRichPresence][clearActivity] ${e}`));
|
.catch((e: any) => console.error(`[DiscordRichPresence][clearActivity] ${e}`));
|
||||||
|
} else {
|
||||||
|
this._activity.smallImageKey = 'pause';
|
||||||
|
this._activity.smallImageText = 'Paused';
|
||||||
|
delete this._activity.endTimestamp;
|
||||||
|
delete this._activity.startTimestamp;
|
||||||
|
this._client.setActivity(this._activity)
|
||||||
|
.catch((e: any) => console.error(`[DiscordRichPresence][setActivity] ${e}`));
|
||||||
|
}
|
||||||
} else if (this._activity && this._activityCache !== this._activity && this._activity.details) {
|
} else if (this._activity && this._activityCache !== this._activity && this._activity.details) {
|
||||||
|
if (!DiscordRichPresence._store.general.discord_rpc_clear_on_pause) {
|
||||||
|
this._activity.smallImageKey = 'play';
|
||||||
|
this._activity.smallImageText = 'Playing';
|
||||||
|
}
|
||||||
|
|
||||||
this._client.setActivity(this._activity)
|
this._client.setActivity(this._activity)
|
||||||
.catch((e: any) => console.error(`[DiscordRichPresence][updateActivity] ${e}`));
|
.catch((e: any) => console.error(`[DiscordRichPresence][updateActivity] ${e}`));
|
||||||
this._activityCache = this._activity;
|
this._activityCache = this._activity;
|
||||||
|
|
|
@ -265,7 +265,7 @@ export default class LastFMPlugin {
|
||||||
* Runs on song change
|
* Runs on song change
|
||||||
* @param attributes Music Attributes
|
* @param attributes Music Attributes
|
||||||
*/
|
*/
|
||||||
onNowPlayingItemDidChange(attributes: object): void {
|
lfmItemChange(attributes: object): void {
|
||||||
if (!this._store.lastfm.filterLoop){
|
if (!this._store.lastfm.filterLoop){
|
||||||
this._lastfm.cachedNowPlayingAttributes = false;
|
this._lastfm.cachedNowPlayingAttributes = false;
|
||||||
this._lastfm.cachedAttributes = false}
|
this._lastfm.cachedAttributes = false}
|
||||||
|
|
|
@ -25,8 +25,10 @@ const MusicKitInterop = {
|
||||||
MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, async () => {
|
MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, async () => {
|
||||||
// await MusicKitInterop.modifyNamesOnLocale();
|
// await MusicKitInterop.modifyNamesOnLocale();
|
||||||
if (MusicKitInterop.filterTrack(MusicKitInterop.getAttributes(), false, true) || !app.cfg.lastfm.filterLoop) {
|
if (MusicKitInterop.filterTrack(MusicKitInterop.getAttributes(), false, true) || !app.cfg.lastfm.filterLoop) {
|
||||||
global.ipcRenderer.send('nowPlayingItemDidChange', MusicKitInterop.getAttributes());
|
global.ipcRenderer.send('lfmItemChange', MusicKitInterop.getAttributes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
global.ipcRenderer.send('nowPlayingItemDidChange', MusicKitInterop.getAttributes());
|
||||||
});
|
});
|
||||||
|
|
||||||
MusicKit.getInstance().addEventListener(MusicKit.Events.authorizationStatusDidChange, () => {
|
MusicKit.getInstance().addEventListener(MusicKit.Events.authorizationStatusDidChange, () => {
|
||||||
|
|
|
@ -3134,10 +3134,6 @@ body[platform='darwin'] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
body[platform='linux'] #window-controls-container {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.percent {
|
.percent {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
@ -568,6 +568,14 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="md-option-line" v-show="app.cfg.general.discord_rpc != 0">
|
||||||
|
<div class="md-option-segment">
|
||||||
|
{{$root.getLz('settings.option.connectivity.discordRPC.clearOnPause')}}
|
||||||
|
</div>
|
||||||
|
<div class="md-option-segment md-option-segment_auto">
|
||||||
|
<input type="checkbox" v-model="app.cfg.general.discord_rpc_clear_on_pause" switch/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="md-option-line">
|
<div class="md-option-line">
|
||||||
<div class="md-option-segment">
|
<div class="md-option-segment">
|
||||||
{{$root.getLz('settings.option.connectivity.lastfmScrobble')}}
|
{{$root.getLz('settings.option.connectivity.lastfmScrobble')}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue