mirror of
https://github.com/aunetx/deezer-linux.git
synced 2025-07-31 01:24:20 +02:00
Compare commits
No commits in common. "master" and "v7.0.31" have entirely different histories.
2
.github/FUNDING.yml
vendored
Normal file
2
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
github: aunetx
|
||||
ko_fi: aunetx
|
120
.github/ISSUE_TEMPLATE/bug.yml
vendored
120
.github/ISSUE_TEMPLATE/bug.yml
vendored
@ -1,120 +0,0 @@
|
||||
name: 🐛 Bug Report
|
||||
description: Report a reproducible issue for the project on Linux systems
|
||||
title: "[BUG] <Short bug description>"
|
||||
labels: [bug]
|
||||
assignees: [josselinonduty]
|
||||
|
||||
body:
|
||||
- type: checkboxes
|
||||
id: precheck
|
||||
attributes:
|
||||
label: Preliminary Checks
|
||||
options:
|
||||
- label: I am using a **recent version** of the project.
|
||||
required: true
|
||||
- label: I have **read the [FAQ section](https://github.com/aunetx/deezer-linux?tab=readme-ov-file#faq)** of the documentation.
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: description
|
||||
attributes:
|
||||
label: Short Description
|
||||
description: A concise description of the bug.
|
||||
placeholder: "e.g., Application crashes when launched with --example-flag"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: reproduction
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: List the precise steps to reproduce the issue.
|
||||
placeholder: |
|
||||
1. Run '...'
|
||||
2. Click on '...'
|
||||
3. Observe '...'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: observed
|
||||
attributes:
|
||||
label: Observed Behavior
|
||||
description: Describe what actually happened.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: expected
|
||||
attributes:
|
||||
label: Expected Behavior
|
||||
description: Describe what you expected to happen instead.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: environment-os
|
||||
attributes:
|
||||
label: Operating System
|
||||
description: |
|
||||
Please provide the results of the following command:
|
||||
```bash
|
||||
lsb_release -a ; uname -mr
|
||||
```
|
||||
placeholder: |
|
||||
e.g.
|
||||
Distributor ID: Ubuntu
|
||||
Description: Ubuntu 22.04.1 LTS
|
||||
Release: 22.04
|
||||
Codename: jammy
|
||||
6.7.0-26-generic x86_64
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: environment-version
|
||||
attributes:
|
||||
label: Project Version and Package
|
||||
description: |
|
||||
Please provide information about the package version and architecture.
|
||||
|
||||
For flatpak users, you can find this information with:
|
||||
```bash
|
||||
flatpak info dev.aunetx.deezer
|
||||
```
|
||||
For snap users, you can find this information with:
|
||||
```bash
|
||||
snap list deezer-desktop
|
||||
```
|
||||
placeholder: "e.g. deezer-desktop-7.0.110-arm64.AppImage"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: environment-env
|
||||
attributes:
|
||||
label: Environment Variables
|
||||
description: |
|
||||
It is highly recommended to fill this section if your issue is related to running or logging into the app.
|
||||
|
||||
You may provide a **redacted** version of the following command:
|
||||
```bash
|
||||
env
|
||||
```
|
||||
Make sure to remove any sensitive or private data.
|
||||
placeholder: |
|
||||
e.g.
|
||||
PATH=/usr/bin:...
|
||||
HOME=/home/<redacted>
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: extra
|
||||
attributes:
|
||||
label: Additional Information (Optional)
|
||||
description: |
|
||||
Any additional context, logs, screenshots, or configuration details that could help us investigate the issue.
|
||||
render: markdown
|
||||
validations:
|
||||
required: false
|
12
.github/workflows/build-artifacts.yml
vendored
12
.github/workflows/build-artifacts.yml
vendored
@ -14,10 +14,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
- name: prepare runner
|
||||
run: |
|
||||
sudo snap install snapcraft --classic
|
||||
node-version: 20
|
||||
|
||||
- name: install_deps
|
||||
run: make install_deps
|
||||
@ -28,8 +25,6 @@ jobs:
|
||||
run: make build_rpm_x64
|
||||
- name: build_appimage_x64
|
||||
run: make build_appimage_x64
|
||||
- name: build_snap_x64
|
||||
run: make build_snap_x64
|
||||
- name: build_tar.xz_x64
|
||||
run: make build_tar.xz_x64
|
||||
|
||||
@ -39,8 +34,6 @@ jobs:
|
||||
run: make build_rpm_arm64
|
||||
- name: build_appimage_arm64
|
||||
run: make build_appimage_arm64
|
||||
# - name: build_snap_arm64 # This step is currently disabled due to issues with snapcraft + arm64 on github runners
|
||||
# run: make build_snap_arm64
|
||||
- name: build_tar.xz_arm64
|
||||
run: make build_tar.xz_arm64
|
||||
|
||||
@ -48,7 +41,7 @@ jobs:
|
||||
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Generate sha256
|
||||
run: echo "$(sha256sum artifacts/{x64,arm64}/*.{deb,rpm,AppImage,tar.xz} artifacts/x64/*.snap)" > sha256
|
||||
run: echo "$(sha256sum artifacts/{x64,arm64}/*.{deb,rpm,AppImage,tar.xz})" > sha256
|
||||
|
||||
- name: create release
|
||||
uses: softprops/action-gh-release@v2
|
||||
@ -60,7 +53,6 @@ jobs:
|
||||
artifacts/x64/*.deb
|
||||
artifacts/x64/*.rpm
|
||||
artifacts/x64/*.AppImage
|
||||
artifacts/x64/*.snap
|
||||
artifacts/x64/*.tar.xz
|
||||
artifacts/arm64/*.deb
|
||||
artifacts/arm64/*.rpm
|
||||
|
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
node-version: 20
|
||||
|
||||
- name: install_deps
|
||||
run: make install_deps
|
||||
|
13
.gitignore
vendored
13
.gitignore
vendored
@ -1,8 +1,9 @@
|
||||
source/
|
||||
node_modules/
|
||||
flatpak/
|
||||
app/
|
||||
artifacts/
|
||||
.vscode/
|
||||
node_modules
|
||||
flatpak
|
||||
source
|
||||
app
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
artifacts
|
||||
package.json
|
||||
.vscode/launch.json
|
||||
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "es5",
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"arrowParens": "always"
|
||||
}
|
@ -36,7 +36,7 @@ By participating in this project, you agree to maintain a respectful and inclusi
|
||||
|
||||
Ensure you have all required dependencies:
|
||||
|
||||
- Node.js (22 recommended)
|
||||
- Node.js (20 recommended)
|
||||
- npm
|
||||
- 7z
|
||||
- make
|
||||
@ -63,21 +63,12 @@ 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, make sure that the only files you modified are the ones you want to include in the patch. You can check this by running:
|
||||
|
||||
```sh
|
||||
git status
|
||||
```
|
||||
|
||||
Then, generate the patch:
|
||||
When you are done, commit your changes, and then generate the patch:
|
||||
|
||||
```sh
|
||||
make patch-gen
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> This command will take care of pretty printing your patch and creating a patch file.
|
||||
|
||||
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]
|
||||
|
27
Makefile
27
Makefile
@ -13,7 +13,8 @@ PACKAGE_MANAGER_INSTALL_CMD ?= install
|
||||
PACKAGE_MANAGER_ADD_CMD ?= install
|
||||
|
||||
install_build_deps:
|
||||
@$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_INSTALL_CMD)
|
||||
@$(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_DIR)
|
||||
@ -31,11 +32,10 @@ prepare: clean install_build_deps
|
||||
@cd $(SOURCE_DIR) && 7z x -y -bsp0 -bso0 app-32.7z
|
||||
|
||||
@echo "Extract app sources from the app"
|
||||
@npm run asar extract "$(SOURCE_DIR)/resources/app.asar" "$(APP_DIR)"
|
||||
@node_modules/@electron/asar/bin/asar.js extract $(SOURCE_DIR)/resources/app.asar $(APP_DIR)
|
||||
|
||||
@echo "Prettier the sources to patch successfully"
|
||||
@cp .prettierrc.json $(APP_DIR)/
|
||||
@npm run prettier -- --write "$(APP_DIR)/build/*.{js,html}" --config .prettierrc.json --ignore-path /dev/null
|
||||
@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)"
|
||||
@ -44,15 +44,11 @@ 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 environment variable to change log level (https://github.com/aunetx/deezer-linux/pull/95)"
|
||||
@echo "08 - Provide additional metadata (https://github.com/aunetx/deezer-linux/pull/95)"
|
||||
@echo "09 - Add Discord Rich Presence (https://github.com/aunetx/deezer-linux/pull/82)"
|
||||
@echo "10 - Improve responsiveness on small devices (https://github.com/aunetx/deezer-linux/pull/122)"
|
||||
@echo "11 - Hide Application is offline banner (https://github.com/aunetx/deezer-linux/pull/124)"
|
||||
@echo "12 - Disable animations (https://github.com/aunetx/deezer-linux/pull/133)"
|
||||
@echo "13 - Disable notifications (https://github.com/aunetx/deezer-linux/pull/151)"
|
||||
|
||||
@$(foreach p, $(wildcard ./patches/*), patch -p 1 -d $(APP_DIR) < $(p);)
|
||||
@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)"
|
||||
@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"
|
||||
@ -120,9 +116,6 @@ patch-new: install_deps
|
||||
@echo "Don't forget to rename your patch."
|
||||
|
||||
patch-gen:
|
||||
@npm run prettier -- --write "$(APP_DIR)/build/*.{js,html}" --config .prettierrc.json --ignore-path /dev/null
|
||||
@cd $(APP_DIR) && git add .
|
||||
@cd $(APP_DIR) && git commit
|
||||
@cd $(APP_DIR) && git format-patch -1 HEAD --stdout > ../patches/$(shell date +%y%m%d-%s).patch
|
||||
|
||||
#! UTILS
|
||||
@ -143,4 +136,4 @@ release: prepare-release
|
||||
|
||||
|
||||
clean:
|
||||
@rm -rf ./$(APP_DIR) flatpak node_modules ./$(SOURCE_DIR) artifacts package-lock.json yarn.lock
|
||||
@rm -rf ./$(APP_DIR) flatpak node_modules ./$(SOURCE_DIR) artifacts package.json
|
||||
|
72
README.md
72
README.md
@ -9,7 +9,6 @@ It packages the app in a number of formats:
|
||||
|
||||
- Flatpak, [available on flathub](https://flathub.org/apps/dev.aunetx.deezer)
|
||||
- AppImage
|
||||
- Snapcraft
|
||||
- `rpm` (Fedora, Red Hat, CentOS, openSUSE, ...)
|
||||
- `deb` (Debian, Ubuntu, Pop!\_OS, elementary OS, ...)
|
||||
- `tar.xz` to install anywhere else
|
||||
@ -37,25 +36,17 @@ Other packages can be installed from you package manager, either by clicking on
|
||||
|
||||
## Usage
|
||||
|
||||
| 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)) |
|
||||
| `--keep-kernel` | Use the exact kernel version (see [patch](./patches/05-remove-os-information.patch)) <br/> _This feature impacts privacy._ |
|
||||
| `--disable-features` | Disable some features (see [patch](./patches/06-better-management-of-MPRIS.patch)) |
|
||||
| `--enable-discord-rpc` | Enable Discord RPC integration (see [patch](./patches/09-discord-rich-presence.patch)) |
|
||||
| `--hide-appoffline-banner` | Hide the "Application is offline" banner that appears when using a VPN or DNS blocker (see [patch](./patches/11-hide-appoffline-banner.patch)) |
|
||||
| `--disable-animations` | Disable animations (see [patch](./patches/12-disable-animations.patch)) |
|
||||
| `--disable-notifications` | Disable notifications (see [patch](./patches/13-disable-notifications.patch)) |
|
||||
| `--enable-wayland-ime` `--ozone-platform-hint=auto` `--wayland-text-input-version=3` | Enable IME keyboard support on Wayland |
|
||||
| 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)) |
|
||||
| `--enable-discord-rpc` | Enable Discord RPC integration (see [patch](./patches/08-discord-rich-presence-disable.patch)) |
|
||||
|
||||
| Environment variable | Options | Description |
|
||||
| --------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| `DZ_HIDE_APPOFFLINE_BANNER` | `yes`,`no` | Hide the "Application is offline" banner (see [patch](./patches/11-hide-appoffline-banner.patch)) |
|
||||
| `DZ_DISABLE_ANIMATIONS` | `yes`,`no` | Disable animations (see [patch](./patches/12-disable-animations.patch)) |
|
||||
| `DZ_DISABLE_NOTIFICATIONS` | `yes`,`no` | Disable notifications (see [patch](./patches/13-disable-notifications.patch)) |
|
||||
| `LOG_LEVEL` | `silly`,`debug`,`verbose`,`info`,`warning`,`error` | Set the log level (see [patch](./patches/07-log-level-environment-variable.patch)) |
|
||||
| `DZ_DEVTOOLS` | `yes`,`no` | Enable the developer console (ctrl+shift+i) |
|
||||
| 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
|
||||
|
||||
@ -67,16 +58,16 @@ Other packages can be installed from you package manager, either by clicking on
|
||||
| deb | ⚠️ | ✅ |
|
||||
| rpm | ⚠️ | ✅ |
|
||||
| tar.xz | ⚠️ | ✅ |
|
||||
| snap | ⚠️ | ✅ |
|
||||
| snap | ⛔ | ⛔ |
|
||||
|
||||
✅ Available ; ⚠️ Not tested ; ❌ Not available ; ⛔ Not planned
|
||||
✅ Available ; ⚠️ Not tested ; ❌ Not available ; ⛔ Not planned (see [FAQ](#faq))
|
||||
|
||||
> [!NOTE]
|
||||
> Please open an issue if you want a specific target to be tested or added.
|
||||
> Please open an issue if you want a specific target to be added.
|
||||
|
||||
### Requirements
|
||||
|
||||
- Node.js (22+ recommended)
|
||||
- Node.js (20 recommended)
|
||||
- npm (or yarn, see [FAQ](#i-want-to-use-yarn-instead-of-npm-is-it-possible))
|
||||
- 7z (try installing `p7zip` and `p7zip-full`)
|
||||
- make
|
||||
@ -140,25 +131,6 @@ Artifacts will be generated in `artifacts/{arch}`.
|
||||
|
||||
If you generate the `tar.xz` package, you can run it directly by extracting to a directory, and calling `./deezer-desktop` from there.
|
||||
|
||||
### snap
|
||||
|
||||
To build the `snap` package, you can use:
|
||||
|
||||
```sh
|
||||
make build_snap_{arch}
|
||||
```
|
||||
|
||||
Then, you can install the package using:
|
||||
|
||||
```sh
|
||||
sudo snap install ./artifacts/{arch}/deezer_desktop_{version}_{arch}.snap --dangerous --classic
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Snap packages require classic mode because of electron.
|
||||
> Because of this, it is not able to use your usual browser.
|
||||
> It will launch a clean instance of the browser, without extensions, settings, history, etc.
|
||||
|
||||
## Development
|
||||
|
||||
If you want to contribute to this project, please read the [contribution guidelines](CONTRIBUTING.md) file.
|
||||
@ -169,7 +141,11 @@ If you want to contribute to this project, please read the [contribution guideli
|
||||
|
||||
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 are the patches published but not the app's source code? patches?
|
||||
### 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 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.
|
||||
|
||||
@ -184,16 +160,6 @@ export PACKAGE_MANAGER_ADD_CMD=add
|
||||
export PACKAGE_MANAGER_INSTALL_CMD=install
|
||||
```
|
||||
|
||||
### How can I use my IME/virtual keyboard on Deezer under Wayland?
|
||||
|
||||
_IME: Input Method Editor. Usually used for languages like Chinese, Japanese, Korean, etc._
|
||||
|
||||
You should launch the app with the following arguments:
|
||||
|
||||
```sh
|
||||
--enable-wayland-ime --ozone-platform-hint=auto --wayland-text-input-version=3
|
||||
```
|
||||
|
||||
## **LEGAL DISCLAIMER**
|
||||
|
||||
This work is UNOFFICIAL. Deezer does not officially support Linux and cannot be held responsible for any misuse of this port.
|
||||
|
@ -4,15 +4,12 @@ Name=Deezer
|
||||
GenericName=Online music streaming service
|
||||
Comment=Listen and download all your favorite music
|
||||
StartupNotify=true
|
||||
Icon=dev.aunetx.deezer.svg
|
||||
Icon=dev.aunetx.deezer
|
||||
TryExec=run.sh
|
||||
Exec=run.sh %U
|
||||
Terminal=false
|
||||
MimeType=x-scheme-handler/deezer;
|
||||
Categories=Audio;Music;Player;AudioVideo;
|
||||
Keywords=Music;Player;Streaming;Online;
|
||||
StartupWMClass=Deezer
|
||||
SingleMainWindow=true
|
||||
X-GNOME-UsesNotifications=true
|
||||
|
||||
# Used by flatpak/flathub
|
||||
Exec=run.sh %U
|
||||
TryExec=run.sh
|
@ -6,8 +6,8 @@
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://cdn-content.dzcdn.net/builds/deezer-desktop/8cF2rAuKxLcU1oMDmCYm8Uiqe19Ql0HTySLssdzLkQ9ZWHuDTp2JBtQOvdrFzWPA/win32/x86/7.0.120/DeezerDesktopSetup_7.0.120.exe",
|
||||
"sha256": "8d4bc1f458b28899c222e4e3a04aad6ed11e318f4ee4922e698721e69a7b20f2",
|
||||
"url": "https://cdn-content.dzcdn.net/builds/deezer-desktop/8cF2rAuKxLcU1oMDmCYm8Uiqe19Ql0HTySLssdzLkQ9ZWHuDTp2JBtQOvdrFzWPA/win32/x86/7.0.31/DeezerDesktopSetup_7.0.31.exe",
|
||||
"sha256": "d9625667cd24060180c0545800140bf0d5c3fce436eba866ae9969757c0cf8a1",
|
||||
"only-arches": [
|
||||
"x86_64"
|
||||
],
|
||||
|
@ -17,8 +17,8 @@
|
||||
"build-appimage-arm64": "electron-builder --arm64 --linux AppImage"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "^35.0.0",
|
||||
"electron-builder": "^26.0.0"
|
||||
"electron": "^33.2.0",
|
||||
"electron-builder": "^23.0.3"
|
||||
},
|
||||
"build": {
|
||||
"files": ["**"],
|
||||
@ -41,63 +41,20 @@
|
||||
"linux": {
|
||||
"maintainer": "aunetx <me@aunetx.dev>",
|
||||
"icon": "../icons",
|
||||
"category": "AudioVideo;Audio;Player;Music;",
|
||||
"category": "Utility;AudioVideo;Audio;Player;Music;",
|
||||
"desktop": {
|
||||
"entry": {
|
||||
"Type": "Application",
|
||||
"Name": "Deezer",
|
||||
"GenericName": "Online music streaming service",
|
||||
"Comment": "Listen and download all your favorite music",
|
||||
"StartupNotify": "true",
|
||||
"Terminal": "false",
|
||||
"MimeType": "x-scheme-handler/deezer;",
|
||||
"Categories": "Audio;Music;Player;AudioVideo;",
|
||||
"Keywords": "Music;Player;Streaming;Online;",
|
||||
"StartupWMClass": "Deezer",
|
||||
"SingleMainWindow": "true",
|
||||
"X-GNOME-UsesNotifications": "true"
|
||||
}
|
||||
"Name": "Deezer",
|
||||
"Type": "Application",
|
||||
"GenericName": "Online music streaming service",
|
||||
"Comment": "Listen and download all your favorite music",
|
||||
"MimeType": "x-scheme-handler/deezer;",
|
||||
"Keywords": "Music;Player;Streaming;Online;",
|
||||
"StartupWMClass": "Deezer"
|
||||
},
|
||||
"artifactName": "${productName}-${version}-${arch}.${ext}"
|
||||
},
|
||||
"snap": {
|
||||
"artifactName": "${productName}_${version}_${arch}.${ext}",
|
||||
"publish": [
|
||||
{
|
||||
"provider": "generic",
|
||||
"url": "https://null/"
|
||||
}
|
||||
],
|
||||
"base": "core22",
|
||||
"grade": "stable",
|
||||
"confinement": "classic",
|
||||
"after": ["desktop-gtk4", "libnotify-bin"],
|
||||
"slots": [
|
||||
{
|
||||
"mpris": {
|
||||
"name": "deezer"
|
||||
},
|
||||
"desktop": {
|
||||
"name": "deezer"
|
||||
}
|
||||
}
|
||||
],
|
||||
"plugs": [
|
||||
"desktop",
|
||||
"desktop-legacy",
|
||||
"wayland",
|
||||
"x11",
|
||||
"unity7",
|
||||
"alsa",
|
||||
"avahi-observe",
|
||||
"browser-support",
|
||||
"gsettings",
|
||||
"network",
|
||||
"opengl",
|
||||
"audio-playback",
|
||||
"screen-inhibit-control",
|
||||
"upower-observe"
|
||||
]
|
||||
"artifactName": "${productName}_${version}_${arch}.${ext}"
|
||||
},
|
||||
"deb": {
|
||||
"artifactName": "${productName}_${version}_${arch}.${ext}"
|
||||
|
10
package.json
10
package.json
@ -1,10 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@electron/asar": "3.4.1",
|
||||
"prettier": "3.5.3"
|
||||
},
|
||||
"scripts": {
|
||||
"asar": "asar",
|
||||
"prettier": "prettier"
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
From 7e317aa696aa2c1a69f2df0e4d7bb3b3df41d4df Mon Sep 17 00:00:00 2001
|
||||
From 9c19490f706350a2ca8cceae7a998916d21de89b Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
Date: Mon, 21 Apr 2025 00:37:21 +0900
|
||||
Date: Sun, 19 Jan 2025 22:59:38 +0100
|
||||
Subject: [PATCH] fix: reduce to systray on close
|
||||
|
||||
Original patch: Dorian Stoll <dorian.stoll@tmsp.io>
|
||||
@ -8,14 +8,14 @@ This stops the excessive logging, since parts of the app will not run in develop
|
||||
mode anymore. It also stops the app from logging the urls for the mp3 files, which is
|
||||
against the Deezer TOS.
|
||||
---
|
||||
build/main.js | 24 ++++++++++++------------
|
||||
1 file changed, 12 insertions(+), 12 deletions(-)
|
||||
build/main.js | 11 +++++++----
|
||||
1 file changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index 7349ee9..9284b6b 100644
|
||||
index c15e2c3..b883a28 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -3097,24 +3097,24 @@
|
||||
@@ -3085,10 +3085,13 @@
|
||||
finalMinSize[1]
|
||||
);
|
||||
}
|
||||
@ -23,35 +23,16 @@ index 7349ee9..9284b6b 100644
|
||||
- ? this.window.showInactive()
|
||||
- : this.window.show(),
|
||||
- this.thumbar.init();
|
||||
+ if (!process.argv.some((arg) => arg === "--start-in-tray"))
|
||||
+ 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();
|
||||
+ else
|
||||
+ this.window.hide();
|
||||
}),
|
||||
this.appService.enableDevMode();
|
||||
}
|
||||
_adjustViewToContentSize() {
|
||||
if (!this.isFrameless) return;
|
||||
const currentSize = this.window.getContentSize();
|
||||
- this.appService
|
||||
- .getViewContainer()
|
||||
- .setBounds({
|
||||
- x: 0,
|
||||
- y: 32,
|
||||
- width: currentSize[0],
|
||||
- height: currentSize[1] - 32,
|
||||
- });
|
||||
+ this.appService.getViewContainer().setBounds({
|
||||
+ x: 0,
|
||||
+ y: 32,
|
||||
+ width: currentSize[0],
|
||||
+ height: currentSize[1] - 32,
|
||||
+ });
|
||||
}
|
||||
loadWindow() {
|
||||
const report = () => {
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
From 3255d0db5760601c9a16fb4b175085cc40b27df2 Mon Sep 17 00:00:00 2001
|
||||
From e45c184e8c23aa72f77767c09e6051363806b5f5 Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
Date: Mon, 21 Apr 2025 00:47:43 +0900
|
||||
Date: Sun, 19 Jan 2025 23:18:25 +0100
|
||||
Subject: [PATCH] fix: unset text/html as default mimetype
|
||||
|
||||
---
|
||||
@ -8,10 +8,10 @@ Subject: [PATCH] fix: unset text/html as default mimetype
|
||||
1 file changed, 1 insertion(+), 6 deletions(-)
|
||||
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index 9284b6b..9623b50 100644
|
||||
index b883a28..60117e3 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -2851,12 +2851,7 @@
|
||||
@@ -2854,12 +2854,7 @@
|
||||
this.tray.init(),
|
||||
this.updater.init(),
|
||||
this.network.watch(),
|
||||
|
@ -1,6 +1,6 @@
|
||||
From 4dbe17674fef2f48b638cd4dc164b66042d03213 Mon Sep 17 00:00:00 2001
|
||||
From ef715c38d754bbed026a4e6c3e9cae0180eeeb4b Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
Date: Mon, 21 Apr 2025 00:50:26 +0900
|
||||
Date: Sun, 19 Jan 2025 23:27:32 +0100
|
||||
Subject: [PATCH] fix: reduce to systray on close with respect to execution
|
||||
option
|
||||
|
||||
@ -9,17 +9,17 @@ Subject: [PATCH] fix: reduce to systray on close with respect to execution
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index 9623b50..c904158 100644
|
||||
index 60117e3..9ea7c18 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -3049,7 +3049,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(
|
||||
|
@ -1,24 +1,25 @@
|
||||
From 7a0b04d742ca93adcf73c0d520e877f0c4bef6d4 Mon Sep 17 00:00:00 2001
|
||||
From 864e07d4bac769cbc077a4a3d50a431f2158080c Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
Date: Mon, 21 Apr 2025 00:54:17 +0900
|
||||
Date: Mon, 20 Jan 2025 00:46:23 +0100
|
||||
Subject: [PATCH] fix: disable autoupdater for linux
|
||||
|
||||
---
|
||||
build/main.js | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
build/main.js | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index c904158..a667632 100644
|
||||
index 9ea7c18..10a80fa 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -2320,8 +2320,8 @@
|
||||
@@ -2322,9 +2322,8 @@
|
||||
}
|
||||
}
|
||||
init() {
|
||||
this.arch &&
|
||||
- this.arch &&
|
||||
- ((isPlatform(PLATFORM.LINUX) && !process.env.APPIMAGE) ||
|
||||
- isWindowsStore() ||
|
||||
+ !isPlatform(PLATFORM.LINUX) &&
|
||||
+ (isWindowsStore() ||
|
||||
+ this.arch && !isPlatform(PLATFORM.LINUX) && (
|
||||
+ isWindowsStore() ||
|
||||
"yes" === process.env.DZ_DISABLE_UPDATE ||
|
||||
((external_electron_updater_namespaceObject.autoUpdater.autoDownload =
|
||||
!0),
|
||||
|
@ -1,8 +1,7 @@
|
||||
From 9250fb3bf514256f68ad844b53e7345b2efc4b37 Mon Sep 17 00:00:00 2001
|
||||
From 08ea86075592efe9c02c4beb7cbdfc6935ca0b1c Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
Date: Mon, 21 Apr 2025 01:08:23 +0900
|
||||
Subject: [PATCH] fix: ensure os release is valid; add cli argument to use
|
||||
exact kernel version
|
||||
Date: Fri, 24 Jan 2025 16:03:43 +0100
|
||||
Subject: [PATCH] fix: ensure os release is valid
|
||||
|
||||
Original patch: Dorian Stoll <dorian.stoll@tmsp.io>
|
||||
The application sends the kernel version as part of the User-Agent.
|
||||
@ -15,17 +14,17 @@ 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 | 12 +++++++++++-
|
||||
build/preload.js | 12 +++++++++++-
|
||||
build/renderer.js | 12 +++++++++++-
|
||||
build/titlebar.js | 12 +++++++++++-
|
||||
4 files changed, 44 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 a667632..e03556c 100644
|
||||
index 10a80fa..9219f4f 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -5,7 +5,17 @@
|
||||
@@ -5,7 +5,16 @@
|
||||
module.exports = require("macos-version");
|
||||
},
|
||||
857: (module) => {
|
||||
@ -33,22 +32,21 @@ index a667632..e03556c 100644
|
||||
+ var __module_os = require("os");
|
||||
+ const release = __module_os.release();
|
||||
+ __module_os.release = () => {
|
||||
+ if (!process.argv.some((arg) => arg === "--keep-kernel"))
|
||||
+ return "6.1.0";
|
||||
+
|
||||
+ const matcher = /(\d+\.\d+\.\d+)\.*/;
|
||||
+ const matcher = /(\d+\.\d+\.\d+)\.*/
|
||||
+ var result = release.match(matcher);
|
||||
+ return result ? result[1] : "6.1.0";
|
||||
+ };
|
||||
+ //if (result[1])
|
||||
+ // return result[1];
|
||||
+ return "6.1.0";
|
||||
+ }
|
||||
+ module.exports = __module_os;
|
||||
},
|
||||
},
|
||||
__webpack_module_cache__ = {};
|
||||
diff --git a/build/preload.js b/build/preload.js
|
||||
index 4029c6d..f625122 100644
|
||||
index 9716411..ec603d0 100644
|
||||
--- a/build/preload.js
|
||||
+++ b/build/preload.js
|
||||
@@ -5,7 +5,17 @@
|
||||
@@ -5,7 +5,15 @@
|
||||
module.exports = require("macos-version");
|
||||
},
|
||||
857: (module) => {
|
||||
@ -56,22 +54,20 @@ index 4029c6d..f625122 100644
|
||||
+ var __module_os = require("os");
|
||||
+ const release = __module_os.release();
|
||||
+ __module_os.release = () => {
|
||||
+ if (!process.argv.some((arg) => arg === "--keep-kernel"))
|
||||
+ return "6.1.0";
|
||||
+
|
||||
+ const matcher = /(\d+\.\d+\.\d+)\.*/;
|
||||
+ var result = release.match(matcher);
|
||||
+ return result ? result[1] : "6.1.0";
|
||||
+ //if (result[1]) return result[1];
|
||||
+ return "6.1.0";
|
||||
+ };
|
||||
+ module.exports = __module_os;
|
||||
},
|
||||
},
|
||||
__webpack_module_cache__ = {};
|
||||
diff --git a/build/renderer.js b/build/renderer.js
|
||||
index ca6c307..24b119f 100644
|
||||
index 7241bcb..fb02453 100644
|
||||
--- a/build/renderer.js
|
||||
+++ b/build/renderer.js
|
||||
@@ -5,7 +5,17 @@
|
||||
@@ -5,7 +5,15 @@
|
||||
module.exports = require("macos-version");
|
||||
},
|
||||
857: (module) => {
|
||||
@ -79,22 +75,20 @@ index ca6c307..24b119f 100644
|
||||
+ var __module_os = require("os");
|
||||
+ const release = __module_os.release();
|
||||
+ __module_os.release = () => {
|
||||
+ if (!process.argv.some((arg) => arg === "--keep-kernel"))
|
||||
+ return "6.1.0";
|
||||
+
|
||||
+ const matcher = /(\d+\.\d+\.\d+)\.*/;
|
||||
+ var result = release.match(matcher);
|
||||
+ return result ? result[1] : "6.1.0";
|
||||
+ //if (result[1]) return result[1];
|
||||
+ return "6.1.0";
|
||||
+ };
|
||||
+ module.exports = __module_os;
|
||||
},
|
||||
},
|
||||
__webpack_module_cache__ = {};
|
||||
diff --git a/build/titlebar.js b/build/titlebar.js
|
||||
index 5414c90..4f3c6a3 100644
|
||||
index 65520fb..7919288 100644
|
||||
--- a/build/titlebar.js
|
||||
+++ b/build/titlebar.js
|
||||
@@ -5,7 +5,17 @@
|
||||
@@ -5,7 +5,16 @@
|
||||
module.exports = require("macos-version");
|
||||
},
|
||||
857: (module) => {
|
||||
@ -102,13 +96,12 @@ index 5414c90..4f3c6a3 100644
|
||||
+ var __module_os = require("os");
|
||||
+ const release = __module_os.release();
|
||||
+ __module_os.release = () => {
|
||||
+ if (!process.argv.some((arg) => arg === "--keep-kernel"))
|
||||
+ return "6.1.0";
|
||||
+
|
||||
+ const matcher = /(\d+\.\d+\.\d+)\.*/;
|
||||
+ const matcher = /(\d+\.\d+\.\d+)\.*/
|
||||
+ var result = release.match(matcher);
|
||||
+ return result ? result[1] : "6.1.0";
|
||||
+ };
|
||||
+ //if (result[1])
|
||||
+ // return result[1];
|
||||
+ return "6.1.0";
|
||||
+ }
|
||||
+ module.exports = __module_os;
|
||||
},
|
||||
},
|
||||
|
@ -1,18 +1,18 @@
|
||||
From a808839d950d6f4ad50763d7255a7edbbd32e516 Mon Sep 17 00:00:00 2001
|
||||
From 16026d3b586904af7d8ca32248abe0be9eddaa84 Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
Date: Mon, 21 Apr 2025 01:43:50 +0900
|
||||
Subject: [PATCH] fix: add better management of MPRIS
|
||||
Date: Fri, 31 Jan 2025 11:55:37 +0100
|
||||
Subject: [PATCH] fix: update deps for mpris patch - @jellybrick/mpris-service
|
||||
|
||||
---
|
||||
build/main.js | 65 +++++++++++++++++++++++++++++++++++++++++++--------
|
||||
build/main.js | 72 ++++++++++++++++++++++++++++++++++++++++++---------
|
||||
package.json | 1 +
|
||||
2 files changed, 56 insertions(+), 10 deletions(-)
|
||||
2 files changed, 61 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index e03556c..1878712 100644
|
||||
index 9219f4f..34be768 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -89,6 +89,10 @@
|
||||
@@ -88,6 +88,10 @@
|
||||
external_semver_default = __webpack_require__.n(
|
||||
external_semver_namespaceObject
|
||||
);
|
||||
@ -23,7 +23,7 @@ index e03556c..1878712 100644
|
||||
function isPlatform(platform) {
|
||||
switch (platform) {
|
||||
case PLATFORM.WINDOWS:
|
||||
@@ -1187,8 +1191,9 @@
|
||||
@@ -1188,8 +1192,9 @@
|
||||
};
|
||||
};
|
||||
let MediaService = class extends external_events_namespaceObject.EventEmitter {
|
||||
@ -34,52 +34,50 @@ index e03556c..1878712 100644
|
||||
(this.smtc = null),
|
||||
(this.track = {}),
|
||||
(this.player = {}),
|
||||
@@ -1196,6 +1201,11 @@
|
||||
@@ -1197,6 +1202,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"],
|
||||
+ name: 'deezer',
|
||||
+ identity: 'Deezer',
|
||||
+ supportedInterfaces: ['player']
|
||||
+ })),
|
||||
isPlatform(PLATFORM.LINUX) &&
|
||||
(this.user.addListener(UserEvents.LoggedIn, () => {
|
||||
this.start();
|
||||
@@ -1203,6 +1213,21 @@
|
||||
@@ -1204,6 +1214,19 @@
|
||||
this.user.addListener(UserEvents.LoggedOut, () => {
|
||||
this.stop();
|
||||
}));
|
||||
+ this.initMprisPlayerControls();
|
||||
+ }
|
||||
+ 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());
|
||||
+ 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);
|
||||
@@ -1230,11 +1255,22 @@
|
||||
@@ -1231,11 +1254,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],
|
||||
+ '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) {
|
||||
@ -87,13 +85,14 @@ index e03556c..1878712 100644
|
||||
- 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);
|
||||
+ this.player.state === 'playing'
|
||||
+ ? external_electron_mpris_namespaceObject.PLAYBACK_STATUS_PLAYING
|
||||
+ : external_electron_mpris_namespaceObject.PLAYBACK_STATUS_PAUSED
|
||||
+ );
|
||||
}
|
||||
getTrackInfo() {
|
||||
return this.track;
|
||||
@@ -1294,7 +1330,11 @@
|
||||
@@ -1295,7 +1330,11 @@
|
||||
1,
|
||||
(0, external_inversify_namespaceObject.inject)(SERVICE_USER)
|
||||
),
|
||||
@ -106,7 +105,7 @@ index e03556c..1878712 100644
|
||||
],
|
||||
MediaService
|
||||
);
|
||||
@@ -2732,15 +2772,16 @@
|
||||
@@ -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);
|
||||
@ -114,34 +113,39 @@ index e03556c..1878712 100644
|
||||
- "channel-player-state-update",
|
||||
- external_lodash_debounce_default()((event, state) => {
|
||||
- media.setPlayerInfo({ state }),
|
||||
+ 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();
|
||||
- state === MediaPlayerState.Playing
|
||||
- ? powerSave.start()
|
||||
- : powerSave.stop();
|
||||
- }, 3e3)
|
||||
- ),
|
||||
+ }, 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",
|
||||
(event, track, player) => {
|
||||
@@ -2827,6 +2868,10 @@
|
||||
@@ -2828,6 +2873,9 @@
|
||||
"autoplay-policy",
|
||||
"no-user-gesture-required"
|
||||
),
|
||||
+ external_electron_namespaceObject.app.commandLine.appendSwitch(
|
||||
+ "disable-features",
|
||||
+ "HardwareMediaKeyHandling"
|
||||
+ "disable-features", "HardwareMediaKeyHandling"
|
||||
+ ),
|
||||
external_electron_namespaceObject.app.on(
|
||||
"second-instance",
|
||||
(event, argv) => {
|
||||
diff --git a/package.json b/package.json
|
||||
index cec017c..2182f77 100644
|
||||
index 290f49a..394b4f4 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -13,6 +13,7 @@
|
||||
@ -151,7 +155,7 @@ index cec017c..2182f77 100644
|
||||
+ "@jellybrick/mpris-service": "2.1.5",
|
||||
"electron-log": "^5.1.2",
|
||||
"electron-settings": "4.0.4",
|
||||
"electron-updater": "^6.3.9",
|
||||
"electron-updater": "^6.1.8",
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
97
patches/07-discord-rich-presence.patch
Normal file
97
patches/07-discord-rich-presence.patch
Normal file
@ -0,0 +1,97 @@
|
||||
From dac6e3d0e3ca49ef6f123a6f6595cd37578913be Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
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
|
||||
|
@ -1,42 +0,0 @@
|
||||
From 5cc1a232e85c96163cba700321df9079ea4e4379 Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
Date: Wed, 14 May 2025 14:55:20 +0900
|
||||
Subject: [PATCH] fix: set default log level to "warn" to respect Deezer TOS;
|
||||
control log level from environment variable
|
||||
|
||||
Original patch: Dorian Stoll <dorian.stoll@tmsp.io>
|
||||
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 | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index eabc5e1..485b953 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -3305,12 +3305,14 @@
|
||||
processType: isProcessMain() ? "main" : process.type,
|
||||
}),
|
||||
(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"
|
||||
- : "warn"),
|
||||
- (external_electron_log_default().transports.file.level = isDev
|
||||
- ? "silly"
|
||||
- : "warn"),
|
||||
+ (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({ isPackaged: true }) || !process.env.LOG_LEVEL
|
||||
+ ? process.env.LOG_LEVEL
|
||||
+ : "warn"),
|
||||
(external_electron_log_default().transports.sentry = function (msg) {
|
||||
"error" === msg.level &&
|
||||
(msg.data[0] instanceof Error
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,184 +0,0 @@
|
||||
From 89a8e44da29ae59e04adf7122374be4f621ec2ee Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
Date: Wed, 23 Jul 2025 20:36:49 +0200
|
||||
Subject: [PATCH] feat: provide additional information to mpris (and future
|
||||
patches)
|
||||
|
||||
---
|
||||
build/main.js | 42 +++++++++++++++++++++++++---------------
|
||||
build/renderer.js | 49 +++++++++++++++++++++++++++++++----------------
|
||||
2 files changed, 60 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index 82f5c11..8332c3a 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -1253,18 +1253,24 @@
|
||||
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 = {
|
||||
+ ...(data?.trackInfo?.song?.DURATION && {
|
||||
+ "mpris:length": data.trackInfo.song.DURATION * 1000,
|
||||
+ }),
|
||||
"mpris:trackid": this.mprisPlayer.objectPath("track/0"),
|
||||
"mpris:artUrl": track.coverUrl,
|
||||
"xesam:title": track.title,
|
||||
"xesam:album": track.album,
|
||||
"xesam:artist": [track.artist],
|
||||
+ ...(data?.trackInfo?.song?.SNG_ID && {
|
||||
+ "xesam:url": `https://deezer.com/track/${data.trackInfo.song.SNG_ID}`,
|
||||
+ }),
|
||||
});
|
||||
}
|
||||
- setPlayerInfo(player) {
|
||||
+ setPlayerInfo(player, data) {
|
||||
(this.player = Object.assign(this.player, player)),
|
||||
this.emit(MediaEvents.PlayerUpdated, this.player),
|
||||
(this.mprisPlayer.playbackStatus =
|
||||
@@ -2530,7 +2536,7 @@
|
||||
(this.ipc = ipc),
|
||||
(this.app = app);
|
||||
}
|
||||
- setUserInfo(userInfo) {
|
||||
+ setUserInfo(userInfo, data) {
|
||||
const previousUserID = this.user.id;
|
||||
(this.user = Object.assign(this.user, userInfo)),
|
||||
previousUserID !== this.user.id &&
|
||||
@@ -2773,8 +2779,8 @@
|
||||
media = main_di.get(SERVICE_MEDIA),
|
||||
powerSave = main_di.get(SERVICE_POWER_SAVE);
|
||||
var powerSaveTimeoutId;
|
||||
- PlayerIpc_ipc.on("channel-player-state-update", (event, state) => {
|
||||
- media.setPlayerInfo({ state }),
|
||||
+ PlayerIpc_ipc.on("channel-player-state-update", (event, state, data) => {
|
||||
+ media.setPlayerInfo({ state }, data),
|
||||
clearTimeout(powerSaveTimeoutId),
|
||||
(powerSaveTimeoutId = setTimeout(() => {
|
||||
state === MediaPlayerState.Playing
|
||||
@@ -2784,16 +2790,22 @@
|
||||
}),
|
||||
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-repeat-mode-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, data) => {
|
||||
+ media.setPlayerInfo(player, data);
|
||||
+ }
|
||||
+ );
|
||||
const UpdaterIpc_ipc = main_di.get(SERVICE_IPC),
|
||||
autoUpdater = main_di.get(SERVICE_UPDATER);
|
||||
UpdaterIpc_ipc.on("channel-updater-install", () => {
|
||||
@@ -2801,8 +2813,8 @@
|
||||
});
|
||||
const UserIpc_ipc = main_di.get(SERVICE_IPC),
|
||||
user = main_di.get(SERVICE_USER);
|
||||
- UserIpc_ipc.on("channel-user-store-updated", (event, userData) => {
|
||||
- user.setUserInfo(userData);
|
||||
+ UserIpc_ipc.on("channel-user-store-updated", (event, userData, data) => {
|
||||
+ user.setUserInfo(userData, data);
|
||||
});
|
||||
var application_awaiter = function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
diff --git a/build/renderer.js b/build/renderer.js
|
||||
index 9761e62..4992d17 100644
|
||||
--- a/build/renderer.js
|
||||
+++ b/build/renderer.js
|
||||
@@ -349,23 +349,31 @@
|
||||
isFamily =
|
||||
multiAccount &&
|
||||
(multiAccount.ENABLED || multiAccount.CHILD_COUNT > 0);
|
||||
- renderer_ipc.send("channel-user-store-updated", {
|
||||
- id: userMetadata.USER_ID,
|
||||
- isFamily,
|
||||
- isEmployee: userMetadata.SETTING.global.is_employee,
|
||||
- offerId: user.OFFER_ID,
|
||||
- country: user.COUNTRY,
|
||||
- gatekeeps: user.__DZR_GATEKEEPS__,
|
||||
- });
|
||||
+ renderer_ipc.send(
|
||||
+ "channel-user-store-updated",
|
||||
+ {
|
||||
+ id: userMetadata.USER_ID,
|
||||
+ isFamily,
|
||||
+ isEmployee: userMetadata.SETTING.global.is_employee,
|
||||
+ offerId: user.OFFER_ID,
|
||||
+ country: user.COUNTRY,
|
||||
+ gatekeeps: user.__DZR_GATEKEEPS__,
|
||||
+ },
|
||||
+ event.data
|
||||
+ );
|
||||
break;
|
||||
}
|
||||
case "player-repeat-changed":
|
||||
- renderer_ipc.send("channel-player-repeat-mode-update", {
|
||||
- repeatMode: event.data.player.repeat,
|
||||
- canPrev: event.data.player.hasPrev,
|
||||
- canNext: event.data.player.hasNext,
|
||||
- canRepeat: event.data.player.hasRepeat,
|
||||
- });
|
||||
+ renderer_ipc.send(
|
||||
+ "channel-player-repeat-mode-update",
|
||||
+ {
|
||||
+ repeatMode: event.data.player.repeat,
|
||||
+ 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", {
|
||||
@@ -380,7 +388,11 @@
|
||||
!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": {
|
||||
@@ -409,7 +421,12 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.48.1
|
||||
|
24
patches/08-discord-rich-presence-disable.patch
Normal file
24
patches/08-discord-rich-presence-disable.patch
Normal file
@ -0,0 +1,24 @@
|
||||
From 0fe9042e22b8c8c05d0d3aed550d18b511e0abd5 Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
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
|
||||
|
@ -1,232 +0,0 @@
|
||||
From c53a3132b676ecaa30f8dcb30ecbaaabbbd63f76 Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
Date: Wed, 23 Jul 2025 21:36:05 +0200
|
||||
Subject: [PATCH] feat: add discord rich presence support (w/ opt-in arg.)
|
||||
|
||||
---
|
||||
build/main.js | 175 +++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
package.json | 1 +
|
||||
2 files changed, 175 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index 8332c3a..aba4098 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -93,6 +93,13 @@
|
||||
var external_electron_mpris_default = __webpack_require__.n(
|
||||
external_electron_mpris_namespaceObject
|
||||
);
|
||||
+ const external_discord_rpc_namespaceObject = require("@deezer-community/discord-rpc");
|
||||
+ var external_discord_rpc_default = __webpack_require__.n(
|
||||
+ external_discord_rpc_namespaceObject
|
||||
+ );
|
||||
+ /** @type {import("@deezer-community/discord-rpc").Client} */
|
||||
+ var rpcClient;
|
||||
+ var rpcData, rpcStartedAt, rpcPausedAt;
|
||||
function isPlatform(platform) {
|
||||
switch (platform) {
|
||||
case PLATFORM.WINDOWS:
|
||||
@@ -1229,6 +1236,170 @@
|
||||
this.mprisPlayer.on("loopStatus", this.setRepeatMode.bind(this));
|
||||
this.mprisPlayer.on("raise", () => this.app.getWindow().show());
|
||||
}
|
||||
+ updateDiscordRichPresence(track, data) {
|
||||
+ if (!process.argv.some((arg) => arg === "--enable-discord-rpc")) return;
|
||||
+
|
||||
+ if (!rpcClient) {
|
||||
+ rpcClient = new external_discord_rpc_namespaceObject.Client({
|
||||
+ clientId: "1244016234203185183",
|
||||
+ transport: "ipc",
|
||||
+ });
|
||||
+ rpcClient.on("ready", () => {
|
||||
+ external_electron_log_default().info(
|
||||
+ "[Discord] Rich presence client is ready."
|
||||
+ );
|
||||
+ });
|
||||
+ rpcClient.on("close", () => {
|
||||
+ external_electron_log_default().info(
|
||||
+ "[Discord] Rich presence client disconnected."
|
||||
+ );
|
||||
+ });
|
||||
+ rpcClient
|
||||
+ .login()
|
||||
+ .then(() => {
|
||||
+ external_electron_log_default().info(
|
||||
+ "[Discord] Rich presence client logged in successfully."
|
||||
+ );
|
||||
+ })
|
||||
+ .catch((err) => {
|
||||
+ external_electron_log_default().error(
|
||||
+ `[Discord] Rich presence client login error: ${err}`
|
||||
+ );
|
||||
+
|
||||
+ rpcClient = null;
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ if (track && data) {
|
||||
+ const duration = data?.trackInfo?.song?.DURATION;
|
||||
+ const livestream = data?.trackInfo?.song?.LIVE_STREAM || false;
|
||||
+
|
||||
+ external_electron_log_default().debug(
|
||||
+ "[Discord] Updating rich presence with track information."
|
||||
+ );
|
||||
+ rpcStartedAt = livestream
|
||||
+ ? rpcData.startTimestamp || Date.now()
|
||||
+ : Date.now();
|
||||
+ rpcPausedAt = null;
|
||||
+ rpcData = {
|
||||
+ type: external_discord_rpc_namespaceObject.ActivityType.Listening,
|
||||
+ smallImage: {
|
||||
+ image: "play",
|
||||
+ text: "Playing",
|
||||
+ },
|
||||
+ largeImage: track.coverUrl,
|
||||
+ description: track.title,
|
||||
+ state:
|
||||
+ !track.album || track.title === track.album
|
||||
+ ? `${track.artist}`
|
||||
+ : `${track.artist} - ${track.album}`,
|
||||
+ startTimestamp: rpcStartedAt,
|
||||
+ ...(duration && {
|
||||
+ endTimestamp: rpcStartedAt + duration * 1e3,
|
||||
+ duration: duration * 1e3,
|
||||
+ }),
|
||||
+ ...(data?.trackInfo?.song?.SNG_ID && {
|
||||
+ button: {
|
||||
+ label: "Listen on Deezer",
|
||||
+ url: `https://deezer.com/track/${data.trackInfo.song.SNG_ID}`,
|
||||
+ },
|
||||
+ }),
|
||||
+ };
|
||||
+
|
||||
+ rpcClient
|
||||
+ ?.setActivity({
|
||||
+ state: rpcData.state,
|
||||
+ type: rpcData.type,
|
||||
+ details: rpcData.description,
|
||||
+ assets: {
|
||||
+ large_image: rpcData.largeImage,
|
||||
+ small_image: rpcData.smallImage.image,
|
||||
+ small_text: rpcData.smallImage.text,
|
||||
+ },
|
||||
+ timestamps: {
|
||||
+ start: rpcData.startTimestamp,
|
||||
+ end: rpcData.endTimestamp,
|
||||
+ },
|
||||
+ ...(rpcData.button && {
|
||||
+ buttons: [
|
||||
+ {
|
||||
+ label: rpcData.button.label,
|
||||
+ url: rpcData.button.url,
|
||||
+ },
|
||||
+ ],
|
||||
+ }),
|
||||
+ })
|
||||
+ .then(() => {
|
||||
+ external_electron_log_default().debug(
|
||||
+ "[Discord] Rich presence updated successfully."
|
||||
+ );
|
||||
+ })
|
||||
+ .catch((err) => {
|
||||
+ external_electron_log_default().error(
|
||||
+ `[Discord] Error updating rich presence: ${err}`
|
||||
+ );
|
||||
+ });
|
||||
+ } else {
|
||||
+ if (!rpcClient) return;
|
||||
+ if (!rpcData) {
|
||||
+ external_electron_log_default().debug(
|
||||
+ "[Discord] No track data available for rich presence."
|
||||
+ );
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (this.player.state === "playing") {
|
||||
+ if (rpcPausedAt) {
|
||||
+ const elapsed = rpcPausedAt - rpcStartedAt;
|
||||
+ rpcStartedAt = Date.now() - elapsed;
|
||||
+ rpcData.startTimestamp = rpcStartedAt;
|
||||
+ rpcData.endTimestamp = rpcStartedAt + (rpcData.duration || 0);
|
||||
+ }
|
||||
+ rpcPausedAt = undefined;
|
||||
+ rpcData.smallImage = {
|
||||
+ image: "play",
|
||||
+ text: "Playing",
|
||||
+ };
|
||||
+ } else {
|
||||
+ rpcData.startTimestamp = undefined;
|
||||
+ rpcData.endTimestamp = undefined;
|
||||
+ rpcPausedAt = Date.now();
|
||||
+ rpcData.smallImage = {
|
||||
+ image: "pause",
|
||||
+ text: "Paused",
|
||||
+ };
|
||||
+ }
|
||||
+
|
||||
+ rpcClient
|
||||
+ ?.setActivity({
|
||||
+ state: rpcData.state,
|
||||
+ type: rpcData.type,
|
||||
+ details: rpcData.description,
|
||||
+ assets: {
|
||||
+ large_image: rpcData.largeImage,
|
||||
+ small_image: rpcData.smallImage.image,
|
||||
+ small_text: rpcData.smallImage.text,
|
||||
+ },
|
||||
+ timestamps: {
|
||||
+ start: rpcData.startTimestamp,
|
||||
+ end: rpcData.endTimestamp,
|
||||
+ },
|
||||
+ ...(rpcData.button && {
|
||||
+ buttons: [
|
||||
+ {
|
||||
+ label: rpcData.button.label,
|
||||
+ url: rpcData.button.url,
|
||||
+ },
|
||||
+ ],
|
||||
+ }),
|
||||
+ })
|
||||
+ .catch((err) => {
|
||||
+ external_electron_log_default().error(
|
||||
+ `[Discord] Error updating rich presence: ${err}`
|
||||
+ );
|
||||
+ });
|
||||
+ }
|
||||
+ }
|
||||
play() {
|
||||
this.ipc.send("channel-player-media-control", MediaPlayerControl.Play);
|
||||
}
|
||||
@@ -1269,6 +1440,7 @@
|
||||
"xesam:url": `https://deezer.com/track/${data.trackInfo.song.SNG_ID}`,
|
||||
}),
|
||||
});
|
||||
+ this.updateDiscordRichPresence(track, data);
|
||||
}
|
||||
setPlayerInfo(player, data) {
|
||||
(this.player = Object.assign(this.player, player)),
|
||||
@@ -1276,7 +1448,8 @@
|
||||
(this.mprisPlayer.playbackStatus =
|
||||
this.player.state === "playing"
|
||||
? external_electron_mpris_namespaceObject.PLAYBACK_STATUS_PLAYING
|
||||
- : external_electron_mpris_namespaceObject.PLAYBACK_STATUS_PAUSED);
|
||||
+ : external_electron_mpris_namespaceObject.PLAYBACK_STATUS_PAUSED),
|
||||
+ this.updateDiscordRichPresence();
|
||||
}
|
||||
getTrackInfo() {
|
||||
return this.track;
|
||||
diff --git a/package.json b/package.json
|
||||
index 0dd2a5c..8aedf53 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -12,6 +12,7 @@
|
||||
"author": "Deezer <support@deezer.com>",
|
||||
"main": "build/main.js",
|
||||
"dependencies": {
|
||||
+ "@deezer-community/discord-rpc": "1.0.4",
|
||||
"@electron/remote": "2.1.2",
|
||||
"@jellybrick/mpris-service": "2.1.5",
|
||||
"electron-log": "^5.1.2",
|
||||
--
|
||||
2.48.1
|
||||
|
72
patches/09-log-level-environment-variable.patch
Normal file
72
patches/09-log-level-environment-variable.patch
Normal file
@ -0,0 +1,72 @@
|
||||
From 43e2a95ada8852ffda95a9ea08bb7914d26c6d2f Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
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 <dorian.stoll@tmsp.io>
|
||||
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 | 39 ++++++++++++++++++++++++++++++++++-----
|
||||
1 file changed, 34 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index 8b645c6..686ac80 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -67,6 +67,35 @@
|
||||
var external_electron_log_default = __webpack_require__.n(
|
||||
external_electron_log_namespaceObject
|
||||
);
|
||||
+ // function updateLogLevel() {
|
||||
+ // const level = process.env.LOG_LEVEL;
|
||||
+ // if (level) {
|
||||
+ // if (level !== "silly")
|
||||
+ // external_electron_log_default().silly = () => {};
|
||||
+ // else return;
|
||||
+
|
||||
+ // if (level !== "debug")
|
||||
+ // external_electron_log_default().debug = () => {};
|
||||
+ // else return;
|
||||
+
|
||||
+ // if (level !== "verbose")
|
||||
+ // external_electron_log_default().verbose = () => {};
|
||||
+ // else return;
|
||||
+
|
||||
+ // if (level !== "info")
|
||||
+ // external_electron_log_default().info = () => {};
|
||||
+ // else return;
|
||||
+
|
||||
+ // if (level !== "warn")
|
||||
+ // external_electron_log_default().warn = () => {};
|
||||
+ // else return;
|
||||
+
|
||||
+ // 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
|
||||
|
288
patches/10-additional-metadata.patch
Normal file
288
patches/10-additional-metadata.patch
Normal file
@ -0,0 +1,288 @@
|
||||
From 493f6f6a6433882cc2d50b4ae352cd808bf0c23e Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
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
|
||||
|
@ -1,126 +0,0 @@
|
||||
From 33ed1cce4b8831fc6412ca482d9867a9dff9ffec Mon Sep 17 00:00:00 2001
|
||||
From: Aurélien Hamy <me@aunetx.dev>
|
||||
Date: Thu, 22 May 2025 15:50:44 +0200
|
||||
Subject: [PATCH] feat: improve responsiveness on small devices
|
||||
|
||||
Based on patch by josselinonduty <contact@josselinonduty.fr>
|
||||
Makes it possible to use the application for with a width as low as 550 pixels
|
||||
without problems, and is usable even below. Should not change anything for
|
||||
devices larger than 950 pixels, and nearly nothing above 800 pixels wide.
|
||||
---
|
||||
build/index.html | 83 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
build/main.js | 4 +--
|
||||
2 files changed, 85 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/build/index.html b/build/index.html
|
||||
index 8016bc8..4efcd23 100644
|
||||
--- a/build/index.html
|
||||
+++ b/build/index.html
|
||||
@@ -4,6 +4,89 @@
|
||||
<meta charset="utf-8" />
|
||||
<title>Deezer</title>
|
||||
<script defer="defer" src="./renderer.js"></script>
|
||||
+ <style>
|
||||
+ #page_topbar {
|
||||
+ min-width: 0px !important;
|
||||
+ }
|
||||
+
|
||||
+ .naboo {
|
||||
+ min-width: auto !important;
|
||||
+ }
|
||||
+
|
||||
+ .page-main {
|
||||
+ min-width: auto !important;
|
||||
+ }
|
||||
+
|
||||
+ /* this removes an unuseful margin that breaks on low width */
|
||||
+ @media screen and (max-width: 850px) {
|
||||
+ .carousel {
|
||||
+ margin-right: -24px !important;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* this prevents the content from overflowing */
|
||||
+ @media screen and (max-width: 808px) {
|
||||
+ .container > .carousel-wrapper {
|
||||
+ width: 100% !important;
|
||||
+ margin: 0px;
|
||||
+ padding: 0px;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* this makes the width transition seamless for carousels */
|
||||
+ @media only screen and (max-width: 784px) {
|
||||
+ .container {
|
||||
+ width: 100% !important;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* this makes the track list responsive */
|
||||
+ @media screen and (max-width: 950px) {
|
||||
+ .page-player .player-full {
|
||||
+ min-width: auto !important;
|
||||
+ }
|
||||
+
|
||||
+ .page-player .player-queuelist .player-container {
|
||||
+ margin: 32px 2% 0 !important;
|
||||
+ }
|
||||
+
|
||||
+ .page-player .queuelist-cover {
|
||||
+ width: 180px !important;
|
||||
+ margin-right: 2% !important;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* this hides the unuseful cover in track list for small screens */
|
||||
+ @media screen and (max-width: 750px) {
|
||||
+ .page-player .queuelist-cover {
|
||||
+ display: none !important;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* this makes the bottom player bar responsive */
|
||||
+ @media screen and (max-width: 800px) {
|
||||
+ #page_player > div:first-child {
|
||||
+ min-width: auto !important;
|
||||
+ }
|
||||
+
|
||||
+ /* icon and name */
|
||||
+ #page_player > div:first-child > div:first-child {
|
||||
+ width: calc(49% - 52px) !important;
|
||||
+ }
|
||||
+
|
||||
+ /* player controls */
|
||||
+ #page_player > div:first-child > div:nth-child(2) {
|
||||
+ padding-inline-start: unset !important;
|
||||
+ padding-inline-end: unset !important;
|
||||
+ width: calc(49% - 52px) !important;
|
||||
+ }
|
||||
+
|
||||
+ /* queue, volume and audio quality */
|
||||
+ #page_player > div:first-child > div:last-child {
|
||||
+ width: auto !important;
|
||||
+ }
|
||||
+ }
|
||||
+ </style>
|
||||
</head>
|
||||
<body class="electron">
|
||||
<div id="dzr-app"></div>
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index 22b50ff..99935cb 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -3245,8 +3245,8 @@
|
||||
},
|
||||
windowOptions = {
|
||||
title: "Deezer Desktop",
|
||||
- minWidth: 990,
|
||||
- minHeight: 600,
|
||||
+ minWidth: 450,
|
||||
+ minHeight: 450,
|
||||
icon: external_electron_namespaceObject.nativeImage.createFromPath(
|
||||
getAppIcon(external_electron_namespaceObject.app)
|
||||
),
|
||||
--
|
||||
2.49.0
|
||||
|
@ -1,66 +0,0 @@
|
||||
From bbb88f846c94978959f4816069332b4d9f9f4dab Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
Date: Tue, 8 Jul 2025 12:54:19 +0200
|
||||
Subject: [PATCH] feat: add toggle to hide application offline banner
|
||||
|
||||
Original patch: Aurélien Hamy <aunetx@yandex.com>
|
||||
This solves #123 by adding the `--hide-appoffline-banner` command-line argument
|
||||
to hide the annoying "Application is offline" banner, that sometimes appears when
|
||||
using a VPN or DNS level blocker.
|
||||
---
|
||||
build/index.html | 6 ++++++
|
||||
build/main.js | 5 +++++
|
||||
build/preload.js | 4 ++++
|
||||
3 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/build/index.html b/build/index.html
|
||||
index 4efcd23..4be829c 100644
|
||||
--- a/build/index.html
|
||||
+++ b/build/index.html
|
||||
@@ -86,6 +86,12 @@
|
||||
width: auto !important;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ /* hide the offline alert when needed */
|
||||
+ .hide-AppOffline-banner
|
||||
+ .alert-wrapper:has(> div[data-testid="alert-AppOffline"]) {
|
||||
+ display: none !important;
|
||||
+ }
|
||||
</style>
|
||||
</head>
|
||||
<body class="electron">
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index 99935cb..1c16dbe 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -3166,6 +3166,11 @@
|
||||
getRealPath(external_electron_namespaceObject.app, __dirname),
|
||||
"preload.js"
|
||||
),
|
||||
+ additionalArguments: [
|
||||
+ (process.argv.some((arg) => arg === "--hide-appoffline-banner") ||
|
||||
+ "yes" === process.env.DZ_HIDE_APPOFFLINE_BANNER) &&
|
||||
+ "--hide-appoffline-banner",
|
||||
+ ].filter(Boolean),
|
||||
},
|
||||
windowOptions = {
|
||||
title: "Deezer Desktop",
|
||||
diff --git a/build/preload.js b/build/preload.js
|
||||
index 1301e93..05939c4 100644
|
||||
--- a/build/preload.js
|
||||
+++ b/build/preload.js
|
||||
@@ -538,6 +538,10 @@
|
||||
external_i18next_default().dir(external_i18next_default().language)
|
||||
? "rtl"
|
||||
: "ltr");
|
||||
+ if (process.argv.some((arg) => arg === "--hide-appoffline-banner"))
|
||||
+ document
|
||||
+ .getElementsByTagName("body")[0]
|
||||
+ .classList.add("hide-AppOffline-banner");
|
||||
});
|
||||
})(),
|
||||
(module.exports = __webpack_exports__);
|
||||
--
|
||||
2.48.1
|
||||
|
@ -1,60 +0,0 @@
|
||||
From a220daa47a06d19ff6a995d567c0f46e42d14f6b Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
Date: Tue, 8 Jul 2025 14:37:23 +0200
|
||||
Subject: [PATCH] feat(patch): disable animations (cli/env)
|
||||
|
||||
---
|
||||
build/index.html | 6 ++++++
|
||||
build/main.js | 3 +++
|
||||
build/preload.js | 4 ++++
|
||||
3 files changed, 13 insertions(+)
|
||||
|
||||
diff --git a/build/index.html b/build/index.html
|
||||
index 4be829c..2ef7709 100644
|
||||
--- a/build/index.html
|
||||
+++ b/build/index.html
|
||||
@@ -92,6 +92,12 @@
|
||||
.alert-wrapper:has(> div[data-testid="alert-AppOffline"]) {
|
||||
display: none !important;
|
||||
}
|
||||
+
|
||||
+ /* Disable animations */
|
||||
+ .disable-animations * {
|
||||
+ animation: none !important;
|
||||
+ transition: none !important;
|
||||
+ }
|
||||
</style>
|
||||
</head>
|
||||
<body class="electron">
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index 8fa4b6f..61028cd 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -3246,6 +3246,9 @@
|
||||
(process.argv.some((arg) => arg === "--hide-appoffline-banner") ||
|
||||
"yes" === process.env.DZ_HIDE_APPOFFLINE_BANNER) &&
|
||||
"--hide-appoffline-banner",
|
||||
+ (process.argv.some((arg) => arg === "--disable-animations") ||
|
||||
+ "yes" === process.env.DZ_DISABLE_ANIMATIONS) &&
|
||||
+ "--disable-animations",
|
||||
].filter(Boolean),
|
||||
},
|
||||
windowOptions = {
|
||||
diff --git a/build/preload.js b/build/preload.js
|
||||
index 05939c4..0df9150 100644
|
||||
--- a/build/preload.js
|
||||
+++ b/build/preload.js
|
||||
@@ -542,6 +542,10 @@
|
||||
document
|
||||
.getElementsByTagName("body")[0]
|
||||
.classList.add("hide-AppOffline-banner");
|
||||
+ if (process.argv.some((arg) => arg === "--disable-animations"))
|
||||
+ document
|
||||
+ .getElementsByTagName("body")[0]
|
||||
+ .classList.add("disable-animations");
|
||||
});
|
||||
})(),
|
||||
(module.exports = __webpack_exports__);
|
||||
--
|
||||
2.48.1
|
||||
|
@ -1,40 +0,0 @@
|
||||
From fead13c466b3f5fde6f6fdd62c77b22a070e8d97 Mon Sep 17 00:00:00 2001
|
||||
From: josselinonduty <contact@josselinonduty.fr>
|
||||
Date: Tue, 29 Jul 2025 10:46:31 +0200
|
||||
Subject: [PATCH] feat(patch): disable notifications (w/ cli arg or env var)
|
||||
|
||||
---
|
||||
build/main.js | 3 +++
|
||||
build/preload.js | 2 ++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/build/main.js b/build/main.js
|
||||
index 5034587..315cab4 100644
|
||||
--- a/build/main.js
|
||||
+++ b/build/main.js
|
||||
@@ -3259,6 +3259,9 @@
|
||||
(process.argv.some((arg) => arg === "--disable-animations") ||
|
||||
"yes" === process.env.DZ_DISABLE_ANIMATIONS) &&
|
||||
"--disable-animations",
|
||||
+ (process.argv.some((arg) => arg === "--disable-notifications") ||
|
||||
+ "yes" === process.env.DZ_DISABLE_NOTIFICATIONS) &&
|
||||
+ "--disable-notifications",
|
||||
].filter(Boolean),
|
||||
},
|
||||
windowOptions = {
|
||||
diff --git a/build/preload.js b/build/preload.js
|
||||
index 0df9150..aa4bb78 100644
|
||||
--- a/build/preload.js
|
||||
+++ b/build/preload.js
|
||||
@@ -546,6 +546,8 @@
|
||||
document
|
||||
.getElementsByTagName("body")[0]
|
||||
.classList.add("disable-animations");
|
||||
+ if (process.argv.some((arg) => arg === "--disable-notifications"))
|
||||
+ delete window.Notification;
|
||||
});
|
||||
})(),
|
||||
(module.exports = __webpack_exports__);
|
||||
--
|
||||
2.48.1
|
||||
|
Loading…
x
Reference in New Issue
Block a user