Skip to content

Commit

Permalink
v0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
LeWarpy committed Nov 26, 2024
1 parent af49e55 commit 609a7ce
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 64 deletions.
96 changes: 86 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 25 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "qobuz-desktop-player",
"productName": "Qobuz Desktop player",
"version": "0.1.3",
"version": "0.1.4",
"description": "Qobuz desktop player avec Discord RPC",
"main": "index.js",
"scripts": {
Expand All @@ -23,7 +23,9 @@
"babel-register": "^6.26.0",
"discord-rpc": "^4.0.1",
"electron-config": "^1.0.0",
"electron-settings": "^4.0.2"
"electron-log": "^5.2.3",
"electron-settings": "^4.0.2",
"electron-updater": "^6.3.9"
},
"devDependencies": {
"electron": "^33.0.2",
Expand All @@ -32,13 +34,32 @@
},
"build": {
"appId": "lewarpy.qobuz.desktop.player",
"win": {
"target": [
"nsis"
],
"arch": [
"x64",
"ia32"
]
},
"mac": {
"category": "public.app-category.music"
},
"category": "public.app-category.music"
},
"linux": {
"target": [
"AppImage"
]
},
"publish": {
"provider": "github",
"releaseType": "release"
},
"nsis": {
"oneClick": true,
"allowToChangeInstallationDirectory": false,
"createDesktopShortcut": true,
"runAfterFinish": true
}
}
}
45 changes: 0 additions & 45 deletions src/electron/component/menu.js

This file was deleted.

19 changes: 14 additions & 5 deletions src/electron/main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { app, ipcMain, BrowserWindow } from 'electron';
import { autoUpdater } from 'electron-updater';
import path from 'path';
import url from 'url';

import getConfig from './config';
import appTray from './component/tray';
import appMenu from './component/menu';
import Action from './component/action';

autoUpdater.logger = require("electron-log")
autoUpdater.logger.transports.file.level = "info"
const RPC = require('discord-rpc');
const clientId = '1309120404027080706';

Expand Down Expand Up @@ -55,24 +57,26 @@ function createWindow() {
const action = new Action(mainWindow, config);

tray = appTray(config, action);
appMenu(config, action);

}

autoUpdater.autoDownload = true;

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', () => {
createWindow();

autoUpdater.checkForUpdatesAndNotify();

rpc.on('ready', () => {
console.log('RPC connected');
});

ipcMain.on('update-discord-rpc', (event, data) => {
if (data) {
const icon = data.paused ? 'pause_bw' : 'play_bw';
const playing = data.paused ? 'En paused' : 'En lecture';
const playing = data.paused ? 'En pause' : 'En lecture';

rpc.setActivity({
details: `${data.trackName} - ${data.artist}`,
Expand Down Expand Up @@ -112,4 +116,9 @@ app.on('before-quit', () => willQuitApp = true);;
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

rpc.login({ clientId }).catch(console.error);
rpc.login({ clientId }).catch(console.error);

ipcMain.handle('relaunch-app', () => {
app.relaunch();
app.exit();
});

0 comments on commit 609a7ce

Please sign in to comment.