Merge branch 'ciderapp:upcoming' into upcoming
This commit is contained in:
commit
d16ed92c3b
19 changed files with 112 additions and 167 deletions
|
@ -215,7 +215,6 @@
|
|||
// Refer to term.disabled for the disabled option
|
||||
"settings.header.connectivity.discordRPC.cider": "Εμφάνιση ως 'Cider'",
|
||||
"settings.header.connectivity.discordRPC.appleMusic": "Εμφάνιση ως 'Apple Music'",
|
||||
"settings.option.connectivity.discordRPC.clearOnPause": "Εκκαθάριση του Discord Rich Presence στην Παύση", // Toggle
|
||||
"settings.option.connectivity.lastfmScrobble": "LastFM Scrobbling", // Option to Connect
|
||||
"settings.option.connectivity.lastfmScrobble.delay": "Καθυστέρηση LastFM Scrobble (%)",
|
||||
"settings.option.connectivity.lastfmScrobble.nowPlaying": "Ενεργοποίηση LastFM \"Now Playing\"",
|
||||
|
|
|
@ -228,7 +228,6 @@
|
|||
// Refer to term.disabled for the disabled option
|
||||
"settings.header.connectivity.discordRPC.cider": "HODOR HODOR 'HODOR'",
|
||||
"settings.header.connectivity.discordRPC.appleMusic": "HODOR HODOR 'HODOR HODOR'",
|
||||
"settings.option.connectivity.discordRPC.clearOnPause": "HODOR HODOR HODOR HODOR HODOR HODOR", // Toggle
|
||||
"settings.option.connectivity.lastfmScrobble": "HODOR HODOR", // Option to Connect
|
||||
"settings.option.connectivity.lastfmScrobble.delay": "HODOR HODOR HODOR (%)",
|
||||
"settings.option.connectivity.lastfmScrobble.nowPlaying": "HODOR HODOR HODOR HODOR",
|
||||
|
|
|
@ -229,7 +229,6 @@
|
|||
// Refer to term.disabled for the disabled option
|
||||
"settings.header.connectivity.discordRPC.cider": "↸╎ϟi!|:ᖋ॥ ᖋϟ 'ᔮ╎↸ᒷ∷'",
|
||||
"settings.header.connectivity.discordRPC.appleMusic": "↸╎ϟi!|:ᖋ॥ ᖋϟ 'ᖋi!i!|:ᒷ ᒲ⚍ϟ╎ᔮ'",
|
||||
"settings.option.connectivity.discordRPC.clearOnPause": "ᔮ|:ᒷᖋ∷ ↸╎ϟᔮᒍ∷↸ ∷╎ᔮ⍑ i!∷ᒷϟᒷリᔮᒷ ᒍリ i!ᖋ⚍ϟᒷ", // Toggle
|
||||
"settings.option.connectivity.lastfmScrobble": "|:ᖋϟᒣ⎓ᒲ ϟᔮ∷ᒍᕊᕊ|:╎リ┤", // Option to Connect
|
||||
"settings.option.connectivity.lastfmScrobble.delay": "|:ᖋϟᒣ⎓ᒲ ϟᔮ∷ᒍᕊᕊ|:ᒷ ↸ᒷ|:ᖋ॥ (%)",
|
||||
"settings.option.connectivity.lastfmScrobble.nowPlaying": "ᒷリᖋᕊ|:ᒷ |:ᖋϟᒣ⎓ᒲ リᒍ∴ i!|:ᖋ॥╎リ┤",
|
||||
|
|
|
@ -229,7 +229,6 @@
|
|||
// Refer to term.disabled for the disabled option
|
||||
"settings.header.connectivity.discordRPC.cider": "Display as 'Cider'",
|
||||
"settings.header.connectivity.discordRPC.appleMusic": "Display as 'Apple Music'",
|
||||
"settings.option.connectivity.discordRPC.clearOnPause": "Clear Discord Rich Presence on Pause", // Toggle
|
||||
"settings.option.connectivity.lastfmScrobble": "LastFM Scrobbling", // Option to Connect
|
||||
"settings.option.connectivity.lastfmScrobble.delay": "LastFM Scrobble Delay (%)",
|
||||
"settings.option.connectivity.lastfmScrobble.nowPlaying": "Enable LastFM Now Playing",
|
||||
|
|
|
@ -181,7 +181,6 @@
|
|||
// Refer to term.disabled for the disabled option
|
||||
"settings.header.connectivity.discordRPC.cider": "Megjelenítés 'Cider'-ként",
|
||||
"settings.header.connectivity.discordRPC.appleMusic": "Megjelenítés 'Apple Music'-ként",
|
||||
"settings.option.connectivity.discordRPC.clearOnPause": "Discord Rich Presence törlése megállításnál", // Toggle
|
||||
"settings.option.connectivity.lastfmScrobble": "LastFM Scrobbling", // Option to Connect
|
||||
// Refer to term.connect for the connect button
|
||||
|
||||
|
|
|
@ -227,7 +227,6 @@
|
|||
// Refer to term.disabled for the disabled option
|
||||
"settings.header.connectivity.discordRPC.cider": "'Cider' を表示する",
|
||||
"settings.header.connectivity.discordRPC.appleMusic": "'Apple Music' を表示する",
|
||||
"settings.option.connectivity.discordRPC.clearOnPause": "一時停止時にDiscord Rich Presenceをクリアする", // Toggle
|
||||
"settings.option.connectivity.lastfmScrobble": "LastFM Scrobbling", // Option to Connect
|
||||
"settings.option.connectivity.lastfmScrobble.delay": "LastFM Scrobble Delay (%)",
|
||||
"settings.option.connectivity.lastfmScrobble.nowPlaying": "Enable LastFM Now Playing",
|
||||
|
|
|
@ -194,7 +194,6 @@
|
|||
// Refer to term.disabled for the disabled option
|
||||
"settings.header.connectivity.discordRPC.cider": "Mostrar como 'Cider'",
|
||||
"settings.header.connectivity.discordRPC.appleMusic": "Mostrar como 'Apple Music'",
|
||||
"settings.option.connectivity.discordRPC.clearOnPause": "Apagar Discord Rich Presence quando estiver pausado", // Toggle
|
||||
"settings.option.connectivity.lastfmScrobble": "LastFM Scrobbling", // Option to Connect
|
||||
"settings.option.connectivity.lastfmScrobble.delay": "Atraso dos Scrobbles do LastFM (%)",
|
||||
"settings.option.connectivity.lastfmScrobble.nowPlaying": "Ativar LastFM Now Playing",
|
||||
|
|
|
@ -233,7 +233,6 @@
|
|||
// Refer to term.disabled for the disabled option
|
||||
"settings.header.connectivity.discordRPC.cider": "'Cider' Olarak",
|
||||
"settings.header.connectivity.discordRPC.appleMusic": "'Apple Music' Olarak",
|
||||
"settings.option.connectivity.discordRPC.clearOnPause": "Duraklatıldığında Discord'da Gösterme", // Toggle
|
||||
"settings.option.connectivity.lastfmScrobble": "LastFM Bağlantısı", // Option to Connect
|
||||
"settings.option.connectivity.lastfmScrobble.removeFeatured": "Albüm sanatçısını Scrobbledan kaldır(LastFM)",
|
||||
"settings.option.connectivity.lastfmScrobble.filterLoop": "Tekrar edilen şarkıyı filtrele (LastFM)",
|
||||
|
|
|
@ -229,7 +229,6 @@
|
|||
// Refer to term.disabled for the disabled option
|
||||
"settings.header.connectivity.discordRPC.cider": "显示正在玩 'Cider'",
|
||||
"settings.header.connectivity.discordRPC.appleMusic": "显示正在玩 'Apple Music'",
|
||||
"settings.option.connectivity.discordRPC.clearOnPause": "暂停时清除Discord 动态", // Toggle
|
||||
"settings.option.connectivity.lastfmScrobble": "LastFM Scrobbling 记录", // Option to Connect
|
||||
"settings.option.connectivity.lastfmScrobble.delay": "LastFM Scrobble 延迟 (%)",
|
||||
"settings.option.connectivity.lastfmScrobble.nowPlaying": "启用 LastFM 正在播放",
|
||||
|
|
|
@ -224,7 +224,6 @@
|
|||
// Refer to term.disabled for the disabled option
|
||||
"settings.header.connectivity.discordRPC.cider": "顯示為'Cider'",
|
||||
"settings.header.connectivity.discordRPC.appleMusic": "顯示為'Apple Music'",
|
||||
"settings.option.connectivity.discordRPC.clearOnPause": "暫停時清除 Discord 狀態", // Toggle
|
||||
"settings.option.connectivity.lastfmScrobble": "LastFM Scrobbling 記錄", // Option to Connect
|
||||
"settings.option.connectivity.lastfmScrobble.delay": "LastFM Scrobble 延遲 (%)",
|
||||
"settings.option.connectivity.lastfmScrobble.nowPlaying": "啟用 LastFM 正在播放",
|
||||
|
|
|
@ -228,7 +228,6 @@
|
|||
// Refer to term.disabled for the disabled option
|
||||
"settings.header.connectivity.discordRPC.cider": "顯示正在玩 'Cider'",
|
||||
"settings.header.connectivity.discordRPC.appleMusic": "顯示正在玩 'Apple Music'",
|
||||
"settings.option.connectivity.discordRPC.clearOnPause": "暫停時清除 Discord 動態", // Toggle
|
||||
"settings.option.connectivity.lastfmScrobble": "LastFM Scrobbling 記錄", // Option to Connect
|
||||
"settings.option.connectivity.lastfmScrobble.delay": "LastFM Scrobble 延遲 (%)",
|
||||
"settings.option.connectivity.lastfmScrobble.nowPlaying": "啟用 LastFM 目前聆聽", // Toggle
|
||||
|
|
|
@ -15,8 +15,6 @@ export class AppEvents {
|
|||
private static win: any = null;
|
||||
|
||||
constructor(store: any) {
|
||||
console.log('App started');
|
||||
|
||||
AppEvents.store = store
|
||||
AppEvents.start(store);
|
||||
}
|
||||
|
@ -26,7 +24,7 @@ export class AppEvents {
|
|||
* @returns {void}
|
||||
*/
|
||||
private static start(store: any): void {
|
||||
console.log('App started');
|
||||
console.info('[AppEvents] App started');
|
||||
|
||||
/**********************************************************************************************************************
|
||||
* Startup arguments handling
|
||||
|
@ -38,7 +36,7 @@ export class AppEvents {
|
|||
|
||||
// Verbose Check
|
||||
if (electron.app.commandLine.hasSwitch('verbose')) {
|
||||
console.log("[Apple-Music-Electron] User has launched the application with --verbose");
|
||||
console.log("[Cider] User has launched the application with --verbose");
|
||||
}
|
||||
|
||||
// Log File Location
|
||||
|
@ -103,7 +101,7 @@ export class AppEvents {
|
|||
|
||||
public ready(plug: any) {
|
||||
AppEvents.plugin = plug
|
||||
console.log('App ready');
|
||||
console.log('[AppEvents] App ready');
|
||||
}
|
||||
|
||||
public bwCreated(win: Electron.BrowserWindow) {
|
||||
|
|
|
@ -44,7 +44,7 @@ export default class PluginHandler {
|
|||
}
|
||||
});
|
||||
}
|
||||
console.log('loaded plugins:', JSON.stringify(plugins))
|
||||
console.log('[PluginHandler] Loaded plugins:', Object.keys(plugins));
|
||||
return plugins;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ export class ConfigStore {
|
|||
"close_behavior": 0, // 0 = close, 1 = minimize, 2 = minimize to tray
|
||||
"startup_behavior": 0, // 0 = nothing, 1 = open on startup
|
||||
"discord_rpc": 1, // 0 = disabled, 1 = enabled as Cider, 2 = enabled as Apple Music
|
||||
"discordClearActivityOnPause": 1, // 0 = disabled, 1 = enabled
|
||||
"language" : "en_US"
|
||||
},
|
||||
"home": {
|
||||
|
|
|
@ -21,7 +21,7 @@ export default class ExamplePlugin {
|
|||
constructor(app: any, store: any) {
|
||||
this._app = app;
|
||||
this._store = store;
|
||||
console.log('Example plugin loaded');
|
||||
console.debug(`[Plugin][${this.name}] Loading Complete.`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,14 +29,14 @@ export default class ExamplePlugin {
|
|||
*/
|
||||
onReady(win: any): void {
|
||||
this._win = win;
|
||||
console.log('Example plugin ready');
|
||||
console.debug(`[Plugin][${this.name}] Ready.`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs on app stop
|
||||
*/
|
||||
onBeforeQuit(): void {
|
||||
console.log('Example plugin stopped');
|
||||
console.debug(`[Plugin][${this.name}] Stopped.`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,55 +1,93 @@
|
|||
import * as DiscordRPC from 'discord-rpc'
|
||||
import * as RPC from 'discord-rpc'
|
||||
|
||||
export default class DiscordRichPresence {
|
||||
|
||||
export default class DiscordRPCPlugin {
|
||||
/**
|
||||
* Private variables for interaction in plugins
|
||||
*/
|
||||
private _win: Electron.BrowserWindow | undefined;
|
||||
private _app: any;
|
||||
private _store: any;
|
||||
private _discord: any;
|
||||
private static _store: any;
|
||||
private static _connection: boolean = false;
|
||||
|
||||
/**
|
||||
* Base Plugin Details (Eventually implemented into a GUI in settings)
|
||||
*/
|
||||
public name: string = 'Discord Rich Presence';
|
||||
public description: string = 'Discord RPC plugin for Cider';
|
||||
public version: string = '1.0.0';
|
||||
public author: string = 'vapormusic/Core (Cider Collective)';
|
||||
|
||||
/**
|
||||
* Plugin Initialization
|
||||
*/
|
||||
private _client: any = null;
|
||||
private _activity: RPC.Presence = {
|
||||
details: '',
|
||||
state: '',
|
||||
largeImageKey: '',
|
||||
largeImageText: '',
|
||||
smallImageKey: '',
|
||||
smallImageText: '',
|
||||
instance: false
|
||||
};
|
||||
private _activityCache: RPC.Presence = {
|
||||
details: '',
|
||||
state: '',
|
||||
largeImageKey: '',
|
||||
largeImageText: '',
|
||||
smallImageKey: '',
|
||||
smallImageText: '',
|
||||
instance: false
|
||||
};
|
||||
|
||||
/*******************************************************************************************
|
||||
* Private Methods
|
||||
* ****************************************************************************************/
|
||||
|
||||
/**
|
||||
* Connect to Discord
|
||||
* @param clientId
|
||||
* @private
|
||||
*/
|
||||
private connect(clientId: any) {
|
||||
this._discord = {isConnected: false};
|
||||
if (this._store.general.discord_rpc == 0 || this._discord.isConnected) return;
|
||||
if (DiscordRichPresence._store.general.discord_rpc == 0) {
|
||||
return
|
||||
}
|
||||
|
||||
DiscordRPC.register(clientId) // Apparently needed for ask to join, join, spectate etc.
|
||||
const client = new DiscordRPC.Client({transport: "ipc"});
|
||||
this._discord = Object.assign(client, {error: false, activityCache: null, isConnected: false});
|
||||
// Apparently needed for ask to join, join, spectate etc.
|
||||
RPC.register(clientId)
|
||||
|
||||
// Login to Discord
|
||||
this._discord.login({clientId})
|
||||
.then(() => {
|
||||
this._discord.isConnected = true;
|
||||
})
|
||||
.catch((e: any) => console.error(`[DiscordRPC][connect] ${e}`));
|
||||
// Create the client
|
||||
this._client = new RPC.Client({transport: "ipc"});
|
||||
|
||||
this._discord.on('ready', () => {
|
||||
console.log(`[DiscordRPC][connect] Successfully Connected to Discord. Authed for user: ${client.user.username} (${client.user.id})`);
|
||||
// Runs on Ready
|
||||
this._client.on('ready', () => {
|
||||
console.info(`[DiscordRPC][connect] Successfully Connected to Discord. Authed for user: ${this._client.user.id}.`);
|
||||
})
|
||||
|
||||
// Handles Errors
|
||||
this._discord.on('error', (err: any) => {
|
||||
console.error(`[DiscordRPC] ${err}`);
|
||||
this._client.on('error', (err: any) => {
|
||||
console.error(`[DiscordRichPresence] ${err}`);
|
||||
this.disconnect()
|
||||
this._discord.isConnected = false;
|
||||
});
|
||||
|
||||
// Login to Discord
|
||||
this._client.login({clientId})
|
||||
.then(() => {
|
||||
DiscordRichPresence._connection = true;
|
||||
})
|
||||
.catch((e: any) => console.error(`[DiscordRichPresence][connect] ${e}`));
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnects from Discord RPC
|
||||
*/
|
||||
private disconnect() {
|
||||
if (this._store.general.discord_rpc == 0 || !this._discord.isConnected) return;
|
||||
if (!this._client) return;
|
||||
|
||||
try {
|
||||
this._discord.destroy().then(() => {
|
||||
this._discord.isConnected = false;
|
||||
this._client.destroy().then(() => {
|
||||
DiscordRichPresence._connection = false;
|
||||
console.log('[DiscordRPC][disconnect] Disconnected from discord.')
|
||||
}).catch((e: any) => console.error(`[DiscordRPC][disconnect] ${e}`));
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -57,141 +95,70 @@ export default class DiscordRPCPlugin {
|
|||
* @param {object} attributes
|
||||
*/
|
||||
private updateActivity(attributes: any) {
|
||||
if (this._store.general.discord_rpc == 0) return;
|
||||
if (!this._client) return;
|
||||
|
||||
if (!this._discord.isConnected) {
|
||||
this._discord.clearActivity().catch((e: any) => console.error(`[DiscordRPC][updateActivity] ${e}`));
|
||||
if (!DiscordRichPresence._connection) {
|
||||
this._client.clearActivity().catch((e: any) => console.error(`[DiscordRichPresence][clearActivity] ${e}`));
|
||||
return;
|
||||
}
|
||||
|
||||
// console.log('[DiscordRPC][updateActivity] Updating Discord Activity.')
|
||||
|
||||
const listenURL = `https://cider.sh/p?s&id=${attributes.playParams.id}` // cider://play/s/[id] (for song)
|
||||
//console.log(attributes)
|
||||
|
||||
interface ActObject extends DiscordRPC.Presence {
|
||||
details?: any,
|
||||
state?: any,
|
||||
startTimestamp?: any,
|
||||
endTimestamp?: any,
|
||||
largeImageKey?: any,
|
||||
largeImageText?: any,
|
||||
smallImageKey?: any,
|
||||
smallImageText?: any,
|
||||
instance: true,
|
||||
buttons?: [
|
||||
{
|
||||
label: string,
|
||||
url: string
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
let ActivityObject: ActObject | null = {
|
||||
this._activity = {
|
||||
details: attributes.name,
|
||||
state: `by ${attributes.artistName}`,
|
||||
startTimestamp: attributes.startTime,
|
||||
endTimestamp: attributes.endTime,
|
||||
state: `${attributes.artistName ? `by ${attributes.artistName}` : ''}`,
|
||||
startTimestamp: ((new Date(attributes.endTime).getTime() < 0) ? null : attributes.startTime),
|
||||
endTimestamp: ((new Date(attributes.endTime).getTime() < 0) ? null : attributes.endTime),
|
||||
largeImageKey: (attributes.artwork.url.replace('{w}', '1024').replace('{h}', '1024')) ?? 'cider',
|
||||
largeImageText: attributes.albumName,
|
||||
smallImageKey: (attributes.status ? 'play' : 'pause'),
|
||||
smallImageText: (attributes.status ? 'Playing' : 'Paused'),
|
||||
instance: true,
|
||||
instance: false, // Whether the activity is in a game session
|
||||
buttons: [
|
||||
{label: "Listen on Cider", url: listenURL},
|
||||
]
|
||||
};
|
||||
if (ActivityObject.largeImageKey == "" || ActivityObject.largeImageKey == null) {
|
||||
ActivityObject.largeImageKey = (this._store.general.discord_rpc == 1) ? "cider" : "logo"
|
||||
}
|
||||
|
||||
// Remove the pause/play icon and test for clear activity on pause
|
||||
if (this._store.general.discordClearActivityOnPause == 1) {
|
||||
delete ActivityObject.smallImageKey
|
||||
delete ActivityObject.smallImageText
|
||||
}
|
||||
|
||||
// Deletes the timestamp if its not greater than 0
|
||||
if (!((new Date(attributes.endTime)).getTime() > 0)) {
|
||||
delete ActivityObject.startTimestamp
|
||||
delete ActivityObject.endTimestamp
|
||||
}
|
||||
|
||||
// Artist check
|
||||
if (!attributes.artistName) {
|
||||
delete ActivityObject.state
|
||||
}
|
||||
|
||||
// Album text check
|
||||
if (!ActivityObject.largeImageText || ActivityObject.largeImageText.length < 2) {
|
||||
delete ActivityObject.largeImageText
|
||||
}
|
||||
|
||||
// Checks if the name is greater than 128 because some songs can be that long
|
||||
if (ActivityObject.details.length > 128) {
|
||||
ActivityObject.details = ActivityObject.details.substring(0, 125) + '...'
|
||||
if (this._activity.details && this._activity.details.length > 128) {
|
||||
this._activity.details = this._activity.details.substring(0, 125) + '...'
|
||||
}
|
||||
|
||||
|
||||
// Check if its pausing (false) or playing (true)
|
||||
if (!attributes.status) {
|
||||
if (this._store.general.discordClearActivityOnPause == 1) {
|
||||
this._discord.clearActivity().catch((e: any) => console.error(`[DiscordRPC][clearActivity] ${e}`));
|
||||
ActivityObject = null
|
||||
} else {
|
||||
delete ActivityObject.startTimestamp
|
||||
delete ActivityObject.endTimestamp
|
||||
ActivityObject.smallImageKey = 'pause'
|
||||
ActivityObject.smallImageText = 'Paused'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ActivityObject && ActivityObject !== this._discord.activityCache && ActivityObject.details && ActivityObject.state) {
|
||||
try {
|
||||
// console.log(`[DiscordRPC][setActivity] Setting activity to ${JSON.stringify(ActivityObject)}`);
|
||||
this._discord.setActivity(ActivityObject)
|
||||
this._discord.activityCache = ActivityObject
|
||||
} catch (err) {
|
||||
console.error(`[DiscordRPC][setActivity] ${err}`)
|
||||
this._client.clearActivity()
|
||||
.catch((e: any) => console.error(`[DiscordRichPresence][clearActivity] ${e}`));
|
||||
} else if (this._activity && this._activityCache !== this._activity && this._activity.details) {
|
||||
this._client.setActivity(this._activity)
|
||||
.catch((e: any) => console.error(`[DiscordRichPresence][updateActivity] ${e}`));
|
||||
this._activityCache = this._activity;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Base Plugin Details (Eventually implemented into a GUI in settings)
|
||||
*/
|
||||
public name: string = 'DiscordRPCPlugin';
|
||||
public description: string = 'Discord RPC plugin for Cider';
|
||||
public version: string = '0.0.1';
|
||||
public author: string = 'vapormusic / Cider Collective';
|
||||
/*******************************************************************************************
|
||||
* Public Methods
|
||||
* ****************************************************************************************/
|
||||
|
||||
/**
|
||||
* Runs on plugin load (Currently run on application start)
|
||||
*/
|
||||
constructor(app: any, store: any) {
|
||||
this._app = app;
|
||||
this._store = store
|
||||
constructor(_app: any, store: any) {
|
||||
DiscordRichPresence._store = store
|
||||
console.debug(`[Plugin][${this.name}] Loading Complete.`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs on app ready
|
||||
*/
|
||||
onReady(win: any): void {
|
||||
this._win = win;
|
||||
this.connect((this._store.general.discord_rpc == 1) ? '911790844204437504' : '886578863147192350');
|
||||
// electron.ipcMain.on("forceUpdateRPC", (event, attributes : object) => {
|
||||
// this.updateActivity(attributes)
|
||||
// });
|
||||
onReady(_win: any): void {
|
||||
this.connect((DiscordRichPresence._store.general.discord_rpc == 1) ? '911790844204437504' : '886578863147192350');
|
||||
console.debug(`[Plugin][${this.name}] Ready.`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs on app stop
|
||||
*/
|
||||
onBeforeQuit(): void {
|
||||
console.log('Example plugin stopped');
|
||||
console.debug(`[Plugin][${this.name}] Stopped.`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,5 +176,4 @@ export default class DiscordRPCPlugin {
|
|||
onNowPlayingItemDidChange(attributes: object): void {
|
||||
this.updateActivity(attributes)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ export default class MPRIS {
|
|||
/**
|
||||
* Blocks non-linux systems from running this plugin
|
||||
* @private
|
||||
* @decorator
|
||||
*/
|
||||
private static linuxOnly(_target: any, _propertyKey: string, descriptor: PropertyDescriptor) {
|
||||
if (process.platform !== 'linux') {
|
||||
|
@ -53,7 +54,6 @@ export default class MPRIS {
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -157,7 +157,7 @@ export default class MPRIS {
|
|||
*/
|
||||
constructor(app: any, _store: any) {
|
||||
this._app = app;
|
||||
console.log(`[${this.name}] plugin loaded`);
|
||||
console.debug(`[Plugin][${this.name}] Loading Complete.`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -165,7 +165,7 @@ export default class MPRIS {
|
|||
*/
|
||||
onReady(win: any): void {
|
||||
this._win = win;
|
||||
console.log(`[${this.name}] plugin ready`);
|
||||
console.debug(`[Plugin][${this.name}] Ready.`);
|
||||
this.connect()
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ export default class MPRIS {
|
|||
* Runs on app stop
|
||||
*/
|
||||
onBeforeQuit(): void {
|
||||
console.log(`[${this.name}] plugin stopped`);
|
||||
console.debug(`[Plugin][${this.name}] Stopped.`);
|
||||
this.clearState()
|
||||
}
|
||||
|
||||
|
|
|
@ -459,17 +459,6 @@
|
|||
</select>
|
||||
</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">
|
||||
<select class="md-select" v-model="app.cfg.general.discordClearActivityOnPause">
|
||||
<option value="0">{{$root.getLz('term.disabled')}}</option>
|
||||
<option value="1">{{$root.getLz('term.enabled')}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-option-line">
|
||||
<div class="md-option-segment">
|
||||
{{$root.getLz('settings.option.connectivity.lastfmScrobble')}}
|
||||
|
|
|
@ -11,7 +11,11 @@
|
|||
"paths": {
|
||||
"*": ["node_modules/*"]
|
||||
},
|
||||
"allowSyntheticDefaultImports": true
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"typeRoots": [
|
||||
"node_modules/musickit-typescript",
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue