fix(patch): add credits to original author; add default log level based on remove isDev patch

This commit is contained in:
josselinonduty 2025-02-01 19:10:56 +01:00
parent 3ee1a84cd1
commit bc584343c8
No known key found for this signature in database
3 changed files with 65 additions and 30 deletions

View File

@ -3,6 +3,10 @@ From: josselinonduty <contact@josselinonduty.fr>
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>
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(-)

View File

@ -3,6 +3,16 @@ From: josselinonduty <contact@josselinonduty.fr>
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.
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 +++++++++-

View File

@ -1,14 +1,18 @@
From 93a932ba99e8125169eeb512fa6f9a89a70eeb1e Mon Sep 17 00:00:00 2001
From 43e2a95ada8852ffda95a9ea08bb7914d26c6d2f Mon Sep 17 00:00:00 2001
From: josselinonduty <contact@josselinonduty.fr>
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 <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 | 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