Skip to content

Commit

Permalink
Merge pull request #3 from DorvakOff/develop
Browse files Browse the repository at this point in the history
v1.0.3
  • Loading branch information
DorvakOff authored Jan 10, 2024
2 parents 1c2bd10 + 9e4ffc5 commit 3b0e177
Show file tree
Hide file tree
Showing 10 changed files with 248 additions and 116 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,32 @@
![DeezerRPC](.github/assets/README.png)


## Installation
1. Download the latest release from [here](https://github.com/DorvakOff/DeezerRPC/releases/latest).
2. Extract the archive.
3. On Windows, run `DeezerRPC.exe`. On Linux, run `DeezerRPC`. And on macOS, run `DeezerRPC.app`.

# Shortcuts (keyboard)

## Usage
### Shortcuts (keyboard) / Taskbar buttons
- Play/Pause : Pause/Resume the current song.
- Next : Play the next song.
- Previous : Play the previous song.

### Settings (tray / notifications icon)
> Settings are available in the tray icon (located in the notification icons area)
- Toggle: Shows or hides the DeezerRPC window.
- Player: Manually control basic player actions outside main window.
- Settings: Miscellaneous options like controlling how the window is minimized and checking for updates on startup.
- Check for updates: Check if there is a new version available.
- DeezerRPC [version]: Open this GitHub page.
- Exit: Closes the application.


## Notes
- This application is not affiliated with Deezer or Discord.
- This work is based on [DeezerRPC by Braasileiro](https://github.com/Braasileiro/DeezerRPC)

## Data-Protection
> This application does not collect any data from you. The only data that is being sent is the data that is required for the Discord Rich Presence to work. This includes the song title, artist name, album name, album cover and the current time of the song. This data is only being sent to Discord and not to any other third-party service.
### Data-Protection
> This application does not collect any data from you. The only data that is being sent is the data that is required for the Discord Rich Presence to work. This includes the song title, artist name, album name, album cover and the current time of the song. This data is only being sent to Discord and not to any other third-party service.
16 changes: 16 additions & 0 deletions deploy/clean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const fs = require('fs');

let folders = [
'dist',
'build',
];

function clean() {
folders.forEach(folder => {
if (fs.existsSync(folder)) {
fs.rmdirSync(folder, { recursive: true });
}
});
}

clean();
File renamed without changes.
66 changes: 56 additions & 10 deletions package-lock.json

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

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "deezer-rpc",
"version": "1.0.2",
"version": "1.0.3",
"description": "Deezer integrated with the Discord Rich Presence.",
"main": "build/main.js",
"scripts": {
"clean": "node deploy/clean.js",
"tsc": "tsc",
"package-assets": "node package-assets.js",
"build": "npm run tsc && npm run package-assets",
"package-assets": "node deploy/package-assets.js",
"build": "npm run clean && npm run tsc && npm run package-assets",
"start": "npm run build && electron ./build/main.js",
"pack": "npm run build && electron-builder --dir",
"dist": "npm run build && electron-builder",
Expand Down Expand Up @@ -63,11 +64,12 @@
"typescript": "^4.5.5"
},
"dependencies": {
"custom-electron-titlebar": "^4.1.0",
"discord-rpc": "^4.0.1",
"electron-settings": "^4.0.2",
"electron-store": "^8.0.1",
"electron-window-state": "^5.0.3",
"got": "^11.8.2",
"set-interval-async": "^2.0.3",
"custom-electron-titlebar": "^4.1.0"
"set-interval-async": "^2.0.3"
}
}
33 changes: 24 additions & 9 deletions src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import ElectronStore from 'electron-store';

const PACKAGE = require('../../package.json');

// Global
declare global {
var __mainWindow: BrowserWindow;
}

// App
export const APP = {
name: 'DeezerRPC',
Expand All @@ -24,20 +19,40 @@ export const APP = {
},
preferences: {
closeToTray: 'closeToTray',
minimizeToTray: 'minimizeToTray',
checkUpdates: 'checkUpdates'
checkUpdates: 'checkUpdates',
startOnStartup: 'startOnStartup',
},
};

export const APP_CONFIG = new ElectronStore({
defaults: {
closeToTray: true,
minimizeToTray: true,
checkUpdates: true,
startOnStartup: true,
}
});

// RPC
export const RPC = new Client({
export let RPC = new Client({
transport: 'ipc'
});

let firstTime = true;

export function resetRPC() {
let newClient = new Client({
transport: 'ipc'
});

if (firstTime) {
firstTime = false;
RPC = newClient;
return;
}

RPC.destroy().then(() => {
RPC = newClient;
}).catch(() => {
RPC = newClient;
})
}
Loading

0 comments on commit 3b0e177

Please sign in to comment.