mirror of
				https://github.com/aunetx/deezer-linux.git
				synced 2025-10-31 11:14:29 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			119 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			119 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 9250fb3bf514256f68ad844b53e7345b2efc4b37 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
 | |
| 
 | |
| 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     | 12 +++++++++++-
 | |
|  build/preload.js  | 12 +++++++++++-
 | |
|  build/renderer.js | 12 +++++++++++-
 | |
|  build/titlebar.js | 12 +++++++++++-
 | |
|  4 files changed, 44 insertions(+), 4 deletions(-)
 | |
| 
 | |
| diff --git a/build/main.js b/build/main.js
 | |
| index a667632..e03556c 100644
 | |
| --- a/build/main.js
 | |
| +++ b/build/main.js
 | |
| @@ -5,7 +5,17 @@
 | |
|          module.exports = require("macos-version");
 | |
|        },
 | |
|        857: (module) => {
 | |
| -        module.exports = require("os");
 | |
| +        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";
 | |
| +        };
 | |
| +        module.exports = __module_os;
 | |
|        },
 | |
|      },
 | |
|      __webpack_module_cache__ = {};
 | |
| diff --git a/build/preload.js b/build/preload.js
 | |
| index 4029c6d..f625122 100644
 | |
| --- a/build/preload.js
 | |
| +++ b/build/preload.js
 | |
| @@ -5,7 +5,17 @@
 | |
|          module.exports = require("macos-version");
 | |
|        },
 | |
|        857: (module) => {
 | |
| -        module.exports = require("os");
 | |
| +        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";
 | |
| +        };
 | |
| +        module.exports = __module_os;
 | |
|        },
 | |
|      },
 | |
|      __webpack_module_cache__ = {};
 | |
| diff --git a/build/renderer.js b/build/renderer.js
 | |
| index ca6c307..24b119f 100644
 | |
| --- a/build/renderer.js
 | |
| +++ b/build/renderer.js
 | |
| @@ -5,7 +5,17 @@
 | |
|          module.exports = require("macos-version");
 | |
|        },
 | |
|        857: (module) => {
 | |
| -        module.exports = require("os");
 | |
| +        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";
 | |
| +        };
 | |
| +        module.exports = __module_os;
 | |
|        },
 | |
|      },
 | |
|      __webpack_module_cache__ = {};
 | |
| diff --git a/build/titlebar.js b/build/titlebar.js
 | |
| index 5414c90..4f3c6a3 100644
 | |
| --- a/build/titlebar.js
 | |
| +++ b/build/titlebar.js
 | |
| @@ -5,7 +5,17 @@
 | |
|          module.exports = require("macos-version");
 | |
|        },
 | |
|        857: (module) => {
 | |
| -        module.exports = require("os");
 | |
| +        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";
 | |
| +        };
 | |
| +        module.exports = __module_os;
 | |
|        },
 | |
|      },
 | |
|      __webpack_module_cache__ = {};
 | |
| -- 
 | |
| 2.43.0
 | |
| 
 |