From cf0512f36381c4e9274043ae7be9dc01810c6d4e Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sun, 19 Jan 2025 20:22:17 +0100 Subject: [PATCH 01/34] feat: update url and sha256 to v7.0.1 --- dev.aunetx.deezer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev.aunetx.deezer.json b/dev.aunetx.deezer.json index b1638c8..452a276 100644 --- a/dev.aunetx.deezer.json +++ b/dev.aunetx.deezer.json @@ -6,8 +6,8 @@ "sources": [ { "type": "archive", - "url": "https://e-cdn-content.dzcdn.net/builds/deezer-desktop/8cF2rAuKxLcU1oMDmCYm8Uiqe19Ql0HTySLssdzLkQ9ZWHuDTp2JBtQOvdrFzWPA/win32/x86/6.0.150/DeezerDesktopSetup_6.0.150.exe", - "sha256": "0ecf85dc7988bc1c26bf12f22b800eeb813b943b7453b8ac5fa9a103ccc075f5", + "url": "https://e-cdn-content.dzcdn.net/builds/deezer-desktop/8cF2rAuKxLcU1oMDmCYm8Uiqe19Ql0HTySLssdzLkQ9ZWHuDTp2JBtQOvdrFzWPA/win32/x86/7.0.1/DeezerDesktopSetup_7.0.1.exe", + "sha256": "1ae2de0b55d564da53832cab86eed076132ad1df7420b85b4e6bdfa606a1b195", "only-arches": ["x86_64"], "dest": "archive", "x-checker-data": { From 987db981bf60e82c8632b861b9df1cdf1996bf81 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sun, 19 Jan 2025 20:43:47 +0100 Subject: [PATCH 02/34] fix: patches contain invalid/unappliable hunks. Skipping... --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c477a22..97bbb93 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ prepare: clean install_build_deps @echo "Remove kernel version from User-Agent (https://github.com/aunetx/deezer-linux/pull/9)" @echo "Avoid to set the text/html mime type (https://github.com/aunetx/deezer-linux/issues/13)" @echo "Add a better management of MPRIS (https://github.com/aunetx/deezer-linux/pull/61)" - $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) + # $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) @echo "Append `package-append.json` to the `package.json` of the app" @echo "Adds electron, elecron-builder dependencies, and build directives" From b4699a0df3d6e7da9493cc9b18bbc572f9654a42 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sun, 19 Jan 2025 21:37:17 +0100 Subject: [PATCH 03/34] fix: update electron version --- Makefile | 5 ++--- package-append.json | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 97bbb93..bb24431 100644 --- a/Makefile +++ b/Makefile @@ -41,9 +41,8 @@ prepare: clean install_build_deps # $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) @echo "Append `package-append.json` to the `package.json` of the app" - @echo "Adds electron, elecron-builder dependencies, and build directives" - @head -n -1 app/package.json > tmp.txt && mv tmp.txt app/package.json - @cat package-append.json | tee -a app/package.json + @echo "Adds electron, elecron-builder dependencies, prod and build directives" + @jq -s '.[0] * .[1]' app/package.json package-append.json > app/tmp.json && mv app/tmp.json app/package.json @echo "Download new packages" @npm i diff --git a/package-append.json b/package-append.json index 6bdbeca..4b7e59e 100644 --- a/package-append.json +++ b/package-append.json @@ -1,4 +1,5 @@ - ,"scripts": { +{ + "scripts": { "copy-resources": "mkdir -p resources/linux && cp ../extra/linux/* ./resources/linux", "start": "yarn run copy-resources && electron .", "prepare-flatpak": "electron-builder --linux --dir", @@ -15,13 +16,11 @@ "build-appimage-arm64": "electron-builder --arm64 --linux AppImage" }, "devDependencies": { - "electron": "^13.6.9", + "electron": "^33.2.0", "electron-builder": "^23.0.3" }, "build": { - "files": [ - "**" - ], + "files": ["**"], "directories": { "buildResources": "build", "output": "../artifacts/${arch}" From 719197ccbc052731699d00853cad68ceedaeb7d5 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sun, 19 Jan 2025 23:11:45 +0100 Subject: [PATCH 04/34] fix(patch): update start hidden in tray --- Makefile | 2 +- patches/start-hidden-in-tray.patch | 33 ++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index bb24431..b8b8572 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ prepare: clean install_build_deps @echo "Remove kernel version from User-Agent (https://github.com/aunetx/deezer-linux/pull/9)" @echo "Avoid to set the text/html mime type (https://github.com/aunetx/deezer-linux/issues/13)" @echo "Add a better management of MPRIS (https://github.com/aunetx/deezer-linux/pull/61)" - # $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) + $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) @echo "Append `package-append.json` to the `package.json` of the app" @echo "Adds electron, elecron-builder dependencies, prod and build directives" diff --git a/patches/start-hidden-in-tray.patch b/patches/start-hidden-in-tray.patch index 52defae..ad89045 100644 --- a/patches/start-hidden-in-tray.patch +++ b/patches/start-hidden-in-tray.patch @@ -1,19 +1,34 @@ +From 9c19490f706350a2ca8cceae7a998916d21de89b Mon Sep 17 00:00:00 2001 +From: josselinonduty +Date: Sun, 19 Jan 2025 22:59:38 +0100 +Subject: [PATCH] fix: reduce to systray on close + +--- + build/main.js | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + diff --git a/build/main.js b/build/main.js -index 5066eef..592a6bc 100644 +index c15e2c3..b883a28 100644 --- a/build/main.js +++ b/build/main.js -@@ -3122,8 +3122,12 @@ +@@ -3085,10 +3085,13 @@ finalMinSize[1] ); } -- isDev() ? this.window.showInactive() : this.window.show(), +- isDev(external_electron_namespaceObject.app) +- ? this.window.showInactive() +- : this.window.show(), - this.thumbar.init(); -+ if (!process.argv.some(arg => arg === '--start-in-tray')) { -+ isDev() ? this.window.showInactive() : this.window.show(), -+ this.thumbar.init(); -+ } else { ++ if (!process.argv.some(arg => arg === '--start-in-tray')) ++ isDev(external_electron_namespaceObject.app) ++ ? this.window.showInactive() ++ : this.window.show(), ++ this.thumbar.init(); ++ else + this.window.hide(); -+ } }), this.appService.enableDevMode(); - } \ No newline at end of file + } +-- +2.43.0 + From 8ff9dc5adda4925dcb655569d8139794934cf1ad Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sun, 19 Jan 2025 23:20:39 +0100 Subject: [PATCH 05/34] fix(patch): update avoid default mimetype --- ...avoid-change-default-texthtml-mime-type.patch | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/patches/avoid-change-default-texthtml-mime-type.patch b/patches/avoid-change-default-texthtml-mime-type.patch index aa563c8..6d826c6 100644 --- a/patches/avoid-change-default-texthtml-mime-type.patch +++ b/patches/avoid-change-default-texthtml-mime-type.patch @@ -1,8 +1,17 @@ +From e45c184e8c23aa72f77767c09e6051363806b5f5 Mon Sep 17 00:00:00 2001 +From: josselinonduty +Date: Sun, 19 Jan 2025 23:18:25 +0100 +Subject: [PATCH] fix: unset text/html as default mimetype + +--- + build/main.js | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + diff --git a/build/main.js b/build/main.js -index de51acb..e2c0b9e 100644 +index b883a28..60117e3 100644 --- a/build/main.js +++ b/build/main.js -@@ -2897,12 +2897,7 @@ +@@ -2854,12 +2854,7 @@ this.tray.init(), this.updater.init(), this.network.watch(), @@ -16,3 +25,6 @@ index de51acb..e2c0b9e 100644 const dzrFilter = { urls: ["*://*/*"] }, DOMAINS_WHITELIST = [ "deezer.com", +-- +2.43.0 + From a652d438e74799343215838aca43c73f1bb5ddbd Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sun, 19 Jan 2025 23:23:05 +0100 Subject: [PATCH 06/34] fix(patch): remove isDev usage thanks to electron update --- patches/fix-isDev-usage.patch | 54 ----------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 patches/fix-isDev-usage.patch diff --git a/patches/fix-isDev-usage.patch b/patches/fix-isDev-usage.patch deleted file mode 100644 index c38ee2f..0000000 --- a/patches/fix-isDev-usage.patch +++ /dev/null @@ -1,54 +0,0 @@ -From: Dorian Stoll -Date: Sat, 5 Feb 2022 07:05:16 +0100 -Subject: [PATCH] Fix isDev() usage - -This stops the excessive logging, since parts of the app will not run in development -mode anymore. It also stops the app from logging the urls for the mp3 files, which is -against the Deezer TOS. ---- - build/main.js | 6 +++--- - build/preload.js | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/build/main.js b/build/main.js -index 2da2ed1..88135ae 100644 ---- a/build/main.js -+++ b/build/main.js -@@ -1979,7 +1979,7 @@ - tags: Object.assign( - { country: user.country, offerId: user.offerId }, - { -- environment: isDev ? "development" : "production", -+ environment: isDev() ? "development" : "production", - os: `${external_os_default().type()} ${external_os_default().release()}`, - "os.name": external_os_default().type(), - arch: process.arch, -@@ -3268,10 +3268,10 @@ - (external_electron_log_default().transports.console.format = `{h}:{i}:{s}.{ms} ({processType}/{level}) ${ - isPlatform(PLATFORM.WINDOWS) ? ">" : "›" - } {text}`), -- (external_electron_log_default().transports.console.level = isDev -+ (external_electron_log_default().transports.console.level = isDev() - ? "silly" - : "warn"), -- (external_electron_log_default().transports.file.level = isDev -+ (external_electron_log_default().transports.file.level = isDev() - ? "silly" - : "warn"), - (external_electron_log_default().transports.sentry = function (msg) { -diff --git a/build/preload.js b/build/preload.js -index a8bb8d6..73dc8b4 100644 ---- a/build/preload.js -+++ b/build/preload.js -@@ -490,7 +490,7 @@ - } - getSentryTags() { - return { -- environment: isDev ? "development" : "production", -+ environment: isDev() ? "development" : "production", - os: `${external_os_default().type()} ${external_os_default().release()}`, - "os.name": external_os_default().type(), - arch: process.arch, --- -2.34.1 - From 9d6ad6fd880d1ee3dde5a6b2da11037e4786df1a Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sun, 19 Jan 2025 23:28:53 +0100 Subject: [PATCH 07/34] fix(patch): update closing behaviour w/ option --- patches/quit.patch | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/patches/quit.patch b/patches/quit.patch index edbb776..742f828 100644 --- a/patches/quit.patch +++ b/patches/quit.patch @@ -1,16 +1,29 @@ +From ef715c38d754bbed026a4e6c3e9cae0180eeeb4b Mon Sep 17 00:00:00 2001 +From: josselinonduty +Date: Sun, 19 Jan 2025 23:27:32 +0100 +Subject: [PATCH] fix: reduce to systray on close with respect to execution + option + +--- + build/main.js | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + diff --git a/build/main.js b/build/main.js -index 5066eef..46b04c5 100644 +index 60117e3..9ea7c18 100644 --- a/build/main.js +++ b/build/main.js -@@ -3083,7 +3083,10 @@ +@@ -3037,7 +3037,10 @@ this._adjustViewToContentSize(), mainView.setAutoResize({ width: !0, height: !0 }); } else this.appService.setWindow(this.window, void 0); - if ((this.appService.setUserAgent(), isPlatform(PLATFORM.DARWIN))) { + if ( -+ (this.appService.setUserAgent(), isPlatform(PLATFORM.LINUX)) -+ && !process.argv.some(arg => arg === '--disable-systray') ++ (this.appService.setUserAgent(), isPlatform(PLATFORM.LINUX)) ++ && !process.argv.some(arg => arg === '--disable-systray') + ) { let isQuitting = !1; external_electron_namespaceObject.app.on( "before-quit", +-- +2.43.0 + From 7ca5b2b5d0f49ae946e2a3604f816589e24418f5 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Mon, 20 Jan 2025 00:51:05 +0100 Subject: [PATCH 08/34] fix(patch): disable auto update - useless for this unofficial port --- patches/disable-auto-updater.patch | 28 +++++++ ...emove-kernel-version-from-user-agent.patch | 83 ------------------- 2 files changed, 28 insertions(+), 83 deletions(-) create mode 100644 patches/disable-auto-updater.patch delete mode 100644 patches/remove-kernel-version-from-user-agent.patch diff --git a/patches/disable-auto-updater.patch b/patches/disable-auto-updater.patch new file mode 100644 index 0000000..a0b1dbb --- /dev/null +++ b/patches/disable-auto-updater.patch @@ -0,0 +1,28 @@ +From 864e07d4bac769cbc077a4a3d50a431f2158080c Mon Sep 17 00:00:00 2001 +From: josselinonduty +Date: Mon, 20 Jan 2025 00:46:23 +0100 +Subject: [PATCH] fix: disable autoupdater for linux + +--- + build/main.js | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/build/main.js b/build/main.js +index 9ea7c18..10a80fa 100644 +--- a/build/main.js ++++ b/build/main.js +@@ -2322,9 +2322,8 @@ + } + } + init() { +- this.arch && +- ((isPlatform(PLATFORM.LINUX) && !process.env.APPIMAGE) || +- isWindowsStore() || ++ this.arch && !isPlatform(PLATFORM.LINUX) && ( ++ isWindowsStore() || + "yes" === process.env.DZ_DISABLE_UPDATE || + ((external_electron_updater_namespaceObject.autoUpdater.autoDownload = + !0), +-- +2.43.0 + diff --git a/patches/remove-kernel-version-from-user-agent.patch b/patches/remove-kernel-version-from-user-agent.patch deleted file mode 100644 index 37924d4..0000000 --- a/patches/remove-kernel-version-from-user-agent.patch +++ /dev/null @@ -1,83 +0,0 @@ -From: Dorian Stoll -Date: Sat, 29 Jan 2022 12:30:00 +0100 -Subject: [PATCH] Remove kernel version from User-Agent - -The application sends the kernel version as part of the User-Agent. -However, the Deezer API seems to assume the number to follow semver, -and can get confused when it doesn't. This then leads to some features -like dark mode being reported as unavailable. - -e.g: 5.11.0-16-generic works, while 5.15.14-200.fc35.x86_64 doesn't. - -The solution is to ignore the actual version and send bogus data that -is known to work. ---- - build/main.js | 4 +++- - build/preload.js | 4 +++- - build/renderer.js | 4 +++- - build/titlebar.js | 4 +++- - 4 files changed, 12 insertions(+), 4 deletions(-) - -diff --git a/build/main.js b/build/main.js -index b8e2459..2da2ed1 100644 ---- a/build/main.js -+++ b/build/main.js -@@ -5,7 +5,9 @@ - module.exports = require("macos-version"); - }, - 87: (module) => { -- module.exports = require("os"); -+ var m = require("os"); -+ m.release = function() { return "0.0.0"; } -+ module.exports = m; - }, - }, - __webpack_module_cache__ = {}; -diff --git a/build/preload.js b/build/preload.js -index 912f8ee..a8bb8d6 100644 ---- a/build/preload.js -+++ b/build/preload.js -@@ -5,7 +5,9 @@ - module.exports = require("macos-version"); - }, - 87: (module) => { -- module.exports = require("os"); -+ var m = require("os"); -+ m.release = function() { return "0.0.0"; } -+ module.exports = m; - }, - }, - __webpack_module_cache__ = {}; -diff --git a/build/renderer.js b/build/renderer.js -index 6e7787f..026c052 100644 ---- a/build/renderer.js -+++ b/build/renderer.js -@@ -5,7 +5,9 @@ - module.exports = require("macos-version"); - }, - 87: (module) => { -- module.exports = require("os"); -+ var m = require("os"); -+ m.release = function() { return "0.0.0"; } -+ module.exports = m; - }, - }, - __webpack_module_cache__ = {}; -diff --git a/build/titlebar.js b/build/titlebar.js -index 3d2aaca..052553b 100644 ---- a/build/titlebar.js -+++ b/build/titlebar.js -@@ -5,7 +5,9 @@ - module.exports = require("macos-version"); - }, - 87: (module) => { -- module.exports = require("os"); -+ var m = require("os"); -+ m.release = function() { return "0.0.0"; } -+ module.exports = m; - }, - }, - __webpack_module_cache__ = {}; --- -2.34.1 - From 638638c5cbe2aa0a5f8072113993ecf6afa92e37 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Mon, 20 Jan 2025 00:52:17 +0100 Subject: [PATCH 09/34] fix(patch): remove patch for mpris thanks to electron/project update --- patches/better-management-of-MPRIS.patch | 138 ----------------------- 1 file changed, 138 deletions(-) delete mode 100644 patches/better-management-of-MPRIS.patch diff --git a/patches/better-management-of-MPRIS.patch b/patches/better-management-of-MPRIS.patch deleted file mode 100644 index 43d5b17..0000000 --- a/patches/better-management-of-MPRIS.patch +++ /dev/null @@ -1,138 +0,0 @@ ---- a/build/main.js 2024-05-10 19:00:37.087094880 +0200 -+++ b/build/main.js 2024-05-11 17:21:00.996945543 +0200 -@@ -72,6 +72,10 @@ - var external_url_default = __webpack_require__.n( - external_url_namespaceObject - ); -+ const external_electron_mpris_namespaceObject = require("mpris-service"); -+ var external_electron_mpris_default = __webpack_require__.n( -+ external_electron_mpris_namespaceObject -+ ); - const external_inversify_namespaceObject = require("inversify"), - external_events_namespaceObject = require("events"), - external_semver_namespaceObject = -@@ -1221,8 +1225,9 @@ - }; - }; - let MediaService = class extends external_events_namespaceObject.EventEmitter { -- constructor(ipc, user) { -+ constructor(ipc, user, app) { - super(), -+ (this.app = app), - (this.smtc = null), - (this.track = {}), - (this.player = {}), -@@ -1230,6 +1235,11 @@ - (this.debounceOptions = { leading: !0, maxWait: 500 }), - (this.ipc = ipc), - (this.user = user), -+ (this.mprisPlayer = new external_electron_mpris_namespaceObject({ -+ name: 'deezer', -+ identity: 'Deezer', -+ supportedInterfaces: ['player'] -+ })), - isPlatform(PLATFORM.LINUX) && - (this.user.addListener(UserEvents.LoggedIn, () => { - this.start(); -@@ -1237,6 +1247,19 @@ - this.user.addListener(UserEvents.LoggedOut, () => { - this.stop(); - })); -+ this.initMprisPlayerControls(); -+ } -+ initMprisPlayerControls() { -+ // Events => ['raise', 'quit', 'next', 'previous', 'pause', 'playpause', 'stop', 'play', 'seek', 'position', 'open', 'volume', 'loopStatus', 'shuffle']; -+ this.mprisPlayer.on('play', this.play.bind(this)); -+ this.mprisPlayer.on('pause', this.pause.bind(this)); -+ this.mprisPlayer.on('playpause', () => this.player.state === 'playing' ? this.pause() : this.play()); -+ this.mprisPlayer.on('stop', this.stop.bind(this)); -+ this.mprisPlayer.on('next', this.next.bind(this)); -+ this.mprisPlayer.on('previous', this.prev.bind(this)); -+ this.mprisPlayer.on('shuffle', this.setSuffle.bind(this)); -+ this.mprisPlayer.on('loopStatus', this.setRepeatMode.bind(this)); -+ this.mprisPlayer.on('raise', () => this.app.getWindow().show()); - } - play() { - this.ipc.send("channel-player-media-control", MediaPlayerControl.Play); -@@ -1264,11 +1287,22 @@ - } - setTrackInfo(track) { - (this.track = Object.assign(this.track, track)), -- this.emit(MediaEvents.TrackUpdated, this.track); -+ this.emit(MediaEvents.TrackUpdated, this.track), -+ (this.mprisPlayer.metadata = { -+ 'mpris:trackid': this.mprisPlayer.objectPath('track/0'), -+ 'mpris:artUrl': track.coverUrl, -+ 'xesam:title': track.title, -+ 'xesam:album': track.album, -+ 'xesam:artist': [track.artist] -+ }); - } - setPlayerInfo(player) { - (this.player = Object.assign(this.player, player)), - this.emit(MediaEvents.PlayerUpdated, this.player); -+ (this.mprisPlayer.playbackStatus = -+ this.player.state === 'playing' -+ ? external_electron_mpris_namespaceObject.PLAYBACK_STATUS_PLAYING -+ : external_electron_mpris_namespaceObject.PLAYBACK_STATUS_PAUSED); - } - getTrackInfo() { - return this.track; -@@ -1328,7 +1362,11 @@ - 1, - (0, external_inversify_namespaceObject.inject)(SERVICE_USER) - ), -- MediaService_metadata("design:paramtypes", [Object, Object]), -+ MediaService_param( -+ 2, -+ (0, external_inversify_namespaceObject.inject)(SERVICE_APPLICATION) -+ ), -+ MediaService_metadata("design:paramtypes", [Object, Object, Object]), - ], - MediaService - ); -@@ -2766,14 +2804,18 @@ - const PlayerIpc_ipc = main_di.get(SERVICE_IPC), - media = main_di.get(SERVICE_MEDIA), - powerSave = main_di.get(SERVICE_POWER_SAVE); -+ let powerSaveTimoutId; - PlayerIpc_ipc.on( - "channel-player-state-update", -- external_lodash_debounce_default()((event, state) => { -- media.setPlayerInfo({ state }), -+ (event, state) => { -+ media.setPlayerInfo({ state }); -+ clearTimeout(powerSaveTimoutId); -+ powerSaveTimoutId = setTimeout(()=> { - state === MediaPlayerState.Playing -- ? powerSave.start() -- : powerSave.stop(); -- }, 3e3) -+ ? powerSave.start() -+ : powerSave.stop(); -+ }, 3e3); -+ } - ), - PlayerIpc_ipc.on( - "channel-player-track-update", -@@ -2865,6 +2907,9 @@ - "autoplay-policy", - "no-user-gesture-required" - ), -+ external_electron_namespaceObject.app.commandLine.appendSwitch( -+ "disable-features", "HardwareMediaKeyHandling" -+ ), - external_electron_namespaceObject.app.on( - "second-instance", - (event, argv) => { - ---- a/package.json 2024-05-10 19:00:37.091094948 +0200 -+++ b/package.json 2024-05-10 21:54:32.411123286 +0200 -@@ -25,6 +25,7 @@ - "lodash.debounce": "^4.0.8", - "lodash.get": "^4.4.2", - "macos-version": "^5.2.1", -+ "mpris-service": "^2.1.2", - "object.assign": "^4.1.2", - "raven": "^2.6.4", - "reflect-metadata": "^0.1.13", \ No newline at end of file From 0aa8632373402e5f5b15d8f52be1eff565a78471 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Mon, 20 Jan 2025 01:26:28 +0100 Subject: [PATCH 10/34] chore(Makefile): update patch comments --- Makefile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index b8b8572..44b8589 100644 --- a/Makefile +++ b/Makefile @@ -32,12 +32,11 @@ prepare: clean install_build_deps @echo "Prettier the sources to patch successfully" @node_modules/prettier/bin-prettier.js --write "app/build/*.js" - @echo "Apply patches from ./patches, default ones:" - @echo "Hide to tray when closing (https://github.com/SibrenVasse/deezer/issues/4)" - @echo "Start in tray cli option (https://github.com/SibrenVasse/deezer/pull/12)" - @echo "Remove kernel version from User-Agent (https://github.com/aunetx/deezer-linux/pull/9)" - @echo "Avoid to set the text/html mime type (https://github.com/aunetx/deezer-linux/issues/13)" - @echo "Add a better management of MPRIS (https://github.com/aunetx/deezer-linux/pull/61)" + @echo "Apply patches from ./patches:" + @echo "- Hide to tray when closing (https://github.com/SibrenVasse/deezer/issues/4)" + @echo "- Start in tray cli option (https://github.com/SibrenVasse/deezer/pull/12)" + @echo "- Avoid to set the text/html mime type (https://github.com/aunetx/deezer-linux/issues/13)" + @echo "- Disable auto updater (https://github.com/aunetx/deezer-linux/pull/95)" $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) @echo "Append `package-append.json` to the `package.json` of the app" From 2504c7cacd20ddd17df18bfafe85240a6927705e Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Mon, 20 Jan 2025 17:00:47 +0100 Subject: [PATCH 11/34] fix(patch): update patch for mpris w/ node-gyp compilation error remaining --- Makefile | 1 + patches/better-management-of-MPRIS.patch | 161 +++++++++++++++++++++++ 2 files changed, 162 insertions(+) create mode 100644 patches/better-management-of-MPRIS.patch diff --git a/Makefile b/Makefile index 44b8589..49b8c3c 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,7 @@ prepare: clean install_build_deps @echo "- Hide to tray when closing (https://github.com/SibrenVasse/deezer/issues/4)" @echo "- Start in tray cli option (https://github.com/SibrenVasse/deezer/pull/12)" @echo "- Avoid to set the text/html mime type (https://github.com/aunetx/deezer-linux/issues/13)" + @echo "- Add a better management of MPRIS (https://github.com/aunetx/deezer-linux/pull/61)" @echo "- Disable auto updater (https://github.com/aunetx/deezer-linux/pull/95)" $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) diff --git a/patches/better-management-of-MPRIS.patch b/patches/better-management-of-MPRIS.patch new file mode 100644 index 0000000..b4422d1 --- /dev/null +++ b/patches/better-management-of-MPRIS.patch @@ -0,0 +1,161 @@ +From bbb6b3ccd7f2a0391a4596fbf43d5c81ffec8bc9 Mon Sep 17 00:00:00 2001 +From: josselinonduty +Date: Mon, 20 Jan 2025 16:53:02 +0100 +Subject: [PATCH] fix: add better management of MPRIS metadata + +--- + build/main.js | 72 ++++++++++++++++++++++++++++++++++++++++++--------- + package.json | 1 + + 2 files changed, 61 insertions(+), 12 deletions(-) + +diff --git a/build/main.js b/build/main.js +index 10a80fa..f50c03d 100644 +--- a/build/main.js ++++ b/build/main.js +@@ -79,6 +79,10 @@ + external_semver_default = __webpack_require__.n( + external_semver_namespaceObject + ); ++ const external_electron_mpris_namespaceObject = require("mpris-service"); ++ var external_electron_mpris_default = __webpack_require__.n( ++ external_electron_mpris_namespaceObject ++ ); + function isPlatform(platform) { + switch (platform) { + case PLATFORM.WINDOWS: +@@ -1179,8 +1183,9 @@ + }; + }; + let MediaService = class extends external_events_namespaceObject.EventEmitter { +- constructor(ipc, user) { ++ constructor(ipc, user, app) { + super(), ++ (this.app = app), + (this.smtc = null), + (this.track = {}), + (this.player = {}), +@@ -1188,6 +1193,11 @@ + (this.debounceOptions = { leading: !0, maxWait: 500 }), + (this.ipc = ipc), + (this.user = user), ++ (this.mprisPlayer = new external_electron_mpris_namespaceObject({ ++ name: 'deezer', ++ identity: 'Deezer', ++ supportedInterfaces: ['player'] ++ })), + isPlatform(PLATFORM.LINUX) && + (this.user.addListener(UserEvents.LoggedIn, () => { + this.start(); +@@ -1195,6 +1205,19 @@ + this.user.addListener(UserEvents.LoggedOut, () => { + this.stop(); + })); ++ this.initMprisPlayerControls(); ++ } ++ initMprisPlayerControls() { ++ // Events => ['raise', 'quit', 'next', 'previous', 'pause', 'playpause', 'stop', 'play', 'seek', 'position', 'open', 'volume', 'loopStatus', 'shuffle']; ++ this.mprisPlayer.on('play', this.play.bind(this)); ++ this.mprisPlayer.on('pause', this.pause.bind(this)); ++ this.mprisPlayer.on('playpause', () => this.player.state === 'playing' ? this.pause() : this.play()); ++ this.mprisPlayer.on('stop', this.stop.bind(this)); ++ this.mprisPlayer.on('next', this.next.bind(this)); ++ this.mprisPlayer.on('previous', this.prev.bind(this)); ++ this.mprisPlayer.on('shuffle', this.setSuffle.bind(this)); ++ this.mprisPlayer.on('loopStatus', this.setRepeatMode.bind(this)); ++ this.mprisPlayer.on('raise', () => this.app.getWindow().show()) + } + play() { + this.ipc.send("channel-player-media-control", MediaPlayerControl.Play); +@@ -1222,11 +1245,23 @@ + } + setTrackInfo(track) { + (this.track = Object.assign(this.track, track)), +- this.emit(MediaEvents.TrackUpdated, this.track); ++ this.emit(MediaEvents.TrackUpdated, this.track), ++ (this.mprisPlayer.metadata = { ++ 'mpris:trackid': this.mprisPlayer.objectPath('track/0'), ++ 'mpris:artUrl': track.coverUrl, ++ 'xesam:title': track.title, ++ 'xesam:album': track.album, ++ 'xesam:artist': [track.artist] ++ }); + } + setPlayerInfo(player) { + (this.player = Object.assign(this.player, player)), +- this.emit(MediaEvents.PlayerUpdated, this.player); ++ this.emit(MediaEvents.PlayerUpdated, this.player), ++ (this.mprisPlayer.playbackStatus = ++ this.player.state === 'playing' ++ ? external_electron_mpris_namespaceObject.PLAYBACK_STATUS_PLAYING ++ : external_electron_mpris_namespaceObject.PLAYBACK_STATUS_PAUSED ++ ); + } + getTrackInfo() { + return this.track; +@@ -1286,7 +1321,11 @@ + 1, + (0, external_inversify_namespaceObject.inject)(SERVICE_USER) + ), +- MediaService_metadata("design:paramtypes", [Object, Object]), ++ MediaService_param( ++ 2, ++ (0, external_inversify_namespaceObject.inject)(SERVICE_APPLICATION) ++ ), ++ MediaService_metadata("design:paramtypes", [Object, Object, Object]), + ], + MediaService + ); +@@ -2724,14 +2763,20 @@ + const PlayerIpc_ipc = main_di.get(SERVICE_IPC), + media = main_di.get(SERVICE_MEDIA), + powerSave = main_di.get(SERVICE_POWER_SAVE); +- PlayerIpc_ipc.on( +- "channel-player-state-update", +- external_lodash_debounce_default()((event, state) => { +- media.setPlayerInfo({ state }), +- state === MediaPlayerState.Playing +- ? powerSave.start() +- : powerSave.stop(); +- }, 3e3) ++ var powerSaveTimeoutId; ++ PlayerIpc_ipc.on( ++ "channel-player-state-update", ++ (event, state) => { ++ media.setPlayerInfo({ state }), ++ clearTimeout(powerSaveTimeoutId), ++ powerSaveTimeoutId = setTimeout( ++ () => { ++ state === MediaPlayerState.Playing ++ ? powerSave.start() ++ : powerSave.stop(); ++ }, 3e3 ++ ); ++ } + ), + PlayerIpc_ipc.on( + "channel-player-track-update", +@@ -2819,6 +2864,9 @@ + "autoplay-policy", + "no-user-gesture-required" + ), ++ external_electron_namespaceObject.app.commandLine.appendSwitch( ++ "disable-features", "HardwareMediaKeyHandling" ++ ), + external_electron_namespaceObject.app.on( + "second-instance", + (event, argv) => { +diff --git a/package.json b/package.json +index 290f49a..3560ca9 100644 +--- a/package.json ++++ b/package.json +@@ -26,6 +26,7 @@ + "lodash.debounce": "^4.0.8", + "lodash.get": "^4.4.2", + "macos-version": "^5.2.1", ++ "mpris-service": "^2.1.2", + "raven": "^2.6.4", + "reflect-metadata": "^0.2.2", + "semver": "^7.6.0", +-- +2.43.0 + From 02f645c28ff6d5a1780a8bdf29a78a3e846b220a Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Mon, 20 Jan 2025 17:20:51 +0100 Subject: [PATCH 12/34] chore: update deprecated package `asar` to `@electron/asar` Co-Authored-By: Meincrakker <50109822+Meincrakker@users.noreply.github.com> --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 49b8c3c..a5289d4 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ VERSION_REGEX = ^v$(PKGVER)-[0-9]{1,}$$ install_build_deps: - @npm install --engine-strict asar + @npm install --engine-strict @electron/asar@3.2.18 @npm install prettier@2.8.8 prepare: clean install_build_deps @@ -27,7 +27,7 @@ prepare: clean install_build_deps @cd source && 7z x -y -bsp0 -bso0 app-32.7z @echo "Extract app sources from the app" - @node_modules/asar/bin/asar.js extract source/resources/app.asar app + @node_modules/@electron/asar/bin/asar.js extract source/resources/app.asar app @echo "Prettier the sources to patch successfully" @node_modules/prettier/bin-prettier.js --write "app/build/*.js" From 95aa2e7fb85531af6328a6556690575de49b4454 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Mon, 20 Jan 2025 19:22:10 +0100 Subject: [PATCH 13/34] feat(patch): remove os information to preserve privacy --- Makefile | 1 + patches/remove-os-information.patch | 87 +++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 patches/remove-os-information.patch diff --git a/Makefile b/Makefile index a5289d4..d47e2e8 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,7 @@ prepare: clean install_build_deps @echo "- Avoid to set the text/html mime type (https://github.com/aunetx/deezer-linux/issues/13)" @echo "- Add a better management of MPRIS (https://github.com/aunetx/deezer-linux/pull/61)" @echo "- Disable auto updater (https://github.com/aunetx/deezer-linux/pull/95)" + @echo "- Remove OS information (https://github.com/aunetx/deezer-linux/pull/95)" $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) @echo "Append `package-append.json` to the `package.json` of the app" diff --git a/patches/remove-os-information.patch b/patches/remove-os-information.patch new file mode 100644 index 0000000..48970ac --- /dev/null +++ b/patches/remove-os-information.patch @@ -0,0 +1,87 @@ +From 83374279bba745cf9b4b4ab958b35738f97d12c7 Mon Sep 17 00:00:00 2001 +From: josselinonduty +Date: Mon, 20 Jan 2025 19:19:51 +0100 +Subject: [PATCH] fix: hide os information + +--- + build/main.js | 7 ++++++- + build/preload.js | 7 ++++++- + build/renderer.js | 7 ++++++- + build/titlebar.js | 7 ++++++- + 4 files changed, 24 insertions(+), 4 deletions(-) + +diff --git a/build/main.js b/build/main.js +index 10a80fa..e371d01 100644 +--- a/build/main.js ++++ b/build/main.js +@@ -5,7 +5,12 @@ + module.exports = require("macos-version"); + }, + 857: (module) => { +- module.exports = require("os"); ++ var __module_os = require("os"); ++ __module_os.release = () => "10.0.26100.2894"; ++ __module_os.version = () => "" ++ __module_os.platform = () => "win32"; ++ __module_os.type = () => "Windows_NT"; ++ module.exports = __module_os; + }, + }, + __webpack_module_cache__ = {}; +diff --git a/build/preload.js b/build/preload.js +index 9716411..f0fa2ab 100644 +--- a/build/preload.js ++++ b/build/preload.js +@@ -5,7 +5,12 @@ + module.exports = require("macos-version"); + }, + 857: (module) => { +- module.exports = require("os"); ++ var __module_os = require("os"); ++ __module_os.release = () => "10.0.26100.2894"; ++ __module_os.version = () => "" ++ __module_os.platform = () => "win32"; ++ __module_os.type = () => "Windows_NT"; ++ module.exports = __module_os; + }, + }, + __webpack_module_cache__ = {}; +diff --git a/build/renderer.js b/build/renderer.js +index 7241bcb..628bbaf 100644 +--- a/build/renderer.js ++++ b/build/renderer.js +@@ -5,7 +5,12 @@ + module.exports = require("macos-version"); + }, + 857: (module) => { +- module.exports = require("os"); ++ var __module_os = require("os"); ++ __module_os.release = () => "10.0.26100.2894"; ++ __module_os.version = () => "" ++ __module_os.platform = () => "win32"; ++ __module_os.type = () => "Windows_NT"; ++ module.exports = __module_os; + }, + }, + __webpack_module_cache__ = {}; +diff --git a/build/titlebar.js b/build/titlebar.js +index 65520fb..12ad58c 100644 +--- a/build/titlebar.js ++++ b/build/titlebar.js +@@ -5,7 +5,12 @@ + module.exports = require("macos-version"); + }, + 857: (module) => { +- module.exports = require("os"); ++ var __module_os = require("os"); ++ __module_os.release = () => "10.0.26100.2894"; ++ __module_os.version = () => "" ++ __module_os.platform = () => "win32"; ++ __module_os.type = () => "Windows_NT"; ++ module.exports = __module_os; + }, + }, + __webpack_module_cache__ = {}; +-- +2.43.0 + From 09a385ba10b0d59472c233245c48d70b2ac71ae7 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Fri, 24 Jan 2025 16:06:47 +0100 Subject: [PATCH 14/34] fix: ensure os release is a valid semver format --- patches/remove-os-information.patch | 78 +++++++++++++++++------------ 1 file changed, 46 insertions(+), 32 deletions(-) diff --git a/patches/remove-os-information.patch b/patches/remove-os-information.patch index 48970ac..a0a936e 100644 --- a/patches/remove-os-information.patch +++ b/patches/remove-os-information.patch @@ -1,83 +1,97 @@ -From 83374279bba745cf9b4b4ab958b35738f97d12c7 Mon Sep 17 00:00:00 2001 +From 08ea86075592efe9c02c4beb7cbdfc6935ca0b1c Mon Sep 17 00:00:00 2001 From: josselinonduty -Date: Mon, 20 Jan 2025 19:19:51 +0100 -Subject: [PATCH] fix: hide os information +Date: Fri, 24 Jan 2025 16:03:43 +0100 +Subject: [PATCH] fix: ensure os release is valid --- - build/main.js | 7 ++++++- - build/preload.js | 7 ++++++- - build/renderer.js | 7 ++++++- - build/titlebar.js | 7 ++++++- - 4 files changed, 24 insertions(+), 4 deletions(-) + build/main.js | 11 ++++++++++- + build/preload.js | 10 +++++++++- + build/renderer.js | 10 +++++++++- + build/titlebar.js | 11 ++++++++++- + 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/build/main.js b/build/main.js -index 10a80fa..e371d01 100644 +index 10a80fa..9219f4f 100644 --- a/build/main.js +++ b/build/main.js -@@ -5,7 +5,12 @@ +@@ -5,7 +5,16 @@ module.exports = require("macos-version"); }, 857: (module) => { - module.exports = require("os"); + var __module_os = require("os"); -+ __module_os.release = () => "10.0.26100.2894"; -+ __module_os.version = () => "" -+ __module_os.platform = () => "win32"; -+ __module_os.type = () => "Windows_NT"; ++ const release = __module_os.release(); ++ __module_os.release = () => { ++ const matcher = /(\d+\.\d+\.\d+)\.*/ ++ var result = release.match(matcher); ++ if (result[1]) ++ return result[1]; ++ return "0.0.0"; ++ } + module.exports = __module_os; }, }, __webpack_module_cache__ = {}; diff --git a/build/preload.js b/build/preload.js -index 9716411..f0fa2ab 100644 +index 9716411..ec603d0 100644 --- a/build/preload.js +++ b/build/preload.js -@@ -5,7 +5,12 @@ +@@ -5,7 +5,15 @@ module.exports = require("macos-version"); }, 857: (module) => { - module.exports = require("os"); + var __module_os = require("os"); -+ __module_os.release = () => "10.0.26100.2894"; -+ __module_os.version = () => "" -+ __module_os.platform = () => "win32"; -+ __module_os.type = () => "Windows_NT"; ++ const release = __module_os.release(); ++ __module_os.release = () => { ++ const matcher = /(\d+\.\d+\.\d+)\.*/; ++ var result = release.match(matcher); ++ if (result[1]) return result[1]; ++ return "0.0.0"; ++ }; + module.exports = __module_os; }, }, __webpack_module_cache__ = {}; diff --git a/build/renderer.js b/build/renderer.js -index 7241bcb..628bbaf 100644 +index 7241bcb..fb02453 100644 --- a/build/renderer.js +++ b/build/renderer.js -@@ -5,7 +5,12 @@ +@@ -5,7 +5,15 @@ module.exports = require("macos-version"); }, 857: (module) => { - module.exports = require("os"); + var __module_os = require("os"); -+ __module_os.release = () => "10.0.26100.2894"; -+ __module_os.version = () => "" -+ __module_os.platform = () => "win32"; -+ __module_os.type = () => "Windows_NT"; ++ const release = __module_os.release(); ++ __module_os.release = () => { ++ const matcher = /(\d+\.\d+\.\d+)\.*/; ++ var result = release.match(matcher); ++ if (result[1]) return result[1]; ++ return "0.0.0"; ++ }; + module.exports = __module_os; }, }, __webpack_module_cache__ = {}; diff --git a/build/titlebar.js b/build/titlebar.js -index 65520fb..12ad58c 100644 +index 65520fb..7919288 100644 --- a/build/titlebar.js +++ b/build/titlebar.js -@@ -5,7 +5,12 @@ +@@ -5,7 +5,16 @@ module.exports = require("macos-version"); }, 857: (module) => { - module.exports = require("os"); + var __module_os = require("os"); -+ __module_os.release = () => "10.0.26100.2894"; -+ __module_os.version = () => "" -+ __module_os.platform = () => "win32"; -+ __module_os.type = () => "Windows_NT"; ++ const release = __module_os.release(); ++ __module_os.release = () => { ++ const matcher = /(\d+\.\d+\.\d+)\.*/ ++ var result = release.match(matcher); ++ if (result[1]) ++ return result[1]; ++ return "0.0.0"; ++ } + module.exports = __module_os; }, }, From aa3896377b261cb9024136a4baa9fb29be4cbd5c Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Fri, 31 Jan 2025 12:05:46 +0100 Subject: [PATCH 15/34] fix(patch): update dependencies for better management of MPRIS metadata --- patches/better-management-of-MPRIS.patch | 44 ++++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/patches/better-management-of-MPRIS.patch b/patches/better-management-of-MPRIS.patch index b4422d1..4671cb8 100644 --- a/patches/better-management-of-MPRIS.patch +++ b/patches/better-management-of-MPRIS.patch @@ -1,7 +1,7 @@ -From bbb6b3ccd7f2a0391a4596fbf43d5c81ffec8bc9 Mon Sep 17 00:00:00 2001 +From 16026d3b586904af7d8ca32248abe0be9eddaa84 Mon Sep 17 00:00:00 2001 From: josselinonduty -Date: Mon, 20 Jan 2025 16:53:02 +0100 -Subject: [PATCH] fix: add better management of MPRIS metadata +Date: Fri, 31 Jan 2025 11:55:37 +0100 +Subject: [PATCH] fix: update deps for mpris patch - @jellybrick/mpris-service --- build/main.js | 72 ++++++++++++++++++++++++++++++++++++++++++--------- @@ -9,21 +9,21 @@ Subject: [PATCH] fix: add better management of MPRIS metadata 2 files changed, 61 insertions(+), 12 deletions(-) diff --git a/build/main.js b/build/main.js -index 10a80fa..f50c03d 100644 +index 9219f4f..34be768 100644 --- a/build/main.js +++ b/build/main.js -@@ -79,6 +79,10 @@ +@@ -88,6 +88,10 @@ external_semver_default = __webpack_require__.n( external_semver_namespaceObject ); -+ const external_electron_mpris_namespaceObject = require("mpris-service"); ++ const external_electron_mpris_namespaceObject = require("@jellybrick/mpris-service"); + var external_electron_mpris_default = __webpack_require__.n( + external_electron_mpris_namespaceObject + ); function isPlatform(platform) { switch (platform) { case PLATFORM.WINDOWS: -@@ -1179,8 +1183,9 @@ +@@ -1188,8 +1192,9 @@ }; }; let MediaService = class extends external_events_namespaceObject.EventEmitter { @@ -34,7 +34,7 @@ index 10a80fa..f50c03d 100644 (this.smtc = null), (this.track = {}), (this.player = {}), -@@ -1188,6 +1193,11 @@ +@@ -1197,6 +1202,11 @@ (this.debounceOptions = { leading: !0, maxWait: 500 }), (this.ipc = ipc), (this.user = user), @@ -46,7 +46,7 @@ index 10a80fa..f50c03d 100644 isPlatform(PLATFORM.LINUX) && (this.user.addListener(UserEvents.LoggedIn, () => { this.start(); -@@ -1195,6 +1205,19 @@ +@@ -1204,6 +1214,19 @@ this.user.addListener(UserEvents.LoggedOut, () => { this.stop(); })); @@ -66,7 +66,7 @@ index 10a80fa..f50c03d 100644 } play() { this.ipc.send("channel-player-media-control", MediaPlayerControl.Play); -@@ -1222,11 +1245,23 @@ +@@ -1231,11 +1254,23 @@ } setTrackInfo(track) { (this.track = Object.assign(this.track, track)), @@ -92,7 +92,7 @@ index 10a80fa..f50c03d 100644 } getTrackInfo() { return this.track; -@@ -1286,7 +1321,11 @@ +@@ -1295,7 +1330,11 @@ 1, (0, external_inversify_namespaceObject.inject)(SERVICE_USER) ), @@ -105,7 +105,7 @@ index 10a80fa..f50c03d 100644 ], MediaService ); -@@ -2724,14 +2763,20 @@ +@@ -2733,14 +2772,20 @@ const PlayerIpc_ipc = main_di.get(SERVICE_IPC), media = main_di.get(SERVICE_MEDIA), powerSave = main_di.get(SERVICE_POWER_SAVE); @@ -134,7 +134,7 @@ index 10a80fa..f50c03d 100644 ), PlayerIpc_ipc.on( "channel-player-track-update", -@@ -2819,6 +2864,9 @@ +@@ -2828,6 +2873,9 @@ "autoplay-policy", "no-user-gesture-required" ), @@ -145,17 +145,17 @@ index 10a80fa..f50c03d 100644 "second-instance", (event, argv) => { diff --git a/package.json b/package.json -index 290f49a..3560ca9 100644 +index 290f49a..394b4f4 100644 --- a/package.json +++ b/package.json -@@ -26,6 +26,7 @@ - "lodash.debounce": "^4.0.8", - "lodash.get": "^4.4.2", - "macos-version": "^5.2.1", -+ "mpris-service": "^2.1.2", - "raven": "^2.6.4", - "reflect-metadata": "^0.2.2", - "semver": "^7.6.0", +@@ -13,6 +13,7 @@ + "main": "build/main.js", + "dependencies": { + "@electron/remote": "2.1.2", ++ "@jellybrick/mpris-service": "2.1.5", + "electron-log": "^5.1.2", + "electron-settings": "4.0.4", + "electron-updater": "^6.1.8", -- 2.43.0 From 598fe85856dab49783258108c0ca947cec4f167f Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Fri, 31 Jan 2025 12:22:40 +0100 Subject: [PATCH 16/34] chore(patch): include order of generation in patch name to avoid conflicts when applying --- .../{start-hidden-in-tray.patch => 01-start-hidden-in-tray.patch} | 0 ...ype.patch => 02-avoid-change-default-texthtml-mime-type.patch} | 0 patches/{quit.patch => 03-quit.patch} | 0 .../{disable-auto-updater.patch => 04-disable-auto-updater.patch} | 0 ...remove-os-information.patch => 05-remove-os-information.patch} | 0 ...agement-of-MPRIS.patch => 06-better-management-of-MPRIS.patch} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename patches/{start-hidden-in-tray.patch => 01-start-hidden-in-tray.patch} (100%) rename patches/{avoid-change-default-texthtml-mime-type.patch => 02-avoid-change-default-texthtml-mime-type.patch} (100%) rename patches/{quit.patch => 03-quit.patch} (100%) rename patches/{disable-auto-updater.patch => 04-disable-auto-updater.patch} (100%) rename patches/{remove-os-information.patch => 05-remove-os-information.patch} (100%) rename patches/{better-management-of-MPRIS.patch => 06-better-management-of-MPRIS.patch} (100%) diff --git a/patches/start-hidden-in-tray.patch b/patches/01-start-hidden-in-tray.patch similarity index 100% rename from patches/start-hidden-in-tray.patch rename to patches/01-start-hidden-in-tray.patch diff --git a/patches/avoid-change-default-texthtml-mime-type.patch b/patches/02-avoid-change-default-texthtml-mime-type.patch similarity index 100% rename from patches/avoid-change-default-texthtml-mime-type.patch rename to patches/02-avoid-change-default-texthtml-mime-type.patch diff --git a/patches/quit.patch b/patches/03-quit.patch similarity index 100% rename from patches/quit.patch rename to patches/03-quit.patch diff --git a/patches/disable-auto-updater.patch b/patches/04-disable-auto-updater.patch similarity index 100% rename from patches/disable-auto-updater.patch rename to patches/04-disable-auto-updater.patch diff --git a/patches/remove-os-information.patch b/patches/05-remove-os-information.patch similarity index 100% rename from patches/remove-os-information.patch rename to patches/05-remove-os-information.patch diff --git a/patches/better-management-of-MPRIS.patch b/patches/06-better-management-of-MPRIS.patch similarity index 100% rename from patches/better-management-of-MPRIS.patch rename to patches/06-better-management-of-MPRIS.patch From 15b9b5af4204c434a2f0acbaa6c8658174512e4f Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Fri, 31 Jan 2025 13:11:46 +0100 Subject: [PATCH 17/34] chore(makefile): update patch list --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d47e2e8..ae8d56a 100644 --- a/Makefile +++ b/Makefile @@ -33,12 +33,12 @@ prepare: clean install_build_deps @node_modules/prettier/bin-prettier.js --write "app/build/*.js" @echo "Apply patches from ./patches:" - @echo "- Hide to tray when closing (https://github.com/SibrenVasse/deezer/issues/4)" - @echo "- Start in tray cli option (https://github.com/SibrenVasse/deezer/pull/12)" - @echo "- Avoid to set the text/html mime type (https://github.com/aunetx/deezer-linux/issues/13)" - @echo "- Add a better management of MPRIS (https://github.com/aunetx/deezer-linux/pull/61)" - @echo "- Disable auto updater (https://github.com/aunetx/deezer-linux/pull/95)" - @echo "- Remove OS information (https://github.com/aunetx/deezer-linux/pull/95)" + @echo "01 - Hide to tray when closing (https://github.com/SibrenVasse/deezer/issues/4)" + @echo "02 - Start in tray cli option (https://github.com/SibrenVasse/deezer/pull/12)" + @echo "03 - Avoid to set the text/html mime type (https://github.com/aunetx/deezer-linux/issues/13)" + @echo "04 - Disable auto updater (https://github.com/aunetx/deezer-linux/pull/95)" + @echo "05 - Remove OS information (https://github.com/aunetx/deezer-linux/pull/95)" + @echo "06 - Add a better management of MPRIS (https://github.com/aunetx/deezer-linux/pull/61)" $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) @echo "Append `package-append.json` to the `package.json` of the app" From 97445fe29ef6e6d4e514fdeb5f6c1cbe407024ba Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Fri, 31 Jan 2025 19:01:59 +0100 Subject: [PATCH 18/34] feat(patch): add discord rich presence with cli argument to disable --- Makefile | 2 + patches/07-discord-rich-presence.patch | 97 +++++++++++++++++++ .../08-discord-rich-presence-disable.patch | 24 +++++ 3 files changed, 123 insertions(+) create mode 100644 patches/07-discord-rich-presence.patch create mode 100644 patches/08-discord-rich-presence-disable.patch diff --git a/Makefile b/Makefile index ae8d56a..7ff226c 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,8 @@ prepare: clean install_build_deps @echo "04 - Disable auto updater (https://github.com/aunetx/deezer-linux/pull/95)" @echo "05 - Remove OS information (https://github.com/aunetx/deezer-linux/pull/95)" @echo "06 - Add a better management of MPRIS (https://github.com/aunetx/deezer-linux/pull/61)" + @echo "07 - Add Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/82) + @echo "08 - Add option to disable Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/95) $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) @echo "Append `package-append.json` to the `package.json` of the app" diff --git a/patches/07-discord-rich-presence.patch b/patches/07-discord-rich-presence.patch new file mode 100644 index 0000000..267f54c --- /dev/null +++ b/patches/07-discord-rich-presence.patch @@ -0,0 +1,97 @@ +From dac6e3d0e3ca49ef6f123a6f6595cd37578913be Mon Sep 17 00:00:00 2001 +From: josselinonduty +Date: Fri, 31 Jan 2025 16:43:09 +0100 +Subject: [PATCH] feat(patch): add discord rich presence support + +--- + build/main.js | 33 +++++++++++++++++++++++++++++++-- + package.json | 1 + + 2 files changed, 32 insertions(+), 2 deletions(-) + +diff --git a/build/main.js b/build/main.js +index 34be768..69ce1f1 100644 +--- a/build/main.js ++++ b/build/main.js +@@ -92,6 +92,11 @@ + var external_electron_mpris_default = __webpack_require__.n( + external_electron_mpris_namespaceObject + ); ++ const external_rich_presence_builder_namespaceObject = require("rich-presence-builder"); ++ var external_rich_presence_builder_default = __webpack_require__.n( ++ external_rich_presence_builder_namespaceObject ++ ); ++ var rpcConnection; + function isPlatform(platform) { + switch (platform) { + case PLATFORM.WINDOWS: +@@ -1215,6 +1220,7 @@ + this.stop(); + })); + this.initMprisPlayerControls(); ++ this.initDiscordRichPresence(); + } + initMprisPlayerControls() { + // Events => ['raise', 'quit', 'next', 'previous', 'pause', 'playpause', 'stop', 'play', 'seek', 'position', 'open', 'volume', 'loopStatus', 'shuffle']; +@@ -1228,6 +1234,27 @@ + this.mprisPlayer.on('loopStatus', this.setRepeatMode.bind(this)); + this.mprisPlayer.on('raise', () => this.app.getWindow().show()) + } ++ initDiscordRichPresence() { ++ rpcConnection = new external_rich_presence_builder_namespaceObject({ ++ clientID: "1244016234203185183", ++ }); ++ }; ++ updateDiscordRichPresence(track) { ++ if (!rpcConnection) return; ++ rpcConnection.setSmallImage( ++ this.player.state === "playing" ? "play" : "pause", ++ this.player.state === "playing" ? "Playing" : "Paused" ++ ); ++ if (track) { ++ rpcConnection.setLargeImage(track.coverUrl); ++ rpcConnection.setDescription(track.title); ++ if (track.title === track.album) ++ rpcConnection.setState(`${track.artist}`); ++ else ++ rpcConnection.setState(`${track.artist} - ${track.album}`); ++ } ++ rpcConnection.go().catch(); ++ } + play() { + this.ipc.send("channel-player-media-control", MediaPlayerControl.Play); + } +@@ -1261,7 +1288,8 @@ + 'xesam:title': track.title, + 'xesam:album': track.album, + 'xesam:artist': [track.artist] +- }); ++ }), ++ this.updateDiscordRichPresence(track); + } + setPlayerInfo(player) { + (this.player = Object.assign(this.player, player)), +@@ -1270,7 +1298,8 @@ + this.player.state === 'playing' + ? external_electron_mpris_namespaceObject.PLAYBACK_STATUS_PLAYING + : external_electron_mpris_namespaceObject.PLAYBACK_STATUS_PAUSED +- ); ++ ), ++ this.updateDiscordRichPresence(); + } + getTrackInfo() { + return this.track; +diff --git a/package.json b/package.json +index 394b4f4..1d48b24 100644 +--- a/package.json ++++ b/package.json +@@ -14,6 +14,7 @@ + "dependencies": { + "@electron/remote": "2.1.2", + "@jellybrick/mpris-service": "2.1.5", ++ "rich-presence-builder": "0.1.1", + "electron-log": "^5.1.2", + "electron-settings": "4.0.4", + "electron-updater": "^6.1.8", +-- +2.43.0 + diff --git a/patches/08-discord-rich-presence-disable.patch b/patches/08-discord-rich-presence-disable.patch new file mode 100644 index 0000000..a9cff86 --- /dev/null +++ b/patches/08-discord-rich-presence-disable.patch @@ -0,0 +1,24 @@ +From 0fe9042e22b8c8c05d0d3aed550d18b511e0abd5 Mon Sep 17 00:00:00 2001 +From: josselinonduty +Date: Fri, 31 Jan 2025 17:56:13 +0100 +Subject: [PATCH] feat: add cli argument to disable discord rpc + +--- + build/main.js | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/build/main.js b/build/main.js +index 69ce1f1..8b645c6 100644 +--- a/build/main.js ++++ b/build/main.js +@@ -1235,6 +1235,7 @@ + this.mprisPlayer.on('raise', () => this.app.getWindow().show()) + } + initDiscordRichPresence() { ++ if (process.argv.some(arg => arg === '--disable-discord-rpc')) return; + rpcConnection = new external_rich_presence_builder_namespaceObject({ + clientID: "1244016234203185183", + }); +-- +2.43.0 + From dd86b22625c1d0220c08cf6b584fe22bdaa83d06 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Fri, 31 Jan 2025 19:04:29 +0100 Subject: [PATCH 19/34] chore(makefile): fix missing quotes --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7ff226c..c99cf82 100644 --- a/Makefile +++ b/Makefile @@ -39,8 +39,8 @@ prepare: clean install_build_deps @echo "04 - Disable auto updater (https://github.com/aunetx/deezer-linux/pull/95)" @echo "05 - Remove OS information (https://github.com/aunetx/deezer-linux/pull/95)" @echo "06 - Add a better management of MPRIS (https://github.com/aunetx/deezer-linux/pull/61)" - @echo "07 - Add Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/82) - @echo "08 - Add option to disable Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/95) + @echo "07 - Add Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/82)" + @echo "08 - Add option to disable Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/95)" $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) @echo "Append `package-append.json` to the `package.json` of the app" From 0ed3dd5721be431b05243ea62e444024a21ce72d Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Fri, 31 Jan 2025 22:20:09 +0100 Subject: [PATCH 20/34] chore(makefile): add patch creation targets --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index c99cf82..fca2896 100644 --- a/Makefile +++ b/Makefile @@ -90,6 +90,18 @@ build_appimage_arm64: @echo "Build AppImage binary" @yarn --cwd=app run build-appimage-arm64 +#! DEV + +patch-new: install_deps + @echo "Setting up the development environment..." + @cd app && echo "node_modules\n.vscode\n*.diff\n*.orig" > .gitignore && git init && git add . + @cd app && git commit -m "initial commit" + @echo "You can now edit the sources in the app directory" + @echo "When you are done, commit your changes, run 'make patch-gen'." + @echo "Don't forget to rename your patch." + +patch-gen: + @cd app && git format-patch -1 HEAD --stdout > ../patches/$(shell date +%y%m%d-%s).patch #! UTILS From d537f3a0b38cc34b62bcb65384732dc9bfc8d02a Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Fri, 31 Jan 2025 23:30:03 +0100 Subject: [PATCH 21/34] chore(README): improve formatting --- README.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 4028139..fee614e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Deezer for linux -**NOTICE:** existing flatpak users NEED to migrate the the flathub repository as soon as possible, as I deleted the flatpak repository from here (it was more than 2Gb in size). In order to do so (normally without losing any data), simply: +> [!Important] +> Existing flatpak users NEED to migrate the the flathub repository as soon as possible, as the flatpak repository was deleted from here (it was more than 2Gb in size). In order to do so (normally without losing any data), simply: ```sh flatpak uninstall dev.aunetx.deezer @@ -21,10 +22,10 @@ It packages the app in a number of formats: - Snap (not tested yet) - AppImage (can't automatically login without desktop integration) - `rpm` (Fedora, Red Hat, CentOS, openSUSE, ...) -- `deb` (Debian, Ubuntu, Pop!_OS, elementary OS, ...) +- `deb` (Debian, Ubuntu, Pop!\_OS, elementary OS, ...) - `7z` to install anywhere else -It was done thanks to the hard work of [SibrenVasse](https://github.com/SibrenVasse), who [packaged the app for the AUR](https://github.com/SibrenVasse/deezer). +Special thanks to [SibrenVasse](https://github.com/SibrenVasse) who made the [original AUR package](https://github.com/SibrenVasse/deezer) for this app! ## Installation @@ -34,11 +35,11 @@ To install the flatpak version, you can simply go to https://flathub.org/apps/de Other packages can be installed from you package manager, either by clicking on them or from the command-line. -Please note that even though it is automatically generated, the snapcraft package has never been tested; Please tell me if there is any issue with it! +Please note that even though it is automatically generated, the snapcraft package has never been tested; Please open an issue if you encounter any problem. ## From source -You will probably need to install some things in order to generate the packages from source: +You will need to install some things in order to generate the packages from source: - nodejs - npm @@ -68,7 +69,8 @@ deezer-desktop-*.AppImage deezer://autolog/... And you should be automatically logged in. -**IMPORTANT:** If you want to open an issue about this, please do NOT share your own `deezer://autolog/...` link, as it would permit anybody to log into your account without the need for a password! +> [!Caution] +> If you want to open an issue about this, please do NOT share your own `deezer://autolog/...` link, as it would permit anybody to log into your account without the need for a password! See [this issue](https://github.com/aunetx/deezer-linux/issues/29) for more informations about login in AppImage. @@ -91,14 +93,16 @@ make build_snap_x64 make build_tar.xz_x64 ``` -Note that you don't need to use `make install_deps` everytime you start a build, but you need to call it at least once. Everything should be generated in `artifacts/x64`. +> [!NOTE] +> You don't need to use `make install_deps` everytime you start a build, but you need to call it at least once. Everything should be generated in `artifacts/x64`. If you generate the 7z package, you can run it directly by extracting to a directory, and calling `./deezer-desktop` from there. -## **IMPORTANT NOTICE** +## **LEGAL DISCLAIMER** -This work is UNOFFICIAL, and Deezer does not officially support Linux yet. +This work is UNOFFICIAL. Deezer does not officially support Linux and cannot be held responsible for any misuse of this port. -Installing/using this is consequently probably outside of the scope of the Deezer EULA, and I am not responsible for your usage of this. +The installation and use of this software is outside the scope of the Deezer EULA. No author or contributor to this project can be held responsible for the use you make of it. -I ***tried*** to talk to Deezer to ask them if I am authorized to upload this on Flathub, but when they answer, even if they say yes, this work is still unofficial. +> [!NOTE] +> Deezer was contacted to ask for permission to upload this on Flathub, but no answer was given. This work remains unofficial and is not supported by Deezer. See [this thread (FR)](https://fr.deezercommunity.com/application-ordinateur-et-site-web-58/mettre-en-ligne-l-application-deezer-sur-flathub-pour-linux-40620) From 9d47839fbd0162f7b59807e9c65260ff0164e793 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sat, 1 Feb 2025 01:12:03 +0100 Subject: [PATCH 22/34] chore: add snap x64 and arm64 commands/targets --- Makefile | 8 ++++++++ package-append.json | 1 + 2 files changed, 9 insertions(+) diff --git a/Makefile b/Makefile index fca2896..b9e3e8d 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,10 @@ build_appimage_x64: @echo "Build AppImage binary" @yarn --cwd=app run build-appimage-x64 +build_snap_x64: + @echo "Build Snap package" + @yarn --cwd=app run build-snap-x64 + build_tar.xz_arm64: @echo "Build tar.xz archive" @@ -90,6 +94,10 @@ build_appimage_arm64: @echo "Build AppImage binary" @yarn --cwd=app run build-appimage-arm64 +build_snap_arm64: + @echo "Build Snap package" + @yarn --cwd=app run build-snap-arm64 + #! DEV patch-new: install_deps diff --git a/package-append.json b/package-append.json index 4b7e59e..a083776 100644 --- a/package-append.json +++ b/package-append.json @@ -13,6 +13,7 @@ "build-tar.xz-arm64": "electron-builder --arm64 --linux tar.xz", "build-deb-arm64": "electron-builder --arm64 --linux deb", "build-rpm-arm64": "electron-builder --arm64 --linux rpm", + "build-snap-arm64": "electron-builder --arm64 --linux snap", "build-appimage-arm64": "electron-builder --arm64 --linux AppImage" }, "devDependencies": { From ad63745c288b17cffc189a23fcbd86fd8d4a6fe9 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sat, 1 Feb 2025 01:12:42 +0100 Subject: [PATCH 23/34] docs: add contributing guidelines and refactor README --- CONTRIBUTING.md | 146 ++++++++++++++++++++++++++++++++++++++++ README.md | 175 +++++++++++++++++++++++++++++++----------------- 2 files changed, 259 insertions(+), 62 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c0231d3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,146 @@ +# Contributing to Deezer Linux + +Thank you for considering contributing to the unofficial Deezer Linux port! This document provides guidelines for contributing to the project. + +## Code of Conduct + +By participating in this project, you agree to maintain a respectful and inclusive environment for everyone. + +## How to Contribute + +### Reporting Bugs + +- Before creating an issue, please check if it hasn't been reported already +- Use the issue template if available +- Include detailed steps to reproduce the bug +- Specify your system information (OS, architecture, package type) + +### Suggesting Enhancements + +- Use clear and descriptive titles +- Provide a step-by-step description of the suggested enhancement +- Explain why this enhancement would be useful + +### Pull Requests + +1. Fork the repository +2. Create a new branch (`git checkout -b feature/your-feature`) +3. Make your changes +4. Build one or more packages +5. Commit your changes (`git commit -m 'feat: Add some feature'`) +6. Push to the branch (`git push origin feature/your-feature`) +7. Open a Pull Request +8. Provide information about the changes made and the packages built and manually tested + +### Build Requirements + +Ensure you have all required dependencies: + +- Node.js (20 recommended) +- npm +- yarn +- 7z +- make +- wget + +## Development Setup + +```sh +make install_deps +``` + +## Patching + +### Creating a Patch + +To create a patch, clone the repository and run: + +```sh +make patch-new +``` + +Edit the files you want to change in the `app` directory. + +> [!TIP] +> You do not need to generate a patch file to test your changes. Open the `app` folder after running `make patch-new` and make your changes. Then run `make build_{target}_{arch}` to try your changes. + +When you are done, commit your changes, and then generate the patch: + +```sh +make patch-gen +``` + +The patch will be saved in the `patches` directory. Make sure to rename the patch file to something meaningful and follow the naming convention. Add the patch to the echoed list in the `Makefile`. + +> [!TIP] +> If possible, you may want to add a switch to allow the users to use the feature you added or not. Do not forget to [mention it](./README.md#usage). + +You can now try your patch by building and executing the package: + +```sh +make build_{target}_{arch} +``` + +### Applying a Patch + +To manually apply a patch, run: + +```sh +apply -p1 -dapp < patches/{name}.patch +``` + +> [!NOTE] +> Deezer does not provide all the information needed to implement some features. +> +> Deezer provides: +> +> - Player state (playing, paused) +> - Track info (title, artist, album, cover URL) +> - Shuffle and repeat state +> +> Deezer does not provide: +> +> - Track duration +> - Track position + +## Updating + +### Updating the Source Executable + +_This section is automated via GitHub Actions, but can be done manually._ + +1. Update the source executable URL: + +```sh +curl -Ls -o /dev/null -w %{url_effective} https://www.deezer.com/desktop/download\?platform\=win32\&architecture\=x86 +``` + +2. Update the source executable SHA256: + +```sh +curl -Ls https://www.deezer.com/desktop/download\?platform\=win32\&architecture\=x86 | sha256sum +``` + +### Updating the Electron Version + +_This section is not automated via GitHub Actions._ + +To get the Electron version used, run: + +```sh +strings ./source/Deezer.exe | grep '^Chrome/[0-9.]* Electron/[0-9.]*' +``` + +## Legal Notes + +Remember that this is an unofficial port. Any contribution must: + +- Respect Deezer's intellectual property +- Not modify core Deezer functionality +- Follow software distribution best practices + +## Questions? + +Open an issue for any questions not covered by this guide. + +Thank you for contributing! diff --git a/README.md b/README.md index fee614e..cb907c6 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,17 @@ # Deezer for linux -> [!Important] -> Existing flatpak users NEED to migrate the the flathub repository as soon as possible, as the flatpak repository was deleted from here (it was more than 2Gb in size). In order to do so (normally without losing any data), simply: - -```sh -flatpak uninstall dev.aunetx.deezer -flatpak remote-delete deezer-linux -flatpak install flathub dev.aunetx.deezer -``` - ---- - [![Build](https://github.com/aunetx/deezer-linux/actions/workflows/build.yml/badge.svg)](https://github.com/aunetx/deezer-linux/actions/workflows/build.yml) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/aunetx/deezer-linux)](https://github.com/aunetx/deezer-linux/releases/latest) -This repo is an UNOFFICIAL linux port of the official windows-only Deezer app. Being based on the native Windows app, it allows downloading your songs to listen to them offline! +This repo is an UNOFFICIAL linux port ([legal notice](#legal-disclaimer)) of the official windows-only Deezer app. Being based on the native Windows app, it allows downloading your songs to listen to them offline! It packages the app in a number of formats: - Flatpak, [available on flathub](https://flathub.org/apps/dev.aunetx.deezer) -- Snap (not tested yet) -- AppImage (can't automatically login without desktop integration) +- AppImage - `rpm` (Fedora, Red Hat, CentOS, openSUSE, ...) - `deb` (Debian, Ubuntu, Pop!\_OS, elementary OS, ...) -- `7z` to install anywhere else +- `tar.xz` to install anywhere else Special thanks to [SibrenVasse](https://github.com/SibrenVasse) who made the [original AUR package](https://github.com/SibrenVasse/deezer) for this app! @@ -31,72 +19,135 @@ Special thanks to [SibrenVasse](https://github.com/SibrenVasse) who made the [or You can find all of the packages on [the release page](https://github.com/aunetx/deezer-linux/releases/latest). -To install the flatpak version, you can simply go to https://flathub.org/apps/dev.aunetx.deezer (or use your favorite flatpak package manager). **Old users using this repo as a flatpak repository should migrate as soon as they can toward Flathub.** +To install the flatpak version, you can simply go to https://flathub.org/apps/dev.aunetx.deezer (or use your favorite flatpak package manager). + +> [!Important] +> Old flatpak users must migrate to the flathub repository as soon as possible, as the flatpak repository was deleted from this repo (it weighed more that 2GB). In order to do so, you can use the following commands: +> +> ```sh +> flatpak uninstall dev.aunetx.deezer +> flatpak remote-delete deezer-linux +> flatpak install flathub dev.aunetx.deezer +> ``` +> +> You _should_ not lose any data by doing this. Other packages can be installed from you package manager, either by clicking on them or from the command-line. -Please note that even though it is automatically generated, the snapcraft package has never been tested; Please open an issue if you encounter any problem. +## Usage -## From source +| Option | Description | +| ----------------------- | ----------------------------------------------------------------------------------------------- | +| `--start-in-tray` | Start the app in the tray (see [patch](./patches/01-start-hidden-in-tray.patch)) | +| `--disable-systray` | Quit the app when the window is closed (see [patch](./patches/03-quit.patch)) | +| `--disable-features` | Disable some features (see [patch](./patches/06-better-management-of-MPRIS.patch)) | +| `--disable-discord-rpc` | Disable Discord RPC integration (see [patch](./patches/08-discord-rich-presence-disable.patch)) | -You will need to install some things in order to generate the packages from source: +## Building from source -- nodejs +### Available targets + +| Target | arm64 | x64 | +| -------- | ----- | --- | +| appimage | ⚠️ | ✅ | +| deb | ⚠️ | ✅ | +| rpm | ⚠️ | ✅ | +| tar.xz | ⚠️ | ✅ | +| snap | ⛔ | ⛔ | + +✅ Available ; ⚠️ Not tested ; ❌ Not available ; ⛔ Not planned (see [FAQ](#faq)) + +> [!NOTE] +> Please open an issue if you want a specific target to be added. + +### Requirements + +- Node.js (20 recommended) - npm - yarn -- 7z by installing `p7zip` and `p7zip-full` +- 7z (try installing `p7zip` and `p7zip-full`) - make - wget -### AppImage +### Setup -To build the AppImage image from source, use: +To build the project, you need to install the dependencies first: ```sh make install_deps -make build_appimage -``` - -And the image should be in the `artifacts/x64` folder. - -Because of the way AppImage works, except if you use `appimaged`, you will not be able to login from the browser; then you are not redirected to the application. -To make it work, you must first open a instance of the app, and copy the link shown in `https://www.deezer.com/desktop/login/electron/callback`. In a terminal -(where the .AppImage file is), use: - -```sh -deezer-desktop-*.AppImage deezer://autolog/... -``` - -And you should be automatically logged in. - -> [!Caution] -> If you want to open an issue about this, please do NOT share your own `deezer://autolog/...` link, as it would permit anybody to log into your account without the need for a password! - -See [this issue](https://github.com/aunetx/deezer-linux/issues/29) for more informations about login in AppImage. - -## rpm / deb / snap / 7z - -To generate the `rpm`/`deb`/`snap`/`7z` packages, you can use: - -```sh -# prepare the build -make install_deps - -# and then - -make build_deb_x64 -# or -make build_rpm_x64 -# or -make build_snap_x64 -# or -make build_tar.xz_x64 ``` > [!NOTE] -> You don't need to use `make install_deps` everytime you start a build, but you need to call it at least once. Everything should be generated in `artifacts/x64`. +> You don't need to use `make install_deps` everytime you start a build, however you need to call it at least once. Everything should be generated in `artifacts/{arch}`. -If you generate the 7z package, you can run it directly by extracting to a directory, and calling `./deezer-desktop` from there. +### AppImage + +To build the AppImage x64 image, you can use: + +```sh +make build_appimage_x64 +``` + +Artifacts will be generated in `artifacts/x64`. + +> [!WARNING] +> You _may_ encounter a problem with the AppImage, where you are not able to login. This is a known issue, and is due to the way AppImage works. In this case, you can copy the link shown in `https://www.deezer.com/desktop/login/electron/callback`. +> +> In the same directory as the AppImage file, use: +> +> ```sh +> deezer-desktop-*.AppImage deezer://autolog/... +> ``` +> +> You should now be logged in. +> +> For more information, see [issue #29](https://github.com/aunetx/deezer-linux/issues/29) + +> [!Caution] +> If you want to open an issue about this, please do not share your own `deezer://autolog/...` link, as it would allow anyone to log into your account without your consent. + +### rpm / deb / tar.xz + +To generate the `rpm`/`deb`/`tar.xz` packages, you can use: + +```sh +make build_{target}_{arch} +``` + +Example: + +```sh +make build_rpm_arm64 +``` + +Artifacts will be generated in `artifacts/{arch}`. + +> [!WARNING] +> Building can take a long time. Be patient. + +If you generate the `tar.xz` package, you can run it directly by extracting to a directory, and calling `./deezer-desktop` from there. + +## Development + +If you want to contribute to this project, please read the [contribution guidelines](CONTRIBUTING.md) file. + +## FAQ + +### Why does this project exist? + +Deezer can be used on Linux through the web interface, but it does not allow downloading songs for offline listening. This project allows you to use the official Deezer app on Linux, with the same features as on Windows (plus some Linux-specific features). + +### Why can't I get the snap package? + +Please see [this issue](https://github.com/babluboy/bookworm/issues/178) or [this issue](https://github.com/babluboy/nutty/issues/68). Prefer using Flatpak or AppImage. + +### Why not publishing the source code and not patches? + +The source code of the Deezer app is not open-source. Reverse-engineering the app would be illegal and would violate the Deezer EULA. This project is a port of the official Windows app, and does not contain any reverse-engineered code, rather it bundles the official Windows app with a compatibility layer. + +## Why do I need npm _and_ yarn? + +That is a good question. Some kind of legacy choice, I guess. ## **LEGAL DISCLAIMER** From 48f7c30faf8fdd1aca681b7159b3ec26e8179e8e Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sat, 1 Feb 2025 01:27:44 +0100 Subject: [PATCH 24/34] chore: bump deezer to v7.0.10 --- dev.aunetx.deezer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev.aunetx.deezer.json b/dev.aunetx.deezer.json index 452a276..45396cb 100644 --- a/dev.aunetx.deezer.json +++ b/dev.aunetx.deezer.json @@ -6,8 +6,8 @@ "sources": [ { "type": "archive", - "url": "https://e-cdn-content.dzcdn.net/builds/deezer-desktop/8cF2rAuKxLcU1oMDmCYm8Uiqe19Ql0HTySLssdzLkQ9ZWHuDTp2JBtQOvdrFzWPA/win32/x86/7.0.1/DeezerDesktopSetup_7.0.1.exe", - "sha256": "1ae2de0b55d564da53832cab86eed076132ad1df7420b85b4e6bdfa606a1b195", + "url": "https://e-cdn-content.dzcdn.net/builds/deezer-desktop/8cF2rAuKxLcU1oMDmCYm8Uiqe19Ql0HTySLssdzLkQ9ZWHuDTp2JBtQOvdrFzWPA/win32/x86/7.0.10/DeezerDesktopSetup_7.0.10.exe", + "sha256": "8b1f2369f5d9513c2746bab037c6d913527780f98bca067ec7139dede40a5958", "only-arches": ["x86_64"], "dest": "archive", "x-checker-data": { From 0c24e392a40510a974cf5207ae0fe2fe27a98213 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sat, 1 Feb 2025 12:49:09 +0100 Subject: [PATCH 25/34] feat(patch): add log level environment variable (w/ docs); change fallback release to `1.0.0` --- Makefile | 1 + README.md | 5 ++ .../09-log-level-environment-variable.patch | 60 +++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 patches/09-log-level-environment-variable.patch diff --git a/Makefile b/Makefile index b9e3e8d..fd848d6 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,7 @@ prepare: clean install_build_deps @echo "06 - Add a better management of MPRIS (https://github.com/aunetx/deezer-linux/pull/61)" @echo "07 - Add Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/82)" @echo "08 - Add option to disable Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/95)" + @echo "09 - Add environment variable to change log level (https://github.com/aunetx/deezer-linux/pull/95)" $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) @echo "Append `package-append.json` to the `package.json` of the app" diff --git a/README.md b/README.md index cb907c6..b9515a7 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,11 @@ Other packages can be installed from you package manager, either by clicking on | `--disable-features` | Disable some features (see [patch](./patches/06-better-management-of-MPRIS.patch)) | | `--disable-discord-rpc` | Disable Discord RPC integration (see [patch](./patches/08-discord-rich-presence-disable.patch)) | +| Environment variable | Options | Description | +| -------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `LOG_LEVEL` | `silly`,`debug`,`verbose`,`info`,`warning`,`error` | Set the log level (see [patch](./patches/09-log-level-environment-variable.patch)) | +| `DZ_DEVTOOLS` | `yes`,`no` | Enable the developer console (ctrl+shift+i) | + ## Building from source ### Available targets diff --git a/patches/09-log-level-environment-variable.patch b/patches/09-log-level-environment-variable.patch new file mode 100644 index 0000000..db5b901 --- /dev/null +++ b/patches/09-log-level-environment-variable.patch @@ -0,0 +1,60 @@ +From 93a932ba99e8125169eeb512fa6f9a89a70eeb1e Mon Sep 17 00:00:00 2001 +From: josselinonduty +Date: Sat, 1 Feb 2025 12:42:07 +0100 +Subject: [PATCH] feat: add log level env variable + +--- + build/main.js | 30 +++++++++++++++++++++++++++++- + 1 file changed, 29 insertions(+), 1 deletion(-) + +diff --git a/build/main.js b/build/main.js +index 8b645c6..c62943b 100644 +--- a/build/main.js ++++ b/build/main.js +@@ -12,7 +12,7 @@ + var result = release.match(matcher); + if (result[1]) + return result[1]; +- return "0.0.0"; ++ return "1.0.0"; + } + module.exports = __module_os; + }, +@@ -67,6 +67,34 @@ + var external_electron_log_default = __webpack_require__.n( + external_electron_log_namespaceObject + ); ++ function updateLogLevel() { ++ if (process.env.LOG_LEVEL) { ++ if (process.env.LOG_LEVEL !== "silly") ++ external_electron_log_default().silly = () => {}; ++ else return; ++ ++ if (process.env.LOG_LEVEL !== "debug") ++ external_electron_log_default().debug = () => {}; ++ else return; ++ ++ if (process.env.LOG_LEVEL !== "verbose") ++ external_electron_log_default().verbose = () => {}; ++ else return; ++ ++ if (process.env.LOG_LEVEL !== "info") ++ external_electron_log_default().info = () => {}; ++ else return; ++ ++ if (process.env.LOG_LEVEL !== "warn") ++ external_electron_log_default().warn = () => {}; ++ else return; ++ ++ if (process.env.LOG_LEVEL !== "error") ++ external_electron_log_default().error = () => {}; ++ else return; ++ } ++ } ++ updateLogLevel(); + const external_electron_settings_namespaceObject = require("electron-settings"); + var external_electron_settings_default = __webpack_require__.n( + external_electron_settings_namespaceObject +-- +2.43.0 + From b745827f79fcf8cb128da5287887652910efe819 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sat, 1 Feb 2025 17:39:26 +0100 Subject: [PATCH 26/34] feat: provide duration and url information to mpris and discord rpc; update rich-presence-builder; make discord rpc opt-in --- patches/10-additional-metadata.patch | 288 +++++++++++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 patches/10-additional-metadata.patch diff --git a/patches/10-additional-metadata.patch b/patches/10-additional-metadata.patch new file mode 100644 index 0000000..11d4e86 --- /dev/null +++ b/patches/10-additional-metadata.patch @@ -0,0 +1,288 @@ +From 493f6f6a6433882cc2d50b4ae352cd808bf0c23e Mon Sep 17 00:00:00 2001 +From: josselinonduty +Date: Sat, 1 Feb 2025 17:34:11 +0100 +Subject: [PATCH] feat: provide duration and url information to mpris and + discord rpc; update rich-presence-builder; make discord rpc opt-in + +--- + build/main.js | 144 ++++++++++++++++++++++++++++++++++------------ + build/renderer.js | 10 ++-- + package.json | 2 +- + 3 files changed, 113 insertions(+), 43 deletions(-) + +diff --git a/build/main.js b/build/main.js +index c62943b..66c1a45 100644 +--- a/build/main.js ++++ b/build/main.js +@@ -120,11 +120,11 @@ + var external_electron_mpris_default = __webpack_require__.n( + external_electron_mpris_namespaceObject + ); +- const external_rich_presence_builder_namespaceObject = require("rich-presence-builder"); ++ const external_rich_presence_builder_namespaceObject = require("@josselinonduty/rich-presence-builder"); + var external_rich_presence_builder_default = __webpack_require__.n( + external_rich_presence_builder_namespaceObject + ); +- var rpcConnection; ++ var rpcConnection, rpcData, rpcStartedAt, rpcPausedAt; + function isPlatform(platform) { + switch (platform) { + case PLATFORM.WINDOWS: +@@ -1248,7 +1248,6 @@ + this.stop(); + })); + this.initMprisPlayerControls(); +- this.initDiscordRichPresence(); + } + initMprisPlayerControls() { + // Events => ['raise', 'quit', 'next', 'previous', 'pause', 'playpause', 'stop', 'play', 'seek', 'position', 'open', 'volume', 'loopStatus', 'shuffle']; +@@ -1262,27 +1261,92 @@ + this.mprisPlayer.on('loopStatus', this.setRepeatMode.bind(this)); + this.mprisPlayer.on('raise', () => this.app.getWindow().show()) + } +- initDiscordRichPresence() { +- if (process.argv.some(arg => arg === '--disable-discord-rpc')) return; +- rpcConnection = new external_rich_presence_builder_namespaceObject({ +- clientID: "1244016234203185183", +- }); +- }; +- updateDiscordRichPresence(track) { +- if (!rpcConnection) return; +- rpcConnection.setSmallImage( +- this.player.state === "playing" ? "play" : "pause", +- this.player.state === "playing" ? "Playing" : "Paused" +- ); +- if (track) { +- rpcConnection.setLargeImage(track.coverUrl); +- rpcConnection.setDescription(track.title); +- if (track.title === track.album) +- rpcConnection.setState(`${track.artist}`); +- else +- rpcConnection.setState(`${track.artist} - ${track.album}`); ++ updateDiscordRichPresence(track, data) { ++ if (!process.argv.some(arg => arg === '--enable-discord-rpc')) return; ++ ++ if (track && data) { ++ // Update track information ++ const duration = data?.trackInfo?.song?.DURATION; ++ if (!duration) return; ++ ++ rpcStartedAt = Date.now(); ++ rpcPausedAt = undefined; ++ rpcData = { ++ type: 2, ++ smallImage: { ++ image: "play", ++ text: "Playing" ++ }, ++ largeImage: track.coverUrl, ++ description: track.title, ++ state: track.title === track.album ? ++ `${track.artist}` ++ : `${track.artist} - ${track.album}`, ++ startTimestamp: rpcStartedAt, ++ button: { ++ label: "Listen on Deezer", ++ url: `https://deezer.com/track/${data.trackInfo.song.SNG_ID}` ++ } ++ } ++ ++ rpcConnection = new external_rich_presence_builder_namespaceObject({ ++ clientID: "1244016234203185183", ++ }) ++ .setType(rpcData.type) ++ .setSmallImage( ++ rpcData.smallImage.image, ++ rpcData.smallImage.text ++ ) ++ .setLargeImage(rpcData.largeImage) ++ .setDescription(rpcData.description) ++ .setState(rpcData.state) ++ .setStartTimestamp(rpcData.startTimestamp) ++ .addButton(rpcData.button.label, rpcData.button.url); ++ rpcConnection ++ .go().catch() ++ } else { ++ // Update playing state only ++ if (!rpcConnection) return; ++ ++ if (this.player.state === "playing") { ++ if (rpcPausedAt) { ++ const elapsed = rpcPausedAt - rpcStartedAt; ++ rpcStartedAt = Date.now() - elapsed; ++ rpcData.startTimestamp = rpcStartedAt; ++ } ++ rpcPausedAt = undefined; ++ rpcData.smallImage = { ++ image: "play", ++ text: "Playing" ++ } ++ } else { ++ rpcData.startTimestamp = undefined; ++ rpcPausedAt = Date.now(); ++ rpcData.smallImage = { ++ image: "pause", ++ text: "Paused" ++ } ++ } ++ ++ rpcConnection = new external_rich_presence_builder_namespaceObject({ ++ clientID: "1244016234203185183", ++ }) ++ .setType(rpcData.type) ++ .setSmallImage( ++ rpcData.smallImage.image, ++ rpcData.smallImage.text ++ ) ++ .setLargeImage(rpcData.largeImage) ++ .setDescription(rpcData.description) ++ .setState(rpcData.state) ++ .addButton(rpcData.button.label, rpcData.button.url); ++ ++ if (rpcData.startTimestamp) ++ rpcConnection.setStartTimestamp(rpcData.startTimestamp); ++ ++ rpcConnection ++ .go().catch() + } +- rpcConnection.go().catch(); + } + play() { + this.ipc.send("channel-player-media-control", MediaPlayerControl.Play); +@@ -1308,19 +1372,25 @@ + setRepeatMode(repeatMode) { + this.ipc.send("channel-player-repeat-mode-update", repeatMode); + } +- setTrackInfo(track) { ++ setTrackInfo(track, data) { + (this.track = Object.assign(this.track, track)), + this.emit(MediaEvents.TrackUpdated, this.track), + (this.mprisPlayer.metadata = { ++ 'mpris:length': data?.trackInfo?.song?.DURATION ++ ? data.trackInfo.song.DURATION * 1000 ++ : undefined, + 'mpris:trackid': this.mprisPlayer.objectPath('track/0'), + 'mpris:artUrl': track.coverUrl, + 'xesam:title': track.title, + 'xesam:album': track.album, +- 'xesam:artist': [track.artist] +- }), +- this.updateDiscordRichPresence(track); ++ 'xesam:artist': [track.artist], ++ 'xesam:url': data?.trackInfo?.song ++ ? `https://deezer.com/track/${data.trackInfo.song.SNG_ID}` ++ : undefined ++ }); ++ this.updateDiscordRichPresence(track, data); + } +- setPlayerInfo(player) { ++ setPlayerInfo(player, data) { + (this.player = Object.assign(this.player, player)), + this.emit(MediaEvents.PlayerUpdated, this.player), + (this.mprisPlayer.playbackStatus = +@@ -2833,8 +2903,8 @@ + var powerSaveTimeoutId; + PlayerIpc_ipc.on( + "channel-player-state-update", +- (event, state) => { +- media.setPlayerInfo({ state }), ++ (event, state, data) => { ++ media.setPlayerInfo({ state }, data), + clearTimeout(powerSaveTimeoutId), + powerSaveTimeoutId = setTimeout( + () => { +@@ -2847,15 +2917,15 @@ + ), + PlayerIpc_ipc.on( + "channel-player-track-update", +- (event, track, player) => { +- media.setPlayerInfo(player), media.setTrackInfo(track); ++ (event, track, player, data) => { ++ media.setPlayerInfo(player, data), media.setTrackInfo(track, data); + } + ), +- PlayerIpc_ipc.on("channel-player-shuffle-update", (event, player) => { +- media.setPlayerInfo(player); ++ PlayerIpc_ipc.on("channel-player-shuffle-update", (event, player, data) => { ++ media.setPlayerInfo(player, data); + }), +- PlayerIpc_ipc.on("channel-player-repeat-mode-update", (event, player) => { +- media.setPlayerInfo(player); ++ PlayerIpc_ipc.on("channel-player-repeat-mode-update", (event, player, data) => { ++ media.setPlayerInfo(player, data); + }); + const UpdaterIpc_ipc = main_di.get(SERVICE_IPC), + autoUpdater = main_di.get(SERVICE_UPDATER); +@@ -2864,7 +2934,7 @@ + }); + const UserIpc_ipc = main_di.get(SERVICE_IPC), + user = main_di.get(SERVICE_USER); +- UserIpc_ipc.on("channel-user-store-updated", (event, userData) => { ++ UserIpc_ipc.on("channel-user-store-updated", (event, userData, data) => { + user.setUserInfo(userData); + }); + var application_awaiter = function (thisArg, _arguments, P, generator) { +diff --git a/build/renderer.js b/build/renderer.js +index fb02453..4328ccd 100644 +--- a/build/renderer.js ++++ b/build/renderer.js +@@ -354,7 +354,7 @@ + offerId: user.OFFER_ID, + country: user.COUNTRY, + gatekeeps: user.__DZR_GATEKEEPS__, +- }); ++ }, event.data); + break; + } + case "player-repeat-changed": +@@ -363,7 +363,7 @@ + canPrev: event.data.player.hasPrev, + canNext: event.data.player.hasNext, + canRepeat: event.data.player.hasRepeat, +- }); ++ }, event.data); + break; + case "player-shuffle-changed": + renderer_ipc.send("channel-player-shuffle-update", { +@@ -371,14 +371,14 @@ + canPrev: event.data.player.hasPrev, + canNext: event.data.player.hasNext, + canShuffle: event.data.player.hasShuffle, +- }); ++ }, event.data); + break; + case "player-playing-changed": { + const state = + !0 === event.data.isPlaying + ? MediaPlayerState.Playing + : MediaPlayerState.Paused; +- renderer_ipc.send("channel-player-state-update", state); ++ renderer_ipc.send("channel-player-state-update", state, event.data); + break; + } + case "player-track-updated": { +@@ -414,7 +414,7 @@ + canRepeat: event.data.player.hasRepeat, + canShuffle: event.data.player.hasShuffle, + }; +- renderer_ipc.send("channel-player-track-update", track, player); ++ renderer_ipc.send("channel-player-track-update", track, player, event.data); + break; + } + } +diff --git a/package.json b/package.json +index 6c78c7d..cee7ce4 100644 +--- a/package.json ++++ b/package.json +@@ -14,7 +14,7 @@ + "dependencies": { + "@electron/remote": "2.1.2", + "@jellybrick/mpris-service": "2.1.5", +- "rich-presence-builder": "0.1.1", ++ "@josselinonduty/rich-presence-builder": "0.1.2", + "electron-log": "^5.1.2", + "electron-settings": "4.0.4", + "electron-updater": "^6.1.8", +-- +2.43.0 + From 10aa5f2e663222e7123c24adeaf51fb4cda52a1e Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sat, 1 Feb 2025 18:31:29 +0100 Subject: [PATCH 27/34] chore(README): update discord rpc arg and clarify faq --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b9515a7..3179107 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Other packages can be installed from you package manager, either by clicking on | `--start-in-tray` | Start the app in the tray (see [patch](./patches/01-start-hidden-in-tray.patch)) | | `--disable-systray` | Quit the app when the window is closed (see [patch](./patches/03-quit.patch)) | | `--disable-features` | Disable some features (see [patch](./patches/06-better-management-of-MPRIS.patch)) | -| `--disable-discord-rpc` | Disable Discord RPC integration (see [patch](./patches/08-discord-rich-presence-disable.patch)) | +| `--enable-discord-rpc` | Enable Discord RPC integration (see [patch](./patches/08-discord-rich-presence-disable.patch)) | | Environment variable | Options | Description | | -------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------- | @@ -146,7 +146,7 @@ Deezer can be used on Linux through the web interface, but it does not allow dow Please see [this issue](https://github.com/babluboy/bookworm/issues/178) or [this issue](https://github.com/babluboy/nutty/issues/68). Prefer using Flatpak or AppImage. -### Why not publishing the source code and not patches? +### Why are the patches published but not the app's source code? patches? The source code of the Deezer app is not open-source. Reverse-engineering the app would be illegal and would violate the Deezer EULA. This project is a port of the official Windows app, and does not contain any reverse-engineered code, rather it bundles the official Windows app with a compatibility layer. From 22dcfe4c540daf752a8d152e309e1e4aa3d8bc43 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sat, 1 Feb 2025 18:31:37 +0100 Subject: [PATCH 28/34] chore: update makefile and docs to allow using npm or yarn independently --- .gitignore | 1 + CONTRIBUTING.md | 1 - Makefile | 66 +++++++++++++++++++++++++++---------------------- README.md | 12 ++++++--- 4 files changed, 46 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index 62823fa..0eb3fb8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ flatpak source app package-lock.json +yarn.lock artifacts package.json .vscode/launch.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c0231d3..b36e37b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,7 +38,6 @@ Ensure you have all required dependencies: - Node.js (20 recommended) - npm -- yarn - 7z - make - wget diff --git a/Makefile b/Makefile index fd848d6..2190391 100644 --- a/Makefile +++ b/Makefile @@ -5,32 +5,37 @@ BASE_URL = $(shell jq ".modules[0].sources[0].url" dev.aunetx.deezer.json) SHA256 = $(shell jq ".modules[0].sources[0].sha256" dev.aunetx.deezer.json) PKGVER = $(shell echo $(BASE_URL) | grep -Eo "([0-9]+\.[0-9]+\.[0-9]+)" | head -1) VERSION_REGEX = ^v$(PKGVER)-[0-9]{1,}$$ - +SOURCE_DIR ?= ./source +APP_DIR ?= ./app +PACKAGE_MANAGER ?= npm +PACKAGE_MANAGER_SUBDIR_ARG ?= --prefix +PACKAGE_MANAGER_INSTALL_CMD ?= install +PACKAGE_MANAGER_ADD_CMD ?= install install_build_deps: - @npm install --engine-strict @electron/asar@3.2.18 - @npm install prettier@2.8.8 + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_ADD_CMD) @electron/asar@3.2.18 --engine-strict + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_ADD_CMD) prettier@2.8.8 prepare: clean install_build_deps - @mkdir -p source + @mkdir -p $(SOURCE_DIR) @echo "Download installer" - @wget -nv $(BASE_URL) -O source/deezer-setup-$(PKGVER).exe + @wget -nv $(BASE_URL) -O $(SOURCE_DIR)/deezer-setup-$(PKGVER).exe @echo "Verify installer" - @echo "$(SHA256) source/deezer-setup-$(PKGVER).exe" | sha256sum -c --status || exit 1 + @echo "$(SHA256) $(SOURCE_DIR)/deezer-setup-$(PKGVER).exe" | sha256sum -c --status || exit 1 @echo "Extract app archive from installer" - @cd source && 7z x -so deezer-setup-$(PKGVER).exe '$$PLUGINSDIR/app-32.7z' > app-32.7z + @cd $(SOURCE_DIR) && 7z x -so deezer-setup-$(PKGVER).exe '$$PLUGINSDIR/app-32.7z' > app-32.7z @echo "Extract app from app archive" - @cd source && 7z x -y -bsp0 -bso0 app-32.7z + @cd $(SOURCE_DIR) && 7z x -y -bsp0 -bso0 app-32.7z @echo "Extract app sources from the app" - @node_modules/@electron/asar/bin/asar.js extract source/resources/app.asar app + @node_modules/@electron/asar/bin/asar.js extract $(SOURCE_DIR)/resources/app.asar $(APP_DIR) @echo "Prettier the sources to patch successfully" - @node_modules/prettier/bin-prettier.js --write "app/build/*.js" + @node_modules/prettier/bin-prettier.js --write "$(APP_DIR)/build/*.js" @echo "Apply patches from ./patches:" @echo "01 - Hide to tray when closing (https://github.com/SibrenVasse/deezer/issues/4)" @@ -42,75 +47,76 @@ prepare: clean install_build_deps @echo "07 - Add Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/82)" @echo "08 - Add option to disable Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/95)" @echo "09 - Add environment variable to change log level (https://github.com/aunetx/deezer-linux/pull/95)" - $(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);) + @echo "10 - Add track duration and url, various fixes (https://github.com/aunetx/deezer-linux/pull/95)" + $(foreach p, $(wildcard ./patches/*), patch -p 1 -d $(APP_DIR) < $(p);) @echo "Append `package-append.json` to the `package.json` of the app" @echo "Adds electron, elecron-builder dependencies, prod and build directives" - @jq -s '.[0] * .[1]' app/package.json package-append.json > app/tmp.json && mv app/tmp.json app/package.json + @jq -s '.[0] * .[1]' $(APP_DIR)/package.json package-append.json > $(APP_DIR)/tmp.json && mv $(APP_DIR)/tmp.json $(APP_DIR)/package.json @echo "Download new packages" - @npm i + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_INSTALL_CMD) #! PACKAGES install_deps: prepare - @echo "Install yarn dependencies to pack them later" - @yarn --cwd=app install + @echo "Install $(PACKAGE_MANAGER) dependencies to pack them later" + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) $(PACKAGE_MANAGER_INSTALL_CMD) build_tar.xz_x64: @echo "Build tar.xz archive" - @yarn --cwd=app run build-tar.xz-x64 + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run build-tar.xz-x64 build_deb_x64: @echo "Build deb package" - @yarn --cwd=app run build-deb-x64 + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run build-deb-x64 build_rpm_x64: @echo "Build rpm package" - @yarn --cwd=app run build-rpm-x64 + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run build-rpm-x64 build_appimage_x64: @echo "Build AppImage binary" - @yarn --cwd=app run build-appimage-x64 + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run build-appimage-x64 build_snap_x64: @echo "Build Snap package" - @yarn --cwd=app run build-snap-x64 + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run build-snap-x64 build_tar.xz_arm64: @echo "Build tar.xz archive" - @yarn --cwd=app run build-tar.xz-arm64 + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run build-tar.xz-arm64 build_deb_arm64: @echo "Build deb package" - @yarn --cwd=app run build-deb-arm64 + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run build-deb-arm64 build_rpm_arm64: @echo "Build rpm package" - @yarn --cwd=app run build-rpm-arm64 + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run build-rpm-arm64 build_appimage_arm64: @echo "Build AppImage binary" - @yarn --cwd=app run build-appimage-arm64 + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run build-appimage-arm64 build_snap_arm64: @echo "Build Snap package" - @yarn --cwd=app run build-snap-arm64 + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run build-snap-arm64 #! DEV patch-new: install_deps @echo "Setting up the development environment..." - @cd app && echo "node_modules\n.vscode\n*.diff\n*.orig" > .gitignore && git init && git add . - @cd app && git commit -m "initial commit" - @echo "You can now edit the sources in the app directory" + @cd $(APP_DIR) && echo "node_modules\n.vscode\n*.diff\n*.orig" > .gitignore && git init && git add . + @cd $(APP_DIR) && git commit -m "initial commit" + @echo "You can now edit the sources in the $(APP_DIR) directory" @echo "When you are done, commit your changes, run 'make patch-gen'." @echo "Don't forget to rename your patch." patch-gen: - @cd app && git format-patch -1 HEAD --stdout > ../patches/$(shell date +%y%m%d-%s).patch + @cd $(APP_DIR) && git format-patch -1 HEAD --stdout > ../patches/$(shell date +%y%m%d-%s).patch #! UTILS @@ -130,4 +136,4 @@ release: prepare-release clean: - @rm -rf app flatpak node_modules source artifacts package-lock.json package.json + @rm -rf ./$(APP_DIR) flatpak node_modules ./$(SOURCE_DIR) artifacts package.json diff --git a/README.md b/README.md index 3179107..99eb5a3 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,6 @@ Other packages can be installed from you package manager, either by clicking on - Node.js (20 recommended) - npm -- yarn - 7z (try installing `p7zip` and `p7zip-full`) - make - wget @@ -150,9 +149,16 @@ Please see [this issue](https://github.com/babluboy/bookworm/issues/178) or [thi The source code of the Deezer app is not open-source. Reverse-engineering the app would be illegal and would violate the Deezer EULA. This project is a port of the official Windows app, and does not contain any reverse-engineered code, rather it bundles the official Windows app with a compatibility layer. -## Why do I need npm _and_ yarn? +### I want to use yarn instead of npm, is it possible? -That is a good question. Some kind of legacy choice, I guess. +Yes, you can use yarn instead of npm. Execute the following command before building the project: + +```sh +export PACKAGE_MANAGER=yarn +export PACKAGE_MANAGER_SUBDIR_ARG=--cwd +export PACKAGE_MANAGER_ADD_CMD=add +export PACKAGE_MANAGER_INSTALL_CMD=install +``` ## **LEGAL DISCLAIMER** From 3ee1a84cd19f2deed3c4e2d79ae0692a418fd063 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sat, 1 Feb 2025 18:33:19 +0100 Subject: [PATCH 29/34] chore(README): update npm requirement to allow using yarn as an alternative --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99eb5a3..6b9da55 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Other packages can be installed from you package manager, either by clicking on ### Requirements - Node.js (20 recommended) -- npm +- npm (or yarn, see [FAQ](#i-want-to-use-yarn-instead-of-npm-is-it-possible)) - 7z (try installing `p7zip` and `p7zip-full`) - make - wget From bc584343c84a46f136bced0abb5b476555672ce0 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sat, 1 Feb 2025 19:10:56 +0100 Subject: [PATCH 30/34] fix(patch): add credits to original author; add default log level based on remove isDev patch --- patches/01-start-hidden-in-tray.patch | 4 + patches/05-remove-os-information.patch | 10 +++ .../09-log-level-environment-variable.patch | 81 ++++++++++++------- 3 files changed, 65 insertions(+), 30 deletions(-) diff --git a/patches/01-start-hidden-in-tray.patch b/patches/01-start-hidden-in-tray.patch index ad89045..00a8956 100644 --- a/patches/01-start-hidden-in-tray.patch +++ b/patches/01-start-hidden-in-tray.patch @@ -3,6 +3,10 @@ From: josselinonduty Date: Sun, 19 Jan 2025 22:59:38 +0100 Subject: [PATCH] fix: reduce to systray on close +Original patch: Dorian Stoll +This stops the excessive logging, since parts of the app will not run in development +mode anymore. It also stops the app from logging the urls for the mp3 files, which is +against the Deezer TOS. --- build/main.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/patches/05-remove-os-information.patch b/patches/05-remove-os-information.patch index a0a936e..1d994b1 100644 --- a/patches/05-remove-os-information.patch +++ b/patches/05-remove-os-information.patch @@ -3,6 +3,16 @@ From: josselinonduty Date: Fri, 24 Jan 2025 16:03:43 +0100 Subject: [PATCH] fix: ensure os release is valid +Original patch: Dorian Stoll +The application sends the kernel version as part of the User-Agent. +However, the Deezer API seems to assume the number to follow semver, +and can get confused when it doesn't. This then leads to some features +like dark mode being reported as unavailable. + +e.g: 5.11.0-16-generic works, while 5.15.14-200.fc35.x86_64 doesn't. + +The solution is to ignore the actual version and send bogus data that +is known to work. --- build/main.js | 11 ++++++++++- build/preload.js | 10 +++++++++- diff --git a/patches/09-log-level-environment-variable.patch b/patches/09-log-level-environment-variable.patch index db5b901..fc4df83 100644 --- a/patches/09-log-level-environment-variable.patch +++ b/patches/09-log-level-environment-variable.patch @@ -1,14 +1,18 @@ -From 93a932ba99e8125169eeb512fa6f9a89a70eeb1e Mon Sep 17 00:00:00 2001 +From 43e2a95ada8852ffda95a9ea08bb7914d26c6d2f Mon Sep 17 00:00:00 2001 From: josselinonduty -Date: Sat, 1 Feb 2025 12:42:07 +0100 -Subject: [PATCH] feat: add log level env variable +Date: Sat, 1 Feb 2025 19:05:39 +0100 +Subject: [PATCH] fix: set default log level to "warn" to respect Deezer TOS +Original patch: Dorian Stoll +This stops the excessive logging, since parts of the app will not run in development +mode anymore. It also stops the app from logging the urls for the mp3 files, which is +against the Deezer TOS. --- - build/main.js | 30 +++++++++++++++++++++++++++++- - 1 file changed, 29 insertions(+), 1 deletion(-) + build/main.js | 39 ++++++++++++++++++++++++++++++++++----- + 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/build/main.js b/build/main.js -index 8b645c6..c62943b 100644 +index 8b645c6..686ac80 100644 --- a/build/main.js +++ b/build/main.js @@ -12,7 +12,7 @@ @@ -20,41 +24,58 @@ index 8b645c6..c62943b 100644 } module.exports = __module_os; }, -@@ -67,6 +67,34 @@ +@@ -67,6 +67,35 @@ var external_electron_log_default = __webpack_require__.n( external_electron_log_namespaceObject ); -+ function updateLogLevel() { -+ if (process.env.LOG_LEVEL) { -+ if (process.env.LOG_LEVEL !== "silly") -+ external_electron_log_default().silly = () => {}; -+ else return; ++ // function updateLogLevel() { ++ // const level = process.env.LOG_LEVEL; ++ // if (level) { ++ // if (level !== "silly") ++ // external_electron_log_default().silly = () => {}; ++ // else return; + -+ if (process.env.LOG_LEVEL !== "debug") -+ external_electron_log_default().debug = () => {}; -+ else return; ++ // if (level !== "debug") ++ // external_electron_log_default().debug = () => {}; ++ // else return; + -+ if (process.env.LOG_LEVEL !== "verbose") -+ external_electron_log_default().verbose = () => {}; -+ else return; ++ // if (level !== "verbose") ++ // external_electron_log_default().verbose = () => {}; ++ // else return; + -+ if (process.env.LOG_LEVEL !== "info") -+ external_electron_log_default().info = () => {}; -+ else return; ++ // if (level !== "info") ++ // external_electron_log_default().info = () => {}; ++ // else return; + -+ if (process.env.LOG_LEVEL !== "warn") -+ external_electron_log_default().warn = () => {}; -+ else return; ++ // if (level !== "warn") ++ // external_electron_log_default().warn = () => {}; ++ // else return; + -+ if (process.env.LOG_LEVEL !== "error") -+ external_electron_log_default().error = () => {}; -+ else return; -+ } -+ } -+ updateLogLevel(); ++ // if (level !== "error") ++ // external_electron_log_default().error = () => {}; ++ // else return; ++ // } ++ // } ++ // updateLogLevel(); const external_electron_settings_namespaceObject = require("electron-settings"); var external_electron_settings_default = __webpack_require__.n( external_electron_settings_namespaceObject +@@ -3329,11 +3358,11 @@ + (external_electron_log_default().transports.console.format = `{h}:{i}:{s}.{ms} ({processType}/{level}) ${ + isPlatform(PLATFORM.WINDOWS) ? ">" : "›" + } {text}`), +- (external_electron_log_default().transports.console.level = isDev +- ? "silly" ++ (external_electron_log_default().transports.console.level = isDev({isPackaged: true}) || process.env.LOG_LEVEL ++ ? process.env.LOG_LEVEL + : "warn"), +- (external_electron_log_default().transports.file.level = isDev +- ? "silly" ++ (external_electron_log_default().transports.file.level = isDev({isPackaged: true}) || !process.env.LOG_LEVEL ++ ? process.env.LOG_LEVEL + : "warn"), + (external_electron_log_default().transports.sentry = function (msg) { + "error" === msg.level && -- 2.43.0 From 96684b3567f13fdbe043f21783b37c62ad6f3f62 Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sat, 8 Feb 2025 23:48:47 +0100 Subject: [PATCH 31/34] chore(CONTRIBUTING): update info to include additional metadata --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b36e37b..a0fec26 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -94,12 +94,11 @@ apply -p1 -dapp < patches/{name}.patch > Deezer provides: > > - Player state (playing, paused) -> - Track info (title, artist, album, cover URL) +> - Track metadata (title, artist, album, cover URL, duration, and more) > - Shuffle and repeat state > > Deezer does not provide: > -> - Track duration > - Track position ## Updating From 49727f17def89839d2a3c08b03efe03a6145d790 Mon Sep 17 00:00:00 2001 From: Cezar Lungu Date: Sat, 1 Mar 2025 17:52:06 +0000 Subject: [PATCH 32/34] Update 05-remove-os-information.patch Use the LTS Kernel version - 6.1.0 --- patches/05-remove-os-information.patch | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/patches/05-remove-os-information.patch b/patches/05-remove-os-information.patch index 1d994b1..2884c40 100644 --- a/patches/05-remove-os-information.patch +++ b/patches/05-remove-os-information.patch @@ -34,9 +34,9 @@ index 10a80fa..9219f4f 100644 + __module_os.release = () => { + const matcher = /(\d+\.\d+\.\d+)\.*/ + var result = release.match(matcher); -+ if (result[1]) -+ return result[1]; -+ return "0.0.0"; ++ //if (result[1]) ++ // return result[1]; ++ return "6.1.0"; + } + module.exports = __module_os; }, @@ -56,8 +56,8 @@ index 9716411..ec603d0 100644 + __module_os.release = () => { + const matcher = /(\d+\.\d+\.\d+)\.*/; + var result = release.match(matcher); -+ if (result[1]) return result[1]; -+ return "0.0.0"; ++ //if (result[1]) return result[1]; ++ return "6.1.0"; + }; + module.exports = __module_os; }, @@ -77,8 +77,8 @@ index 7241bcb..fb02453 100644 + __module_os.release = () => { + const matcher = /(\d+\.\d+\.\d+)\.*/; + var result = release.match(matcher); -+ if (result[1]) return result[1]; -+ return "0.0.0"; ++ //if (result[1]) return result[1]; ++ return "6.1.0"; + }; + module.exports = __module_os; }, @@ -98,9 +98,9 @@ index 65520fb..7919288 100644 + __module_os.release = () => { + const matcher = /(\d+\.\d+\.\d+)\.*/ + var result = release.match(matcher); -+ if (result[1]) -+ return result[1]; -+ return "0.0.0"; ++ //if (result[1]) ++ // return result[1]; ++ return "6.1.0"; + } + module.exports = __module_os; }, From 849f5eb11bc4af040e6bedd8d91a708d9c43409d Mon Sep 17 00:00:00 2001 From: Cezar Lungu Date: Sat, 1 Mar 2025 17:53:00 +0000 Subject: [PATCH 33/34] Update 09-log-level-environment-variable.patch --- patches/09-log-level-environment-variable.patch | 9 --------- 1 file changed, 9 deletions(-) diff --git a/patches/09-log-level-environment-variable.patch b/patches/09-log-level-environment-variable.patch index fc4df83..fd30c7e 100644 --- a/patches/09-log-level-environment-variable.patch +++ b/patches/09-log-level-environment-variable.patch @@ -15,15 +15,6 @@ diff --git a/build/main.js b/build/main.js index 8b645c6..686ac80 100644 --- a/build/main.js +++ b/build/main.js -@@ -12,7 +12,7 @@ - var result = release.match(matcher); - if (result[1]) - return result[1]; -- return "0.0.0"; -+ return "1.0.0"; - } - module.exports = __module_os; - }, @@ -67,6 +67,35 @@ var external_electron_log_default = __webpack_require__.n( external_electron_log_namespaceObject From 5bd7ead2cabbd6cefee8b0b38d90a1f5cbcde18f Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Sun, 2 Mar 2025 15:13:36 +0900 Subject: [PATCH 34/34] chore: remove .vscode from ignore files while creating a patch --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2190391..b37cefc 100644 --- a/Makefile +++ b/Makefile @@ -109,7 +109,7 @@ build_snap_arm64: patch-new: install_deps @echo "Setting up the development environment..." - @cd $(APP_DIR) && echo "node_modules\n.vscode\n*.diff\n*.orig" > .gitignore && git init && git add . + @cd $(APP_DIR) && echo "node_modules\n*.diff\n*.orig" > .gitignore && git init && git add . @cd $(APP_DIR) && git commit -m "initial commit" @echo "You can now edit the sources in the $(APP_DIR) directory" @echo "When you are done, commit your changes, run 'make patch-gen'."