You are not logged in.
Hi! i want to help, can't install deezer
yay -S deezer
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1] deezer-5.30.270-1
1 deezer (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==>
:: PKGBUILD up to date, Skipping (1/0): deezer
1 deezer (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==>
:: (1/1) Parsing SRCINFO: deezer
==> Making package: deezer 5.30.270-1 (Fri 01 Jul 2022 10:44:24 PM CEST)
==> Retrieving sources...
-> Found deezer-5.30.270-setup.exe
-> Found deezer.desktop
-> Found deezer
-> Found remove-kernel-version-from-user-agent.patch
-> Found avoid-change-default-texthtml-mime-type.patch
-> Found fix-isDev-usage.patch
-> Found start-hidden-in-tray.patch
-> Found quit.patch
==> Validating source files with sha256sums...
deezer-5.30.270-setup.exe ... Passed
deezer.desktop ... Passed
deezer ... Passed
remove-kernel-version-from-user-agent.patch ... Passed
avoid-change-default-texthtml-mime-type.patch ... Passed
fix-isDev-usage.patch ... Passed
start-hidden-in-tray.patch ... Passed
quit.patch ... Passed
==> Making package: deezer 5.30.270-1 (Fri 01 Jul 2022 10:44:25 PM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found deezer-5.30.270-setup.exe
-> Found deezer.desktop
-> Found deezer
-> Found remove-kernel-version-from-user-agent.patch
-> Found avoid-change-default-texthtml-mime-type.patch
-> Found fix-isDev-usage.patch
-> Found start-hidden-in-tray.patch
-> Found quit.patch
==> Validating source files with sha256sums...
deezer-5.30.270-setup.exe ... Passed
deezer.desktop ... Passed
deezer ... Passed
remove-kernel-version-from-user-agent.patch ... Passed
avoid-change-default-texthtml-mime-type.patch ... Passed
fix-isDev-usage.patch ... Passed
start-hidden-in-tray.patch ... Passed
quit.patch ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
-> Extracting deezer-5.30.270-setup.exe with bsdtar
==> Starting prepare()...
build/main.js 428ms
build/preload.js 85ms
build/renderer.js 43ms
build/service-worker.js 1ms
build/titlebar.js 23ms
Applying patch remove-kernel-version-from-user-agent.patch...
patching file build/main.js
Hunk #1 FAILED at 5.
1 out of 1 hunk FAILED -- saving rejects to file build/main.js.rej
patching file build/preload.js
Hunk #1 FAILED at 5.
1 out of 1 hunk FAILED -- saving rejects to file build/preload.js.rej
patching file build/renderer.js
Hunk #1 FAILED at 5.
1 out of 1 hunk FAILED -- saving rejects to file build/renderer.js.rej
patching file build/titlebar.js
Hunk #1 FAILED at 5.
1 out of 1 hunk FAILED -- saving rejects to file build/titlebar.js.rej
==> ERROR: A failure occurred in prepare().
Aborting...
-> error making: deezer
Offline
I don't have any problems:
> LANG=C; makepkg -sc
==> Making package: deezer 5.30.270-1 (Fri Jul 1 17:56:52 2022)
==> Checking runtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...
Packages (1) electron13-13.6.9-3
Total Download Size: 51.05 MiB
Total Installed Size: 170.26 MiB
:: Proceed with installation? [Y/n] y
:: Retrieving packages...
electron13-13.6.9-3-x86_64 51.0 MiB 3.19 MiB/s 00:16 [------------------------------------------------------------] 100%
(1/1) checking keys in keyring [------------------------------------------------------------] 100%
(1/1) checking package integrity [------------------------------------------------------------] 100%
(1/1) loading package files [------------------------------------------------------------] 100%
(1/1) checking for file conflicts [------------------------------------------------------------] 100%
(1/1) checking available disk space [------------------------------------------------------------] 100%
:: Processing package changes...
(1/1) installing electron13 [------------------------------------------------------------] 100%
Optional dependencies for electron13
kde-cli-tools: file deletion support (kioclient5)
libappindicator-gtk3: StatusNotifierItem support [installed]
pipewire: WebRTC desktop sharing under Wayland [installed]
trash-cli: file deletion support (trash-put)
xdg-utils: open URLs with desktop's default (xdg-email, xdg-open) [installed]
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating the desktop file MIME type cache...
==> Checking buildtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...
Packages (1) asar-3.1.0-2
Total Download Size: 0.05 MiB
Total Installed Size: 0.20 MiB
:: Proceed with installation? [Y/n] y
:: Retrieving packages...
asar-3.1.0-2-any 55.1 KiB 112 KiB/s 00:00 [------------------------------------------------------------] 100%
(1/1) checking keys in keyring [------------------------------------------------------------] 100%
(1/1) checking package integrity [------------------------------------------------------------] 100%
(1/1) loading package files [------------------------------------------------------------] 100%
(1/1) checking for file conflicts [------------------------------------------------------------] 100%
(1/1) checking available disk space [------------------------------------------------------------] 100%
:: Processing package changes...
(1/1) installing asar [------------------------------------------------------------] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
==> Retrieving sources...
-> Downloading deezer-5.30.270-setup.exe...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 74.2M 100 74.2M 0 0 4366k 0 0:00:17 0:00:17 --:--:-- 4440k
-> Found deezer.desktop
-> Found deezer
-> Found remove-kernel-version-from-user-agent.patch
-> Found avoid-change-default-texthtml-mime-type.patch
-> Found fix-isDev-usage.patch
-> Found start-hidden-in-tray.patch
-> Found quit.patch
==> Validating source files with sha256sums...
deezer-5.30.270-setup.exe ... Passed
deezer.desktop ... Passed
deezer ... Passed
remove-kernel-version-from-user-agent.patch ... Passed
avoid-change-default-texthtml-mime-type.patch ... Passed
fix-isDev-usage.patch ... Passed
start-hidden-in-tray.patch ... Passed
quit.patch ... Passed
==> Extracting sources...
-> Extracting deezer-5.30.270-setup.exe with bsdtar
==> Starting prepare()...
build/main.js 950ms
build/preload.js 142ms
build/renderer.js 79ms
build/service-worker.js 5ms
build/titlebar.js 47ms
Applying patch remove-kernel-version-from-user-agent.patch...
patching file build/main.js
patching file build/preload.js
patching file build/renderer.js
patching file build/titlebar.js
Applying patch avoid-change-default-texthtml-mime-type.patch...
patching file build/main.js
Applying patch fix-isDev-usage.patch...
patching file build/main.js
Hunk #2 succeeded at 3259 (offset -9 lines).
patching file build/preload.js
Applying patch start-hidden-in-tray.patch...
patching file build/main.js
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 3121 with fuzz 1 (offset -1 lines).
Applying patch quit.patch...
patching file build/main.js
Hunk #1 succeeded at 3078 (offset -5 lines).
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
-> Removing libtool files...
-> Purging unwanted files...
-> Removing static library files...
-> Stripping unneeded symbols from binaries and libraries...
-> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "deezer"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
-> Generating .MTREE file...
-> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: deezer 5.30.270-1 (Fri Jul 1 17:57:53 2022)
==> Cleaning up...
If you use makepkg, do you have the same issue?
Solo soy un loco más. Please use [code] [/code] tags.
Command cheatsheet ♠ Command not found?
If I write something wrong in English, please correct me.
Offline
Yes, i have the same issu with makepkg, i used
https://github.com/SibrenVasse/deezer
and
https://aur.archlinux.org/deezer.git
Offline
Offline
Ah ok sorry, i thought it was the same outing, with makepkg:
makepkg -sc
==> Making package: deezer 5.30.270-1 (Fri 01 Jul 2022 11:39:17 PM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found deezer-5.30.270-setup.exe
-> Found deezer.desktop
-> Found deezer
-> Found remove-kernel-version-from-user-agent.patch
-> Found avoid-change-default-texthtml-mime-type.patch
-> Found fix-isDev-usage.patch
-> Found start-hidden-in-tray.patch
-> Found quit.patch
==> Validating source files with sha256sums...
deezer-5.30.270-setup.exe ... Passed
deezer.desktop ... Passed
deezer ... Passed
remove-kernel-version-from-user-agent.patch ... Passed
avoid-change-default-texthtml-mime-type.patch ... Passed
fix-isDev-usage.patch ... Passed
start-hidden-in-tray.patch ... Passed
quit.patch ... Passed
==> Extracting sources...
-> Extracting deezer-5.30.270-setup.exe with bsdtar
==> Starting prepare()...
build/main.js 431ms
build/preload.js 78ms
build/renderer.js 38ms
build/service-worker.js 2ms
build/titlebar.js 23ms
Applying patch remove-kernel-version-from-user-agent.patch...
patching file build/main.js
Hunk #1 FAILED at 5.
1 out of 1 hunk FAILED -- saving rejects to file build/main.js.rej
patching file build/preload.js
Hunk #1 FAILED at 5.
1 out of 1 hunk FAILED -- saving rejects to file build/preload.js.rej
patching file build/renderer.js
Hunk #1 FAILED at 5.
1 out of 1 hunk FAILED -- saving rejects to file build/renderer.js.rej
patching file build/titlebar.js
Hunk #1 FAILED at 5.
1 out of 1 hunk FAILED -- saving rejects to file build/titlebar.js.rej
==> ERROR: A failure occurred in prepare().
Aborting...
I use qutebrowser ... :>
Last edited by GeorgioP1SK (2022-07-01 21:41:38)
Offline
I have to admit I cannot reproduce this either (see my output below for reference), but my system hasn't seen an update in a week, so not sure if this is helpful.
Out of curiosity, what's the content (or at least the first 20 lines) of your main.js file that it fails to patch? ($srcdir/resources/app/build/main.js)
$ makepkg -Csr
==> Making package: deezer 5.30.270-1 (Sat 02 Jul 2022 00:06:19 CEST)
==> Checking runtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...
Package (1) New Version Net Change
community/electron13 13.6.9-3 170.26 MiB
Total Installed Size: 170.26 MiB
:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring [######################################] 100%
(1/1) checking package integrity [######################################] 100%
(1/1) loading package files [######################################] 100%
(1/1) checking for file conflicts [######################################] 100%
(1/1) checking available disk space [######################################] 100%
:: Processing package changes...
(1/1) installing electron13 [######################################] 100%
Optional dependencies for electron13
kde-cli-tools: file deletion support (kioclient5)
libappindicator-gtk3: StatusNotifierItem support [installed]
pipewire: WebRTC desktop sharing under Wayland [installed]
trash-cli: file deletion support (trash-put)
xdg-utils: open URLs with desktop's default (xdg-email, xdg-open) [installed]
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating the desktop file MIME type cache...
==> Checking buildtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...
Package (2) New Version Net Change Download Size
community/asar 3.1.0-2 0.20 MiB 0.05 MiB
community/prettier 2.7.1-1 15.08 MiB
Total Download Size: 0.05 MiB
Total Installed Size: 15.29 MiB
:: Proceed with installation? [Y/n]
:: Retrieving packages...
asar-3.1.0-2-any 55.1 KiB 330 KiB/s 00:00 [######################################] 100%
(2/2) checking keys in keyring [######################################] 100%
(2/2) checking package integrity [######################################] 100%
(2/2) loading package files [######################################] 100%
(2/2) checking for file conflicts [######################################] 100%
(2/2) checking available disk space [######################################] 100%
:: Processing package changes...
(1/2) installing asar [######################################] 100%
(2/2) installing prettier [######################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
==> Retrieving sources...
-> Downloading deezer-5.30.270-setup.exe...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 74.2M 100 74.2M 0 0 22.0M 0 0:00:03 0:00:03 --:--:-- 24.8M
-> Found deezer.desktop
-> Found deezer
-> Found remove-kernel-version-from-user-agent.patch
-> Found avoid-change-default-texthtml-mime-type.patch
-> Found fix-isDev-usage.patch
-> Found start-hidden-in-tray.patch
-> Found quit.patch
==> Validating source files with sha256sums...
deezer-5.30.270-setup.exe ... Passed
deezer.desktop ... Passed
deezer ... Passed
remove-kernel-version-from-user-agent.patch ... Passed
avoid-change-default-texthtml-mime-type.patch ... Passed
fix-isDev-usage.patch ... Passed
start-hidden-in-tray.patch ... Passed
quit.patch ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
-> Extracting deezer-5.30.270-setup.exe with bsdtar
==> Starting prepare()...
build/main.js 490ms
build/preload.js 93ms
build/renderer.js 44ms
build/service-worker.js 2ms
build/titlebar.js 29ms
Applying patch remove-kernel-version-from-user-agent.patch...
patching file build/main.js
patching file build/preload.js
patching file build/renderer.js
patching file build/titlebar.js
Applying patch avoid-change-default-texthtml-mime-type.patch...
patching file build/main.js
Applying patch fix-isDev-usage.patch...
patching file build/main.js
Hunk #2 succeeded at 3259 (offset -9 lines).
patching file build/preload.js
Applying patch start-hidden-in-tray.patch...
patching file build/main.js
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 3121 with fuzz 1 (offset -1 lines).
Applying patch quit.patch...
patching file build/main.js
Hunk #1 succeeded at 3078 (offset -5 lines).
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
-> Removing libtool files...
-> Purging unwanted files...
-> Removing static library files...
-> Stripping unneeded symbols from binaries and libraries...
-> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "deezer"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
-> Generating .MTREE file...
-> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: deezer 5.30.270-1 (Sat 02 Jul 2022 00:06:38 CEST)
==> Removing installed dependencies...
checking dependencies...
Package (3) Old Version Net Change
asar 3.1.0-2 -0.20 MiB
electron13 13.6.9-3 -170.26 MiB
prettier 2.7.1-1 -15.08 MiB
Total Removed Size: 185.55 MiB
:: Do you want to remove these packages? [Y/n]
:: Processing package changes...
(1/3) removing prettier [######################################] 100%
(2/3) removing electron13 [######################################] 100%
(3/3) removing asar [######################################] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating the desktop file MIME type cache...
Offline
Do a clean build
Offline
$srcdir/resources/app/build/main.js
❯ cat src/resources/app/build/main.js
(() => {
"use strict";
var __webpack_modules__ = {
98: module => {
module.exports = require("macos-version");
},
87: module => {
module.exports = require("os");
},
},
__webpack_module_cache__ = {};
function __webpack_require__(moduleId) {
var cachedModule = __webpack_module_cache__[moduleId];
if (void 0 !== cachedModule) return cachedModule.exports;
var module = (__webpack_module_cache__[moduleId] = { exports: {} });
return (
__webpack_modules__[moduleId](
module,
module.exports,
__webpack_require__
),
module.exports
);
}
(__webpack_require__.n = module => {
var getter =
module && module.__esModule ? () => module.default : () => module;
return __webpack_require__.d(getter, { a: getter }), getter;
}),
(__webpack_require__.d = (exports, definition) => {
for (var key in definition)
__webpack_require__.o(definition, key) &&
!__webpack_require__.o(exports, key) &&
Object.defineProperty(exports, key, {
enumerable: !0,
get: definition[key],
});
}),
(__webpack_require__.o = (obj, prop) =>
Object.prototype.hasOwnProperty.call(obj, prop)),
(__webpack_require__.r = exports => {
"undefined" != typeof Symbol &&
Symbol.toStringTag &&
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }),
Object.defineProperty(exports, "__esModule", { value: !0 });
});
var __webpack_exports__ = {};
(() => {
__webpack_require__.r(__webpack_exports__),
__webpack_require__.d(__webpack_exports__, { default: () => main });
require("reflect-metadata");
const external_electron_namespaceObject = require("electron"),
external_path_namespaceObject = require("path");
var external_path_default = __webpack_require__.n(
external_path_namespaceObject
);
const external_electron_log_namespaceObject = require("electron-log");
var external_electron_log_default = __webpack_require__.n(
external_electron_log_namespaceObject
);
const external_electron_settings_namespaceObject = require("electron-settings");
var external_electron_settings_default = __webpack_require__.n(
external_electron_settings_namespaceObject
);
const external_raven_namespaceObject = require("raven");
var external_raven_default = __webpack_require__.n(
external_raven_namespaceObject
);
const external_url_namespaceObject = require("url");
var external_url_default = __webpack_require__.n(
external_url_namespaceObject
);
const external_inversify_namespaceObject = require("inversify"),
external_events_namespaceObject = require("events"),
external_semver_namespaceObject =
(require("isomorphic-fetch"), require("semver"));
var external_semver_default = __webpack_require__.n(
external_semver_namespaceObject
);
const external_electron_devtools_installer_namespaceObject = require("electron-devtools-installer");
var PLATFORM,
external_electron_devtools_installer_default = __webpack_require__.n(
external_electron_devtools_installer_namespaceObject
);
function isPlatform(platform) {
switch (platform) {
case PLATFORM.WINDOWS:
return "win32" === process.platform;
case PLATFORM.DARWIN:
return "darwin" === process.platform;
case PLATFORM.LINUX:
return "linux" === process.platform;
default:
return !1;
}
}
function getPlatformName() {
return isPlatform(PLATFORM.WINDOWS)
? PLATFORM.WINDOWS
: isPlatform(PLATFORM.DARWIN)
? PLATFORM.DARWIN
: isPlatform(PLATFORM.LINUX)
? PLATFORM.LINUX
: PLATFORM.UNKNOWN;
}
function getAppIcon() {
let appIcon = "";
switch (getPlatformName()) {
case PLATFORM.WINDOWS:
appIcon = "win/systray.png";
break;
case PLATFORM.DARWIN:
appIcon = "mac/trayTemplate.png";
break;
case PLATFORM.LINUX:
appIcon = "linux/systray.png";
}
return external_path_default().join(process.resourcesPath, appIcon);
}
function getDzTld() {
return process.env.DZ_DEV_ENV ? "deezerdev.com" : "deezer.com";
}
function getDomainName() {
return process.env.DZ_DEV_ENV
? `${process.env.DZ_DEV_ENV}-www.deezerdev.com`
: "www.deezer.com";
}
!(function (PLATFORM) {
(PLATFORM.WINDOWS = "windows"),
(PLATFORM.DARWIN = "darwin"),
(PLATFORM.LINUX = "linux"),
(PLATFORM.UNKNOWN = "unknown");
})(PLATFORM || (PLATFORM = {}));
const LOCALE_TO_LANGUAGE = {
"de-AT": "de",
"de-CH": "de",
"de-DE": "de",
"en-AU": "en",
"en-CA": "us",
"en-GB": "en",
"en-NZ": "en",
"en-US": "us",
"en-ZA": "en",
"es-419": "es",
"fr-CA": "fr",
"fr-CH": "fr",
"fr-FR": "fr",
"it-CH": "it",
"it-IT": "it",
"pt-BR": "br",
"pt-PT": "pt",
"zh-CN": "cn",
"zh-TW": "cn",
nn: "no",
nb: "no",
},
SUPPORTED_LANGUAGES = [
"ar",
"bg",
"br",
"cn",
"cs",
"da",
"de",
"en",
"es",
"fi",
"fr",
"he",
"hr",
"hu",
"id",
"it",
"ja",
"ko",
"ms",
"mx",
"nl",
"no",
"pl",
"pt",
"ro",
"ru",
"sk",
"sl",
"sq",
"sv",
"sr",
"th",
"tr",
"uk",
"us",
];
function getLanguage() {
const locale = (
external_electron_namespaceObject.app ||
external_electron_namespaceObject.remote.app
).getLocale(),
language = LOCALE_TO_LANGUAGE[locale] || locale;
return SUPPORTED_LANGUAGES.includes(language)
? language
: (external_electron_log_default().warn(
`I18n: This language is not supported "${locale}", falling back to "en".`
),
"en");
}
function getPlatformVersion() {
return isPlatform(PLATFORM.DARWIN)
? __webpack_require__(98)()
: __webpack_require__(87).release();
}
const external_fs_namespaceObject = require("fs");
var external_fs_default = __webpack_require__.n(
external_fs_namespaceObject
);
function isProcessMain() {
return "browser" === process.type;
}
function isWindowsStore() {
return Boolean(process.windowsStore);
}
let appPath, realAppPath;
function getRealPath(pathname) {
return isWindowsStore()
? ((appPath && realAppPath) ||
((appPath = isProcessMain()
? external_electron_namespaceObject.app.getAppPath()
: external_electron_namespaceObject.remote.app.getAppPath()),
(realAppPath = external_fs_default().realpathSync(appPath))),
appPath !== realAppPath
? pathname.replace(realAppPath, appPath)
: pathname)
: pathname;
}
var external_os_ = __webpack_require__(87),
external_os_default = __webpack_require__.n(external_os_);
function hasDevTools() {
return "yes" === process.env.DZ_DEVTOOLS;
}
const external_i18next_namespaceObject = require("i18next");
var external_i18next_default = __webpack_require__.n(
external_i18next_namespaceObject
);
const external_i18next_sprintf_postprocessor_namespaceObject = require("i18next-sprintf-postprocessor");
var external_i18next_sprintf_postprocessor_default = __webpack_require__.n(
external_i18next_sprintf_postprocessor_namespaceObject
);
const external_i18next_node_fs_backend_namespaceObject = require("i18next-node-fs-backend");
var external_i18next_node_fs_backend_default = __webpack_require__.n(
external_i18next_node_fs_backend_namespaceObject
);
const i18n_init = () => {
const language = getLanguage();
return (
external_i18next_default().use(
external_i18next_sprintf_postprocessor_default()
),
external_i18next_default().use(
external_i18next_node_fs_backend_default()
),
external_i18next_default().init(
{
backend: {
loadPath: external_path_default().resolve(
(
external_electron_namespaceObject.app ||
external_electron_namespaceObject.remote.app
).getAppPath(),
"locales/translations.{{lng}}.json"
),
},
lng: language,
fallbackLng: "en",
lowerCaseLng: !0,
keySeparator: "::",
nsSeparator: ":::",
postProcess: "sprintf",
},
() => {
external_electron_log_default().info(
`I18n: The ressources for the language "${language}" have been loaded.`
),
isProcessMain() &&
external_electron_namespaceObject.session.defaultSession.cookies
.set({
url: "https://www.deezer.com",
name: "dz_lang",
value: getLanguage(),
domain: ".deezer.com",
path: "/",
secure: !1,
httpOnly: !0,
})
.then(() => {
external_electron_log_default().info(
`I18n: The language "${language}" has been saved into the "dz_lang" cookie.`
);
})
.catch(err => {
external_electron_log_default().error(`I18n: ${err}`);
});
}
)
);
},
i18n_t = (...args) => external_i18next_default().t(...args);
function isDev() {
return external_electron_namespaceObject.remote
? !external_electron_namespaceObject.remote.app.isPackaged
: !external_electron_namespaceObject.app.isPackaged;
}
const defaultRequiredVersions = {
[PLATFORM.WINDOWS]: "*",
[PLATFORM.DARWIN]: "*",
[PLATFORM.LINUX]: "*",
};
const SERVICE_APPLICATION = Symbol("Application"),
SERVICE_APPLICATION_MENU = Symbol("ApplicationMenu"),
SERVICE_AUTOSTART = Symbol("AutoStart"),
SERVICE_COOKIE = Symbol("Cookie"),
SERVICE_DEEP_LINK = Symbol("DeepLink"),
SERVICE_HISTORY = Symbol("History"),
SERVICE_IPC = Symbol("Ipc"),
SERVICE_MEDIA = Symbol("Media"),
SERVICE_MENU = Symbol("Menu"),
SERVICE_NETWORK = Symbol("Network"),
SERVICE_POWER_SAVE = Symbol("PowerSave"),
SERVICE_SENTRY = Symbol("Sentry"),
SERVICE_THUMBAR = Symbol("Thumbar"),
SERVICE_TRAY = Symbol("Tray"),
SERVICE_UPDATER = Symbol("Updater"),
SERVICE_USER = Symbol("User"),
SERVICE_WINDOW_STATE = Symbol("WindowState");
var __decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
__awaiter = function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
}
function step(result) {
var value;
result.done
? resolve(result.value)
: ((value = result.value),
value instanceof P
? value
: new P(function (resolve) {
resolve(value);
})).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
let AppService = class {
getName() {
return external_electron_namespaceObject.app.getName();
}
setWindow(window, view) {
(this.currentWindow = window), (this.currentView = view);
}
getWindow() {
return this.currentWindow;
}
setUserAgent() {
this.getWebContents().setUserAgent(this.getUserAgent());
}
clearAppDataAndRestart() {
external_electron_settings_default().reset(),
external_electron_namespaceObject.session.defaultSession
.clearCache()
.then(() => {
external_electron_namespaceObject.session.defaultSession
.clearStorageData({})
.then(() => {
external_electron_namespaceObject.app.relaunch(),
external_electron_namespaceObject.app.exit();
});
});
}
enableDevMode() {
if (isDev() && hasDevTools()) {
const requiredExtensions = {
REACT_DEVELOPER_TOOLS:
external_electron_devtools_installer_namespaceObject.REACT_DEVELOPER_TOOLS,
REDUX_DEVTOOLS:
external_electron_devtools_installer_namespaceObject.REDUX_DEVTOOLS,
APOLLO_DEVELOPER_TOOLS:
external_electron_devtools_installer_namespaceObject.APOLLO_DEVELOPER_TOOLS,
};
this.getWebContents().once("did-finish-load", () => {
Object.keys(requiredExtensions).forEach(extensionName => {
external_electron_devtools_installer_default()(
requiredExtensions[extensionName]
)
.then(name =>
external_electron_log_default().info(
`Devtools: ${name} has been successfully installed.`
)
)
.catch(err =>
external_electron_log_default().warn(
`Devtools: Error installing extension ${extensionName} : ${err.message}`
)
);
}),
this.getWebContents().openDevTools();
});
}
}
loadPage(hash) {
(this.hash = hash), this.getWebContents().clearHistory();
const baseUrl = external_url_default().format({
pathname: external_path_default().resolve(
getRealPath(external_electron_namespaceObject.app.getAppPath()),
"build/index.html"
),
protocol: "file:",
slashes: !0,
hash,
});
this.getWebContents().once("will-prevent-unload", event => {
event.preventDefault();
}),
this.getWebContents()
.loadURL(baseUrl)
.catch(err =>
external_electron_log_default().error(
"Failed loading page",
baseUrl,
err
)
);
}
getWebContents() {
return this.currentView
? this.currentView.webContents
: this.currentWindow.webContents;
}
getViewContainer() {
return this.currentView ? this.currentView : this.currentWindow;
}
reloadApp() {
external_electron_namespaceObject.session.defaultSession
.clearCache()
.then(() => {
this.getWebContents().reload();
});
}
clearLogginInfo() {
return __awaiter(this, void 0, void 0, function* () {
const cookies =
yield external_electron_namespaceObject.session.defaultSession.cookies.get(
{}
),
domain = getDomainName();
cookies.some(cookie => "dzr_uniq_id" === cookie.name) &&
(yield Promise.all([
external_electron_namespaceObject.session.defaultSession.cookies.remove(
`https://${domain}`,
"dzr_uniq_id"
),
external_electron_namespaceObject.session.defaultSession.cookies.remove(
`https://${domain}`,
"account_id"
),
external_electron_namespaceObject.session.defaultSession.cookies.remove(
`https://${domain}`,
"arl"
),
external_electron_namespaceObject.session.defaultSession.cookies.remove(
`https://${domain}`,
"sid"
),
]));
});
}
closeWindow() {
if (this.getWindow())
return isPlatform(PLATFORM.DARWIN)
? (this.getWindow().isFullScreen() &&
this.getWindow().setFullScreen(!1),
this.getWindow().hide())
: this.getWindow().close();
}
getUserAgent() {
const appName = external_electron_namespaceObject.app.getName(),
appVersion = external_semver_default().valid(
external_semver_default().coerce(
external_electron_namespaceObject.app.getVersion()
)
),
appLocale = getLanguage();
return `${appName}/${appVersion} (Electron; ${
isPlatform(PLATFORM.DARWIN) ? "osx" : getPlatformName()
}/${getPlatformVersion()}; Desktop; ${appLocale})`;
}
};
AppService = __decorate(
[(0, external_inversify_namespaceObject.injectable)()],
AppService
);
const services_AppService = AppService;
var HistoryEvents,
MediaPlayerState,
MediaPlayerRepeatMode,
MediaPlayerVolume,
MediaPlayerControl,
MediaEvents,
MenuItemType,
NetworkStatus,
UserEvents;
!(function (HistoryEvents) {
HistoryEvents.HistoryChanged = "history-changed";
})(HistoryEvents || (HistoryEvents = {})),
(function (MediaPlayerState) {
(MediaPlayerState.Playing = "playing"),
(MediaPlayerState.Paused = "paused");
})(MediaPlayerState || (MediaPlayerState = {})),
(function (MediaPlayerRepeatMode) {
(MediaPlayerRepeatMode[(MediaPlayerRepeatMode.None = 0)] = "None"),
(MediaPlayerRepeatMode[(MediaPlayerRepeatMode.All = 1)] = "All"),
(MediaPlayerRepeatMode[(MediaPlayerRepeatMode.Once = 2)] = "Once");
})(MediaPlayerRepeatMode || (MediaPlayerRepeatMode = {})),
(function (MediaPlayerVolume) {
(MediaPlayerVolume[(MediaPlayerVolume.Down = -1)] = "Down"),
(MediaPlayerVolume[(MediaPlayerVolume.Up = 1)] = "Up");
})(MediaPlayerVolume || (MediaPlayerVolume = {})),
(function (MediaPlayerControl) {
(MediaPlayerControl.Play = "play"),
(MediaPlayerControl.PlayPause = "play-pause"),
(MediaPlayerControl.Pause = "pause"),
(MediaPlayerControl.Stop = "stop"),
(MediaPlayerControl.Prev = "prev"),
(MediaPlayerControl.Next = "next");
})(MediaPlayerControl || (MediaPlayerControl = {})),
(function (MediaEvents) {
(MediaEvents.PlayerUpdated = "player-updated"),
(MediaEvents.TrackUpdated = "track-updated");
})(MediaEvents || (MediaEvents = {})),
(function (MenuItemType) {
(MenuItemType.About = "about"),
(MenuItemType.Close = "close"),
(MenuItemType.Copy = "copy"),
(MenuItemType.Cut = "cut"),
(MenuItemType.Devtools = "devtools"),
(MenuItemType.Features = "features"),
(MenuItemType.Front = "front"),
(MenuItemType.Hide = "hide"),
(MenuItemType.HideOthers = "hide-others"),
(MenuItemType.HistoryBack = "history-back"),
(MenuItemType.HistoryForward = "history-forward"),
(MenuItemType.Logout = "logout"),
(MenuItemType.Minimize = "minimize"),
(MenuItemType.Open = "open"),
(MenuItemType.Paste = "paste"),
(MenuItemType.PlayerPlay = "player-play"),
(MenuItemType.PlayerNext = "player-next"),
(MenuItemType.PlayerPrev = "player-prev"),
(MenuItemType.PlayerShuffle = "player-shuffle"),
(MenuItemType.PlayerRepeatMode = "player-repeat-mode"),
(MenuItemType.PlayerVolumeUp = "player-volume-up"),
(MenuItemType.PlayerVolumeDown = "player-volume-down"),
(MenuItemType.Preferences = "preferences"),
(MenuItemType.Quit = "quit"),
(MenuItemType.Reload = "reload"),
(MenuItemType.ResetZoom = "reset-zoom"),
(MenuItemType.SelectAll = "select-all"),
(MenuItemType.Separator = "separator"),
(MenuItemType.SwitchProfile = "switch-profile"),
(MenuItemType.ToggleFullScreen = "toggle-full-screen"),
(MenuItemType.Unhide = "unhide"),
(MenuItemType.Version = "version"),
(MenuItemType.ZoomIn = "zoom-in"),
(MenuItemType.ZoomOut = "zoom-out");
})(MenuItemType || (MenuItemType = {})),
(function (NetworkStatus) {
(NetworkStatus.Online = "online"), (NetworkStatus.Offline = "offline");
})(NetworkStatus || (NetworkStatus = {})),
(function (UserEvents) {
(UserEvents.LoggedIn = "logged-in"),
(UserEvents.LoggedOut = "logged-out");
})(UserEvents || (UserEvents = {}));
var ApplicationMenuService_decorate = function (
decorators,
target,
key,
desc
) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
__metadata = function (k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata)
return Reflect.metadata(k, v);
},
__param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
};
let ApplicationMenuService = class {
constructor(history, media, menu, user) {
(this.history = history),
(this.media = media),
(this.menu = menu),
(this.user = user),
this.history.on(HistoryEvents.HistoryChanged, () => {
this.setApplicationMenu();
}),
this.media.addListener(MediaEvents.PlayerUpdated, () => {
this.setApplicationMenu();
}),
this.user.addListener(UserEvents.LoggedIn, () => {
this.setApplicationMenu();
}),
this.user.addListener(UserEvents.LoggedOut, () => {
this.setApplicationMenu();
});
}
init() {
this.setApplicationMenu();
}
popup(options) {
const focusedWindow =
external_electron_namespaceObject.BrowserWindow.getFocusedWindow();
if (!focusedWindow) return;
const browserView = focusedWindow.getBrowserView();
browserView &&
(browserView.webContents.focus(),
external_electron_namespaceObject.Menu.getApplicationMenu().popup(
options
));
}
setHistoryState(history) {
(this.history = Object.assign(this.history, history)),
this.setApplicationMenu();
}
setApplicationMenu() {
external_electron_namespaceObject.Menu.setApplicationMenu(
external_electron_namespaceObject.Menu.buildFromTemplate([
this.getFileMenu(),
this.getEditMenu(),
this.getViewMenu(),
this.getPlayMenu(),
this.getWindowMenu(),
this.getHelpMenu(),
])
);
}
getFileMenu() {
return isPlatform(PLATFORM.DARWIN)
? new external_electron_namespaceObject.MenuItem({
label: external_electron_namespaceObject.app.getName(),
submenu: [
this.menu.getItemOptions(MenuItemType.About),
this.menu.getItemOptions(MenuItemType.Separator),
...this.getFileMenuOptions(),
this.menu.getItemOptions(MenuItemType.Separator),
this.menu.getItemOptions(MenuItemType.Hide),
this.menu.getItemOptions(MenuItemType.HideOthers),
this.menu.getItemOptions(MenuItemType.Unhide),
this.menu.getItemOptions(MenuItemType.Separator),
this.menu.getItemOptions(MenuItemType.Quit),
],
})
: new external_electron_namespaceObject.MenuItem({
label: i18n_t("menu_file_label"),
submenu: this.getFileMenuOptions(),
});
}
getFileMenuOptions() {
const { isFamily } = this.user.getUserInfo(),
isLoggedIn = this.user.isLoggedIn(),
options = [
this.menu.getItemOptions(MenuItemType.Preferences),
this.menu.getItemOptions(MenuItemType.Separator),
];
return (
isFamily &&
options.push(this.menu.getItemOptions(MenuItemType.SwitchProfile)),
isLoggedIn &&
options.push(this.menu.getItemOptions(MenuItemType.Logout)),
options
);
}
getEditMenu() {
return new external_electron_namespaceObject.MenuItem({
label: i18n_t("menu_edit_label"),
submenu: [
this.menu.getItemOptions(MenuItemType.Cut),
this.menu.getItemOptions(MenuItemType.Copy),
this.menu.getItemOptions(MenuItemType.Paste),
this.menu.getItemOptions(MenuItemType.SelectAll),
],
});
}
getViewMenu() {
const devtoolsOptions = [];
return (
hasDevTools() &&
devtoolsOptions.push(
this.menu.getItemOptions(MenuItemType.Reload),
this.menu.getItemOptions(MenuItemType.Devtools),
this.menu.getItemOptions(MenuItemType.Separator)
),
new external_electron_namespaceObject.MenuItem({
label: i18n_t("menu_view_label"),
submenu: [
...devtoolsOptions,
this.menu.getItemOptions(MenuItemType.ZoomIn),
this.menu.getItemOptions(MenuItemType.ZoomOut),
this.menu.getItemOptions(MenuItemType.ResetZoom),
this.menu.getItemOptions(MenuItemType.Separator),
this.menu.getItemOptions(MenuItemType.HistoryBack),
this.menu.getItemOptions(MenuItemType.HistoryForward),
this.menu.getItemOptions(MenuItemType.Separator),
this.menu.getItemOptions(MenuItemType.ToggleFullScreen),
],
})
);
}
getPlayMenu() {
return new external_electron_namespaceObject.MenuItem({
label: i18n_t("menu_play_label"),
submenu: [
this.menu.getItemOptions(MenuItemType.PlayerPlay),
this.menu.getItemOptions(MenuItemType.PlayerNext),
this.menu.getItemOptions(MenuItemType.PlayerPrev),
this.menu.getItemOptions(MenuItemType.Separator),
this.menu.getItemOptions(MenuItemType.PlayerShuffle),
this.menu.getItemOptions(MenuItemType.PlayerRepeatMode),
this.menu.getItemOptions(MenuItemType.Separator),
this.menu.getItemOptions(MenuItemType.PlayerVolumeUp),
this.menu.getItemOptions(MenuItemType.PlayerVolumeDown),
],
});
}
getWindowMenu() {
return new external_electron_namespaceObject.MenuItem({
label: i18n_t("menu_window_label"),
role: "window",
submenu: [
this.menu.getItemOptions(MenuItemType.Minimize),
this.menu.getItemOptions(MenuItemType.Close),
this.menu.getItemOptions(MenuItemType.Separator),
this.menu.getItemOptions(MenuItemType.Front),
],
});
}
getHelpMenu() {
return new external_electron_namespaceObject.MenuItem({
label: i18n_t("menu_help_label"),
role: "help",
submenu: [
this.menu.getItemOptions(MenuItemType.Version),
this.menu.getItemOptions(MenuItemType.Features),
],
});
}
};
ApplicationMenuService = ApplicationMenuService_decorate(
[
(0, external_inversify_namespaceObject.injectable)(),
__param(
0,
(0, external_inversify_namespaceObject.inject)(SERVICE_HISTORY)
),
__param(
1,
(0, external_inversify_namespaceObject.inject)(SERVICE_MEDIA)
),
__param(
2,
(0, external_inversify_namespaceObject.inject)(SERVICE_MENU)
),
__param(
3,
(0, external_inversify_namespaceObject.inject)(SERVICE_USER)
),
__metadata("design:paramtypes", [Object, Object, Object, Object]),
],
ApplicationMenuService
);
const services_ApplicationMenuService = ApplicationMenuService;
var AutoStartService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let AutoStartService = class {
initLoginItem() {
external_electron_settings_default().hasSync("loginHasBeenInit") ||
this.setAutoStart(!0);
}
isOpenAtLogin() {
const { openAtLogin } =
external_electron_namespaceObject.remote.app.getLoginItemSettings();
return openAtLogin || !1;
}
setAutoStart(enableAutoStart) {
this._updateLoginItem({ openAtLogin: enableAutoStart }),
external_electron_settings_default().setSync("loginHasBeenInit", !0);
}
_updateLoginItem(update) {
external_electron_namespaceObject.remote.app.setLoginItemSettings(
Object.assign(
{},
external_electron_namespaceObject.remote.app.getLoginItemSettings(),
update
)
);
}
};
AutoStartService = AutoStartService_decorate(
[(0, external_inversify_namespaceObject.injectable)()],
AutoStartService
);
const services_AutoStartService = AutoStartService;
var CookieService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let CookieService = class {
init() {
this.cookies ||
((this.cookies =
external_electron_namespaceObject.session.defaultSession.cookies),
this.cookies.on("changed", (event, cookie, cause, removed) => {
cookie.session &&
!removed &&
-1 !== cookie.domain.indexOf(application.tld) &&
this.persist(
cookie,
Math.floor(new Date().getTime() / 1e3) + 1209600
);
}));
}
flushStore() {
return this.cookies
.flushStore()
.then(() => {
external_electron_log_default().info(
"Cookie: The cookie store has been flushed successfully."
);
})
.catch(err => {
external_electron_log_default().error(
"Cookie: An error has occured while flushing the store.",
err
);
});
}
persist(cookie, expirationDate) {
external_electron_log_default().info(
`Cookie: Persisting the cookie "${cookie.name}" with value "${cookie.value}" for two weeks.`
),
this.cookies
.set({
url: external_url_default().format({
protocol: cookie.secure ? "https" : "http",
host:
"." === cookie.domain.charAt(0)
? cookie.domain.substring(1)
: cookie.domain,
pathname: cookie.path,
}),
name: cookie.name,
value: cookie.value,
domain: cookie.domain,
path: cookie.path,
secure: cookie.secure,
httpOnly: cookie.httpOnly,
sameSite: cookie.sameSite,
expirationDate,
})
.then(() => {
this.flushStore();
})
.catch(err => {
external_electron_log_default().error(
`Cookie: An error has occured while persisting the cookie "${cookie.name}".`,
cookie,
external_url_default().format({
protocol: cookie.secure ? "https" : "http",
host: cookie.domain,
pathname: cookie.path,
}),
err
);
});
}
};
CookieService = CookieService_decorate(
[(0, external_inversify_namespaceObject.injectable)()],
CookieService
);
const services_CookieService = CookieService;
var DeepLinkService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
DeepLinkService_metadata = function (k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata)
return Reflect.metadata(k, v);
},
DeepLinkService_param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
};
let DeepLinkService = class {
constructor(ipc, user, app) {
(this.schemes = ["dzr", "deezer"]),
(this.ignorePatterns = [
/^\/account\/apps(\/*)$/,
/^\/app\/(.+)(\/*)$/,
/^\/appstudio(\/*)$/,
/^\/profile\/(.+)\/applications(\/*)$/,
/^\/profile\/(.+)\/apps(\/*)$/,
]),
(this.ipc = ipc),
(this.user = user),
(this.app = app);
}
getSchemes() {
return this.schemes;
}
getPathFromArgv(argv) {
const matcher = new RegExp(`^(${this.schemes.join("|")})://`),
url = argv.find(value => matcher.test(value));
return url ? this.getPathFromUrl(url) : "/";
}
getPathFromUrl(url) {
let path = url.split("://").pop();
const domainName = getDomainName();
return (
path.includes(domainName) && (path = path.replace(domainName, "")),
"/" !== path.charAt(0) && (path = "/".concat(path)),
path
);
}
handlePath(path) {
if (
(this.ignorePatterns.forEach(pattern => {
pattern.test(path) &&
external_electron_log_default().info(
`DeepLink: The path "${path}" is ignored.`
);
}),
path.startsWith("/autolog"))
)
this.handleAutolog(path);
else {
if (!path.startsWith("/flushCache"))
return path.startsWith("/reload")
? (external_electron_log_default().info(
"DeepLink: reloading the app."
),
void this.ipc.send("app-reload-request"))
: void (this.user.isLoggedIn()
? (external_electron_log_default().info(
`DeepLink: Handling the path "${path}".`
),
this.ipc.send("app-go-to-raw", path))
: external_electron_log_default().error(
"DeepLink: The user should be logged in before handling the path."
));
this.handleFlushCache();
}
}
handleAutolog(path) {
const arl = path.match(/^\/autolog\/(\w+)$/)[1];
arl
? (external_electron_log_default().info(
`DeepLink: Trying to login with arl token from path "${path}".`
),
this.user.loginWithArl(arl, this.getPathFromArgv(process.argv)))
: external_electron_log_default().error(
`DeepLink: Arl token is not found in path: ${path}.`
);
}
handleFlushCache() {
external_electron_log_default().info("DeepLink: Flushing the cache."),
this.app.clearAppDataAndRestart();
}
};
DeepLinkService = DeepLinkService_decorate(
[
(0, external_inversify_namespaceObject.injectable)(),
DeepLinkService_param(
0,
(0, external_inversify_namespaceObject.inject)(SERVICE_IPC)
),
DeepLinkService_param(
1,
(0, external_inversify_namespaceObject.inject)(SERVICE_USER)
),
DeepLinkService_param(
2,
(0, external_inversify_namespaceObject.inject)(SERVICE_APPLICATION)
),
DeepLinkService_metadata("design:paramtypes", [Object, Object, Object]),
],
DeepLinkService
);
const services_DeepLinkService = DeepLinkService;
var HistoryService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let HistoryService = class extends external_events_namespaceObject.EventEmitter {
constructor() {
super(...arguments),
(this.history = { canGoBack: !1, canGoForward: !1 });
}
setHistoryInfo(history) {
(this.history = Object.assign(this.history, history)),
this.emit(HistoryEvents.HistoryChanged);
}
getHistoryInfo() {
return this.history;
}
};
HistoryService = HistoryService_decorate(
[(0, external_inversify_namespaceObject.injectable)()],
HistoryService
);
const services_HistoryService = HistoryService;
var IpcService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
IpcService_metadata = function (k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata)
return Reflect.metadata(k, v);
},
IpcService_param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
};
let IpcService = class {
constructor(appService) {
this.appService = appService;
}
on(channel, listener) {
external_electron_namespaceObject.ipcMain.on(channel, listener);
}
send(channel, ...args) {
this.appService.getWebContents().send(channel, ...args);
}
emit(channel, ...args) {
external_electron_namespaceObject.ipcMain.emit(
channel,
void 0,
...args
);
}
};
IpcService = IpcService_decorate(
[
(0, external_inversify_namespaceObject.injectable)(),
IpcService_param(
0,
(0, external_inversify_namespaceObject.inject)(SERVICE_APPLICATION)
),
IpcService_metadata("design:paramtypes", [Object]),
],
IpcService
);
const services_IpcService = IpcService,
external_lodash_debounce_namespaceObject = require("lodash.debounce");
var external_lodash_debounce_default = __webpack_require__.n(
external_lodash_debounce_namespaceObject
),
MediaService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
MediaService_metadata = function (k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata)
return Reflect.metadata(k, v);
},
MediaService_param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
};
let MediaService = class extends external_events_namespaceObject.EventEmitter {
constructor(ipc, user) {
super(),
(this.smtc = null),
(this.track = {}),
(this.player = {}),
(this.debounceDelay = 300),
(this.debounceOptions = { leading: !0, maxWait: 500 }),
(this.ipc = ipc),
(this.user = user),
isPlatform(PLATFORM.LINUX) &&
(this.user.addListener(UserEvents.LoggedIn, () => {
this.start();
}),
this.user.addListener(UserEvents.LoggedOut, () => {
this.stop();
}));
}
play() {
this.ipc.send("channel-player-media-control", MediaPlayerControl.Play);
}
pause() {
this.ipc.send("channel-player-media-control", MediaPlayerControl.Pause);
}
next() {
this.ipc.send("channel-player-media-control", MediaPlayerControl.Next);
}
prev() {
this.ipc.send("channel-player-media-control", MediaPlayerControl.Prev);
}
increaseVolume() {
this.ipc.send("channel-player-volume-update", MediaPlayerVolume.Up);
}
decreaseVolume() {
this.ipc.send("channel-player-volume-update", MediaPlayerVolume.Down);
}
setSuffle(shuffle) {
this.ipc.send("channel-player-shuffle-update", shuffle);
}
setRepeatMode(repeatMode) {
this.ipc.send("channel-player-repeat-mode-update", repeatMode);
}
setTrackInfo(track) {
(this.track = Object.assign(this.track, track)),
this.emit(MediaEvents.TrackUpdated, this.track);
}
setPlayerInfo(player) {
(this.player = Object.assign(this.player, player)),
this.emit(MediaEvents.PlayerUpdated, this.player);
}
getTrackInfo() {
return this.track;
}
getPlayerInfo() {
return this.player;
}
start() {
external_electron_namespaceObject.globalShortcut.register(
"mediaplaypause",
external_lodash_debounce_default()(
this.handleMediaControl.bind(this, MediaPlayerControl.PlayPause),
this.debounceDelay,
this.debounceOptions
)
),
external_electron_namespaceObject.globalShortcut.register(
"mediastop",
external_lodash_debounce_default()(
this.handleMediaControl.bind(this, MediaPlayerControl.Stop),
this.debounceDelay,
this.debounceOptions
)
),
external_electron_namespaceObject.globalShortcut.register(
"mediaprevioustrack",
external_lodash_debounce_default()(
this.handleMediaControl.bind(this, MediaPlayerControl.Prev),
this.debounceDelay,
this.debounceOptions
)
),
external_electron_namespaceObject.globalShortcut.register(
"medianexttrack",
external_lodash_debounce_default()(
this.handleMediaControl.bind(this, MediaPlayerControl.Next),
this.debounceDelay,
this.debounceOptions
)
);
}
stop() {
external_electron_namespaceObject.globalShortcut.unregisterAll();
}
handleMediaControl(control) {
this.ipc.send("channel-player-media-control", control);
}
};
MediaService = MediaService_decorate(
[
(0, external_inversify_namespaceObject.injectable)(),
MediaService_param(
0,
(0, external_inversify_namespaceObject.inject)(SERVICE_IPC)
),
MediaService_param(
1,
(0, external_inversify_namespaceObject.inject)(SERVICE_USER)
),
MediaService_metadata("design:paramtypes", [Object, Object]),
],
MediaService
);
const services_MediaService = MediaService;
var MenuService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
MenuService_metadata = function (k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata)
return Reflect.metadata(k, v);
},
MenuService_param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
};
function noAcceleratorTrigger(fn) {
return (item, window, event) => {
event.triggeredByAccelerator || fn();
};
}
let MenuService = class {
constructor(app, ipc, history, media, user) {
(this.ipc = ipc),
(this.app = app),
(this.history = history),
(this.media = media),
(this.user = user);
}
getItem(item) {
return new external_electron_namespaceObject.MenuItem(
this.getItemOptions(item)
);
}
getItemOptions(item) {
switch (item) {
case MenuItemType.About:
return this.getAboutOptions();
case MenuItemType.Close:
return this.getCloseOptions();
case MenuItemType.Copy:
return this.getCopyOptions();
case MenuItemType.Cut:
return this.getCutOptions();
case MenuItemType.Devtools:
return this.getDevtoolsOptions();
case MenuItemType.Features:
return this.getFeaturesOptions();
case MenuItemType.Front:
return this.getFrontOptions();
case MenuItemType.Hide:
return this.getHideOptions();
case MenuItemType.HideOthers:
return this.getHideOthersOptions();
case MenuItemType.HistoryBack:
return this.getHistoryBackOptions();
case MenuItemType.HistoryForward:
return this.getHistoryForwardOptions();
case MenuItemType.Logout:
return this.getLogoutOptions();
case MenuItemType.Minimize:
return this.getMinimizeOptions();
case MenuItemType.Open:
return this.getOpenOptions();
case MenuItemType.Paste:
return this.getPasteOptions();
case MenuItemType.PlayerPlay:
return this.getPlayerPlayOptions();
case MenuItemType.PlayerNext:
return this.getPlayerNextOptions();
case MenuItemType.PlayerPrev:
return this.getPlayerPrevOptions();
case MenuItemType.PlayerShuffle:
return this.getPlayerShuffleOptions();
case MenuItemType.PlayerRepeatMode:
return this.getPlayerRepeatModeOptions();
case MenuItemType.PlayerVolumeUp:
return this.getPlayerVolumeUpOptions();
case MenuItemType.PlayerVolumeDown:
return this.getPlayerVolumeDownOptions();
case MenuItemType.Preferences:
return this.getPreferencesOptions();
case MenuItemType.Quit:
return this.getQuitOptions();
case MenuItemType.Reload:
return this.getReloadOptions();
case MenuItemType.ResetZoom:
return this.getResetZoomOptions();
case MenuItemType.SelectAll:
return this.getSelectAllOptions();
case MenuItemType.Separator:
return this.getSeparatorOptions();
case MenuItemType.SwitchProfile:
return this.getSwitchProfileOptions();
case MenuItemType.ToggleFullScreen:
return this.getToggleFullScreenOptions();
case MenuItemType.Unhide:
return this.getUnhideOptions();
case MenuItemType.Version:
return this.getVersionOptions();
case MenuItemType.ZoomIn:
return this.getZoomInOptions();
case MenuItemType.ZoomOut:
return this.getZoomOutOptions();
default:
return {};
}
}
getAboutOptions() {
return { label: i18n_t("menu_about_label"), role: "about" };
}
getCloseOptions() {
return { label: i18n_t("menu_close_label"), role: "close" };
}
getCopyOptions() {
return { label: i18n_t("menu_copy_label"), role: "copy" };
}
getCutOptions() {
return { label: i18n_t("menu_cut_label"), role: "cut" };
}
getDevtoolsOptions() {
return {
label: "Toggle Developper tools",
accelerator: isPlatform(PLATFORM.DARWIN)
? "Cmd+Option+I"
: "Ctrl+Shift+I",
click: () => {
external_electron_namespaceObject.BrowserWindow.getFocusedWindow().getBrowserView()
? external_electron_namespaceObject.BrowserWindow.getFocusedWindow()
.getBrowserView()
.webContents.toggleDevTools()
: external_electron_namespaceObject.BrowserWindow.getFocusedWindow().webContents.toggleDevTools();
},
};
}
getFeaturesOptions() {
return {
label: i18n_t("menu_about_label"),
click: () => {
external_electron_namespaceObject.shell.openExternal(
"https://www.deezer.com/features"
);
},
};
}
getFrontOptions() {
return { label: i18n_t("menu_bring-front_label"), role: "front" };
}
getHideOptions() {
return { label: i18n_t("menu_hide-deezer_label"), role: "hide" };
}
getHideOthersOptions() {
return { label: i18n_t("menu_hide-others_label"), role: "hideOthers" };
}
getHistoryBackOptions() {
const { canGoBack } = this.history.getHistoryInfo();
return {
label: i18n_t("menu_go-back_label"),
enabled: canGoBack && this.user.isLoggedIn(),
click: () => {
this.app.getWebContents().goBack();
},
};
}
getHistoryForwardOptions() {
const { canGoForward } = this.history.getHistoryInfo();
return {
label: i18n_t("menu_go-forward_label"),
enabled: canGoForward && this.user.isLoggedIn(),
click: () => {
this.app.getWebContents().goForward();
},
};
}
getLogoutOptions() {
return {
label: i18n_t("menu_log-out_label"),
click: () => {
this.user.logOut();
},
};
}
getMinimizeOptions() {
return { label: i18n_t("menu_minimize_label"), role: "minimize" };
}
getOpenOptions() {
return {
label: i18n_t("menu_title_opendeezer_electron"),
click: () => {
this.app.getWindow().show();
},
};
}
getPasteOptions() {
return { label: i18n_t("menu_paste_label"), role: "paste" };
}
getPlayerPlayOptions() {
const { state } = this.media.getPlayerInfo(),
isPlaying = state === MediaPlayerState.Playing;
return {
label: i18n_t(isPlaying ? "menu_pause_label" : "menu_play_label"),
enabled: this.user.isLoggedIn(),
accelerator: "Space",
click: noAcceleratorTrigger(() => {
isPlaying ? this.media.pause() : this.media.play();
}),
};
}
getPlayerNextOptions() {
const { canNext } = this.media.getPlayerInfo();
return {
label: i18n_t("menu_next_label"),
enabled: this.user.isLoggedIn() && canNext,
accelerator: "Shift+Right",
click: noAcceleratorTrigger(() => {
this.media.next();
}),
};
}
getPlayerPrevOptions() {
const { canPrev } = this.media.getPlayerInfo();
return {
label: i18n_t("menu_previous_label"),
enabled: this.user.isLoggedIn() && canPrev,
accelerator: "Shift+Left",
click: noAcceleratorTrigger(() => {
this.media.prev();
}),
};
}
getPlayerShuffleOptions() {
const { canShuffle, shuffle } = this.media.getPlayerInfo();
return {
label: i18n_t("menu_shuffle_label"),
enabled: this.user.isLoggedIn() && canShuffle,
submenu: [
{
label: i18n_t("menu_on_label"),
type: "radio",
checked: shuffle,
click: () => {
this.media.setSuffle(!0);
},
},
{
label: i18n_t("menu_off_label"),
type: "radio",
checked: !shuffle,
click: () => {
this.media.setSuffle(!1);
},
},
],
};
}
getPlayerRepeatModeOptions() {
const { canRepeat, repeatMode } = this.media.getPlayerInfo();
return {
label: i18n_t("menu_repeat_label"),
enabled: this.user.isLoggedIn() && canRepeat,
submenu: [
{
label: i18n_t("menu_off_label"),
type: "radio",
checked: repeatMode === MediaPlayerRepeatMode.None,
click: () => {
this.media.setRepeatMode(0);
},
},
{
label: i18n_t("menu_all_label"),
type: "radio",
checked: repeatMode === MediaPlayerRepeatMode.All,
click: () => {
this.media.setRepeatMode(1);
},
},
{
label: i18n_t("menu_one_label"),
type: "radio",
checked: repeatMode === MediaPlayerRepeatMode.Once,
click: () => {
this.media.setRepeatMode(2);
},
},
],
};
}
getPlayerVolumeUpOptions() {
return {
label: i18n_t("menu_volume-up_label"),
accelerator: "CmdOrCtrl+Up",
enabled: this.user.isLoggedIn(),
click: () => {
this.media.increaseVolume();
},
};
}
getPlayerVolumeDownOptions() {
return {
label: i18n_t("menu_volume-down_label"),
accelerator: "CmdOrCtrl+Down",
enabled: this.user.isLoggedIn(),
click: () => {
this.media.decreaseVolume();
},
};
}
getPreferencesOptions() {
return {
label: i18n_t("menu_preferences_label"),
enabled: this.user.isLoggedIn(),
click: () => {
this.ipc.send("app-go-to-raw", "#/account");
},
};
}
getQuitOptions() {
return { label: i18n_t("menu_quit-deezer_label"), role: "quit" };
}
getReloadOptions() {
return {
label: "Clear AppData and restart",
click: () => {
this.app.clearAppDataAndRestart();
},
};
}
getResetZoomOptions() {
return { label: i18n_t("menu_actual-size_label"), role: "resetZoom" };
}
getSelectAllOptions() {
return { label: i18n_t("menu_select-all_label"), role: "selectAll" };
}
getSeparatorOptions() {
return { type: "separator" };
}
getSwitchProfileOptions() {
return {
label: i18n_t("menu_switch-profile_label"),
enabled: this.user.isLoggedIn(),
click: () => {
this.user.switchProfile();
},
};
}
getToggleFullScreenOptions() {
return {
label: i18n_t("menu_enter-full-screen_label"),
role: "togglefullscreen",
};
}
getUnhideOptions() {
return { label: i18n_t("menu_show-all_label"), role: "unhide" };
}
getVersionOptions() {
return {
label: `Deezer ${external_electron_namespaceObject.app.getVersion()}`,
};
}
getZoomInOptions() {
return { label: i18n_t("menu_zoom-in_label"), role: "zoomIn" };
}
getZoomOutOptions() {
return { label: i18n_t("menu_zoom-out_label"), role: "zoomOut" };
}
};
MenuService = MenuService_decorate(
[
(0, external_inversify_namespaceObject.injectable)(),
MenuService_param(
0,
(0, external_inversify_namespaceObject.inject)(SERVICE_APPLICATION)
),
MenuService_param(
1,
(0, external_inversify_namespaceObject.inject)(SERVICE_IPC)
),
MenuService_param(
2,
(0, external_inversify_namespaceObject.inject)(SERVICE_HISTORY)
),
MenuService_param(
3,
(0, external_inversify_namespaceObject.inject)(SERVICE_MEDIA)
),
MenuService_param(
4,
(0, external_inversify_namespaceObject.inject)(SERVICE_USER)
),
MenuService_metadata("design:paramtypes", [
Object,
Object,
Object,
Object,
Object,
]),
],
MenuService
);
const services_MenuService = MenuService,
external_dns_namespaceObject = require("dns");
var external_dns_default = __webpack_require__.n(
external_dns_namespaceObject
),
NetworkService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
NetworkService_metadata = function (k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata)
return Reflect.metadata(k, v);
},
NetworkService_param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
};
let NetworkService = class {
constructor(ipc) {
(this.dnsHostname = "deezer.com"),
(this.watchIntervalDelay = 5e3),
(this.ipc = ipc);
}
watch() {
this.stopWatch(),
this.checkStatus(),
(this.watchIntervalId = setInterval(
this.checkStatus.bind(this),
this.watchIntervalDelay
));
}
stopWatch() {
this.watchIntervalId && clearInterval(this.watchIntervalId);
}
checkStatus() {
external_dns_default().lookup(this.dnsHostname, err => {
const status = err ? NetworkStatus.Offline : NetworkStatus.Online;
this.status !== status &&
(status === NetworkStatus.Offline
? (external_electron_log_default().info(
"Network: the status is now offline."
),
external_electron_log_default().debug(
`Network: the dns lookup has failed: ${err.code}`
))
: external_electron_log_default().info(
"Network: the status is now online."
),
(this.status = status),
this.ipc.send("channel-network-changed", status));
});
}
};
NetworkService = NetworkService_decorate(
[
(0, external_inversify_namespaceObject.injectable)(),
NetworkService_param(
0,
(0, external_inversify_namespaceObject.inject)(SERVICE_IPC)
),
NetworkService_metadata("design:paramtypes", [Object]),
],
NetworkService
);
const services_NetworkService = NetworkService;
var PowerSaveService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let PowerSaveService = class {
start() {
if (this.isStarted())
return void external_electron_log_default().info(
"PowerSave: Trying to start the power block saver but it is already started"
);
const blockerId =
external_electron_namespaceObject.powerSaveBlocker.start(
"prevent-app-suspension"
);
external_electron_settings_default().setSync(
"powerSaveBlockerId",
blockerId
),
external_electron_log_default().info(
`PowerSave: The power save blocker is started with id ${blockerId}`
);
}
stop() {
this.isStarted()
? (external_electron_namespaceObject.powerSaveBlocker.stop(
this.getBlockerId()
),
external_electron_settings_default().unsetSync(
"powerSaveBlockerId"
),
external_electron_log_default().info(
"PowerSave: The power save blocker is stopped"
))
: external_electron_log_default().info(
"PowerSave: Trying to stop the power block saver but it is not started"
);
}
check() {
this.isStarted() &&
(external_electron_log_default().info(
"PowerSave: Stopping the power save blocker because it was still started after last app open"
),
this.stop());
}
getBlockerId() {
return external_electron_settings_default().getSync(
"powerSaveBlockerId"
);
}
isStarted() {
return (
!!external_electron_settings_default().hasSync(
"powerSaveBlockerId"
) &&
external_electron_namespaceObject.powerSaveBlocker.isStarted(
this.getBlockerId()
)
);
}
};
PowerSaveService = PowerSaveService_decorate(
[(0, external_inversify_namespaceObject.injectable)()],
PowerSaveService
);
const services_PowerSaveService = PowerSaveService;
var SentryService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
SentryService_metadata = function (k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata)
return Reflect.metadata(k, v);
},
SentryService_param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
};
let SentryService = class {
constructor(user) {
(this.dsn =
"https://abd0bbee36f24c6b953e9e83af19c620:f43143178f0e40e0b62b92de67b7fa73@sentry.io/251420"),
(this.shouldSend = Math.random() > 0.08),
(this.user = user),
this.user.addListener(UserEvents.LoggedIn, () => {
this.setContext(this.getUserData());
}),
this.user.addListener(UserEvents.LoggedOut, () => {
this.setContext(this.getUserData());
});
}
init() {
this.client ||
((this.client = external_raven_default()
.config(this.dsn, {
release: external_electron_namespaceObject.app.getVersion(),
allowSecretKey: !0,
environment: isDev() ? "development" : "production",
debug: isDev(),
shouldSendCallback: () => this.shouldSend,
})
.install()),
this.setContext(this.getUserData()),
process.on("uncaughtException", err => {
external_raven_default().captureException(err);
}));
}
getUserData() {
const userInfo = this.user.getUserInfo();
return (
(this.shouldSend =
userInfo.gatekeeps && 1 == userInfo.gatekeeps.sentry),
{
id: userInfo.id.toString(),
isEmployeeUser: userInfo.isEmployee,
offerId: userInfo.offerId ? userInfo.offerId.toString() : "",
country: userInfo.country,
}
);
}
setContext(user) {
this.client.setContext({
user: { id: user.id, isEmployeeUser: user.isEmployeeUser },
tags: Object.assign(
{ country: user.country, offerId: user.offerId },
{
environment: isDev ? "development" : "production",
os: `${external_os_default().type()} ${external_os_default().release()}`,
"os.name": external_os_default().type(),
arch: process.arch,
}
),
});
}
};
SentryService = SentryService_decorate(
[
(0, external_inversify_namespaceObject.injectable)(),
SentryService_param(
0,
(0, external_inversify_namespaceObject.inject)(SERVICE_USER)
),
SentryService_metadata("design:paramtypes", [Object]),
],
SentryService
);
const services_SentryService = SentryService;
var ThumbarService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
ThumbarService_metadata = function (k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata)
return Reflect.metadata(k, v);
},
ThumbarService_param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
};
let ThumbarService = class {
constructor(app, media, user) {
(this.app = app),
(this.media = media),
(this.user = user),
this.media.addListener(MediaEvents.PlayerUpdated, () => {
this.setButtons();
}),
this.media.addListener(MediaEvents.TrackUpdated, () => {
this.setButtons();
}),
this.user.addListener(UserEvents.LoggedIn, () => {
this.setButtons();
}),
this.user.addListener(UserEvents.LoggedOut, () => {
this.setButtons();
});
}
init() {
this.setButtons();
}
setButtons() {
this.isSupported() &&
this.app.getWindow().setThumbarButtons(this.getButtons());
}
getButtons() {
return [
this.getButtonPrev(),
this.getButtonPlayPause(),
this.getButtonNext(),
];
}
getButtonPrev() {
const { canPrev } = this.media.getPlayerInfo(),
isDisabled = !this.user.isLoggedIn() || !canPrev,
flags = [];
return (
isDisabled && flags.push("disabled"),
{
icon: external_electron_namespaceObject.nativeImage.createFromPath(
external_path_default().resolve(
process.resourcesPath,
`win/previous${isDisabled ? "_inactive" : ""}.png`
)
),
click: () => {
this.media.prev();
},
tooltip: i18n_t("menu_previous_label"),
flags,
}
);
}
getButtonPlayPause() {
const { state } = this.media.getPlayerInfo(),
isDisabled = !this.user.isLoggedIn(),
isPlaying = state === MediaPlayerState.Playing,
iconName = isPlaying ? "pause" : "play",
flags = [];
return (
isDisabled && flags.push("disabled"),
{
icon: external_electron_namespaceObject.nativeImage.createFromPath(
external_path_default().resolve(
process.resourcesPath,
`win/${iconName}${
!isPlaying && isDisabled ? "_inactive" : ""
}.png`
)
),
click: () => {
isPlaying ? this.media.pause() : this.media.play();
},
tooltip: i18n_t(isPlaying ? "menu_pause_label" : "menu_play_label"),
flags,
}
);
}
getButtonNext() {
const { canNext } = this.media.getPlayerInfo(),
isDisabled = !this.user.isLoggedIn() || !canNext,
flags = [];
return (
isDisabled && flags.push("disabled"),
{
icon: external_electron_namespaceObject.nativeImage.createFromPath(
external_path_default().resolve(
process.resourcesPath,
`win/next${isDisabled ? "_inactive" : ""}.png`
)
),
click: () => {
this.media.next();
},
tooltip: i18n_t("menu_next_label"),
flags,
}
);
}
isSupported() {
return isPlatform(PLATFORM.WINDOWS);
}
};
ThumbarService = ThumbarService_decorate(
[
(0, external_inversify_namespaceObject.injectable)(),
ThumbarService_param(
0,
(0, external_inversify_namespaceObject.inject)(SERVICE_APPLICATION)
),
ThumbarService_param(
1,
(0, external_inversify_namespaceObject.inject)(SERVICE_MEDIA)
),
ThumbarService_param(
2,
(0, external_inversify_namespaceObject.inject)(SERVICE_USER)
),
ThumbarService_metadata("design:paramtypes", [Object, Object, Object]),
],
ThumbarService
);
const services_ThumbarService = ThumbarService;
var TrayService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
TrayService_metadata = function (k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata)
return Reflect.metadata(k, v);
},
TrayService_param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
};
let TrayService = class {
constructor(app, media, menu, user) {
(this.app = app),
(this.media = media),
(this.menu = menu),
(this.user = user),
this.media.addListener(MediaEvents.PlayerUpdated, () => {
this.setContextMenu();
}),
this.media.addListener(MediaEvents.TrackUpdated, track => {
this.setToolTip(`${track.title} - ${track.artist}`),
this.setContextMenu();
}),
this.user.addListener(UserEvents.LoggedIn, () => {
this.setContextMenu();
}),
this.user.addListener(UserEvents.LoggedOut, () => {
this.setToolTip(this.app.getName()), this.setContextMenu();
});
}
init() {
this.isSupported() &&
(this.tray
? external_electron_log_default().info(
"Tray: trying to create a new tray icon but it has already been created."
)
: ((this.tray = new external_electron_namespaceObject.Tray(
getAppIcon()
)),
this.tray.setIgnoreDoubleClickEvents(isPlatform(PLATFORM.DARWIN)),
this.tray.on("click", () => {
this.app.getWindow().show();
}),
this.setToolTip(this.app.getName()),
this.setContextMenu()));
}
setToolTip(tooltip) {
this.tray && this.tray.setToolTip(tooltip);
}
setContextMenu() {
this.tray &&
this.tray.setContextMenu(
external_electron_namespaceObject.Menu.buildFromTemplate([
this.menu.getItem(MenuItemType.Open),
this.menu.getItem(MenuItemType.Separator),
this.menu.getItem(MenuItemType.PlayerPlay),
this.menu.getItem(MenuItemType.PlayerNext),
this.menu.getItem(MenuItemType.PlayerPrev),
this.menu.getItem(MenuItemType.Separator),
this.menu.getItem(MenuItemType.Quit),
])
);
}
isSupported() {
return (function (requiredVersions) {
requiredVersions = Object.assign(
{},
defaultRequiredVersions,
requiredVersions
);
const platformCurrent = getPlatformName(),
platformVersion = external_semver_default().valid(
external_semver_default().coerce(getPlatformVersion())
);
return (
platformCurrent !== PLATFORM.UNKNOWN &&
external_semver_default().satisfies(
platformVersion,
requiredVersions[platformCurrent]
)
);
})({ [PLATFORM.WINDOWS]: "<6.2 || >=10.0.0" });
}
};
TrayService = TrayService_decorate(
[
(0, external_inversify_namespaceObject.injectable)(),
TrayService_param(
0,
(0, external_inversify_namespaceObject.inject)(SERVICE_APPLICATION)
),
TrayService_param(
1,
(0, external_inversify_namespaceObject.inject)(SERVICE_MEDIA)
),
TrayService_param(
2,
(0, external_inversify_namespaceObject.inject)(SERVICE_MENU)
),
TrayService_param(
3,
(0, external_inversify_namespaceObject.inject)(SERVICE_USER)
),
TrayService_metadata("design:paramtypes", [
Object,
Object,
Object,
Object,
]),
],
TrayService
);
const services_TrayService = TrayService,
external_electron_updater_namespaceObject = require("electron-updater");
var UpdaterService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
UpdaterService_metadata = function (k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata)
return Reflect.metadata(k, v);
},
UpdaterService_param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
},
UpdaterService_awaiter = function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
}
function step(result) {
var value;
result.done
? resolve(result.value)
: ((value = result.value),
value instanceof P
? value
: new P(function (resolve) {
resolve(value);
})).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
let UpdaterService = class {
constructor(ipc, user) {
switch (
((this.ipc = ipc), (this.user = user), external_os_default().arch())
) {
case "ia32":
case "x32":
case "x86":
this.arch = "x86";
break;
case "x64":
this.arch = "x64";
break;
default:
external_electron_log_default().error(
`Updater: the architecture ${external_os_default().arch()} is not supported`
);
}
}
init() {
this.arch &&
((isPlatform(PLATFORM.LINUX) && !process.env.APPIMAGE) ||
isWindowsStore() ||
"yes" === process.env.DZ_DISABLE_UPDATE ||
((external_electron_updater_namespaceObject.autoUpdater.autoDownload =
!0),
external_electron_updater_namespaceObject.autoUpdater.on(
"error",
error => {
external_electron_log_default().debug(
"Updater: error in update",
error
);
}
),
external_electron_updater_namespaceObject.autoUpdater.on(
"checking-for-update",
() => {
external_electron_log_default().debug(
"Updater: checking for update"
);
}
),
external_electron_updater_namespaceObject.autoUpdater.on(
"update-available",
info => {
external_electron_log_default().debug(
"Updater: update available",
info
);
}
),
external_electron_updater_namespaceObject.autoUpdater.on(
"update-not-available",
() => {
external_electron_log_default().debug(
"Updater: update not available"
);
}
),
external_electron_updater_namespaceObject.autoUpdater.on(
"download-progress",
progress => {
external_electron_log_default().debug(
"Updater: download progress",
progress
);
}
),
external_electron_updater_namespaceObject.autoUpdater.on(
"update-downloaded",
info => {
external_electron_log_default().debug(
"Updater: update downloaded",
info
),
this.ipc.send("channel-updater-downloaded", info);
}
),
setTimeout(() => {
this.checkForUpdates();
}, 2e4),
setInterval(() => {
this.checkForUpdates();
}, 216e5)));
}
install() {
this.arch &&
((this.isUpdating = !0),
external_electron_updater_namespaceObject.autoUpdater.quitAndInstall());
}
setUpdateTarget() {
const userInfo = this.user.getUserInfo(),
isEmployee = userInfo.isEmployee,
userId = userInfo.id,
urlParams = {
pathname: "/desktop/update",
host: getDomainName(),
protocol: "https:",
slashes: !0,
query: {
userId: userId || 0,
currentVersion:
external_electron_namespaceObject.app.getVersion(),
architecture: this.arch,
platform: external_os_default().platform(),
platformVersion: getPlatformVersion(),
employee: isEmployee ? "yes" : "no",
},
},
updateUrl = external_url_default().format(urlParams);
external_electron_log_default().debug("Setting feed URL: ", updateUrl),
external_electron_updater_namespaceObject.autoUpdater.setFeedURL(
updateUrl
);
}
checkForUpdates() {
return UpdaterService_awaiter(this, void 0, void 0, function* () {
external_electron_log_default().debug("Setting update target"),
this.setUpdateTarget(),
external_electron_log_default().debug("Checking for update");
try {
yield external_electron_updater_namespaceObject.autoUpdater.checkForUpdates();
} catch (ex) {
const err = new Error("Auto updater: " + ex.message);
(err.stack = ex.stack), external_electron_log_default().warn(err);
}
});
}
};
UpdaterService = UpdaterService_decorate(
[
(0, external_inversify_namespaceObject.injectable)(),
UpdaterService_param(
0,
(0, external_inversify_namespaceObject.inject)(SERVICE_IPC)
),
UpdaterService_param(
1,
(0, external_inversify_namespaceObject.inject)(SERVICE_USER)
),
UpdaterService_metadata("design:paramtypes", [Object, Object]),
],
UpdaterService
);
const services_UpdaterService = UpdaterService;
var UserService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
UserService_metadata = function (k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata)
return Reflect.metadata(k, v);
},
UserService_param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
};
let UserService = class extends external_events_namespaceObject.EventEmitter {
constructor(ipc, app) {
super(),
(this.user = { id: -1, isFamily: !1, isEmployee: !1 }),
(this.ipc = ipc),
(this.app = app);
}
setUserInfo(userInfo) {
const previousUserID = this.user.id;
(this.user = Object.assign(this.user, userInfo)),
previousUserID !== this.user.id &&
(this.user.id > 0
? this.emit(UserEvents.LoggedIn)
: this.emit(UserEvents.LoggedOut));
}
getUserInfo() {
return this.user;
}
isLoggedIn() {
return this.user.id > 0;
}
loginWithArl(arl) {
this.app.clearLogginInfo().then(() => {
this.setCookie("arl", arl).then(() =>
this.ipc.send("app-reload-request")
);
});
}
logOut() {
this.ipc.send("channel-user-log-out");
}
switchProfile() {
this.ipc.send("channel-user-switch-profile");
}
setCookie(name, value) {
const tld = getDzTld(),
cookie = {
url: `http://${tld}`,
name,
value,
domain: `.${tld}`,
path: "/",
secure: !1,
httpOnly: !0,
expirationDate: Math.floor(new Date().getTime() / 1e3) + 1209600,
sameSite: "no_restriction",
};
return external_electron_namespaceObject.session.defaultSession.cookies.set(
cookie
);
}
};
UserService = UserService_decorate(
[
(0, external_inversify_namespaceObject.injectable)(),
UserService_param(
0,
(0, external_inversify_namespaceObject.inject)(SERVICE_IPC)
),
UserService_param(
1,
(0, external_inversify_namespaceObject.inject)(SERVICE_APPLICATION)
),
UserService_metadata("design:paramtypes", [Object, Object]),
],
UserService
);
const services_UserService = UserService;
var WindowStateService_decorate = function (decorators, target, key, desc) {
var d,
c = arguments.length,
r =
c < 3
? target
: null === desc
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate)
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) &&
(r =
(c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) ||
r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
},
WindowStateService_metadata = function (k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata)
return Reflect.metadata(k, v);
},
WindowStateService_param = function (paramIndex, decorator) {
return function (target, key) {
decorator(target, key, paramIndex);
};
};
let WindowStateService = class {
constructor(app) {
(this.defaultWidth = 990), (this.defaultHeight = 600), (this.app = app);
}
save() {
const [width, height] = this.app.getWindow().getSize(),
[x, y] = this.app.getWindow().getPosition();
(this.state = {
width,
height,
x,
y,
displayId: this.getDisplayId(x),
isMaximized: this.app.getWindow().isMaximized(),
}),
this.isOutOfBounds(x, y) &&
(external_electron_log_default().warn(
"WindowState: The position is out of bounds."
),
delete this.state.x,
delete this.state.y),
external_electron_settings_default().setSync(
"windowState",
this.state
);
}
get() {
return this.state || (this.state = this.getInitialState()), this.state;
}
getInitialState() {
if (external_electron_settings_default().hasSync("windowState"))
return external_electron_settings_default().getSync("windowState");
const { bounds, id } =
external_electron_namespaceObject.screen.getPrimaryDisplay();
let defaultWidth = this.defaultWidth,
defaultHeight = this.defaultHeight;
return (
bounds.width >= 1280 &&
((defaultWidth = 1210), (defaultHeight = 640)),
bounds.width >= 1920 &&
((defaultWidth = 1210), (defaultHeight = 700)),
{
width: defaultWidth,
height: defaultHeight,
isMaximized: !1,
displayId: id,
}
);
}
getDisplayId(x) {
const display = external_electron_namespaceObject.screen
.getAllDisplays()
.find(
display =>
x >= display.bounds.x &&
x < display.bounds.x + display.bounds.width
);
return display
? display.id
: (external_electron_log_default().error(
"WindowState: Cannot properly determine the display id."
),
external_electron_namespaceObject.screen.getPrimaryDisplay().id);
}
isOutOfBounds(x, y) {
let isOutOfBounds = !0;
for (const display of external_electron_namespaceObject.screen.getAllDisplays()) {
let xFit = !1,
yFit = !1;
if (
(x >= display.workArea.x &&
x <= display.workArea.x + display.workArea.width &&
(xFit = !0),
y >= display.workArea.y &&
y <= display.workArea.y + display.workArea.height &&
(yFit = !0),
xFit && yFit && display.id === this.state.displayId)
) {
isOutOfBounds = !1;
break;
}
}
return isOutOfBounds;
}
};
WindowStateService = WindowStateService_decorate(
[
(0, external_inversify_namespaceObject.injectable)(),
WindowStateService_param(
0,
(0, external_inversify_namespaceObject.inject)(SERVICE_APPLICATION)
),
WindowStateService_metadata("design:paramtypes", [Object]),
],
WindowStateService
);
const services_WindowStateService = WindowStateService;
(0, external_inversify_namespaceObject.decorate)(
(0, external_inversify_namespaceObject.injectable)(),
external_events_namespaceObject.EventEmitter
);
const di = new external_inversify_namespaceObject.Container({
defaultScope: "Singleton",
skipBaseClassChecks: !0,
});
di.bind(SERVICE_APPLICATION).to(services_AppService).inSingletonScope(),
di.bind(SERVICE_APPLICATION_MENU).to(services_ApplicationMenuService),
di
.bind(SERVICE_AUTOSTART)
.to(services_AutoStartService)
.inSingletonScope(),
di.bind(SERVICE_COOKIE).to(services_CookieService),
di.bind(SERVICE_DEEP_LINK).to(services_DeepLinkService),
di.bind(SERVICE_HISTORY).to(services_HistoryService),
di.bind(SERVICE_IPC).to(services_IpcService),
di.bind(SERVICE_MEDIA).to(services_MediaService),
di.bind(SERVICE_MENU).to(services_MenuService),
di.bind(SERVICE_NETWORK).to(services_NetworkService),
di.bind(SERVICE_POWER_SAVE).to(services_PowerSaveService),
di.bind(SERVICE_SENTRY).to(services_SentryService),
di.bind(SERVICE_THUMBAR).to(services_ThumbarService),
di.bind(SERVICE_TRAY).to(services_TrayService),
di.bind(SERVICE_UPDATER).to(services_UpdaterService),
di.bind(SERVICE_USER).to(services_UserService),
di.bind(SERVICE_WINDOW_STATE).to(services_WindowStateService);
const main_di = di,
app = main_di.get(SERVICE_APPLICATION),
ipc = main_di.get(SERVICE_IPC);
ipc.on("app-reload", () => {
app.reloadApp();
}),
ipc.on("app-go-forward", () => {
app.getWebContents().goBack();
}),
ipc.on("app-go-back", () => {
app.getWebContents().goForward();
}),
ipc.on("app-close", () => {
app.closeWindow();
}),
ipc.on("app-clear-login-data", () => {
app.clearLogginInfo().then(() => {
ipc.send("app-reload-request");
});
});
const MenuIpc_ipc = main_di.get(SERVICE_IPC),
applicationMenu = main_di.get(SERVICE_APPLICATION_MENU);
MenuIpc_ipc.on("channel-menu-show", (event, options) => {
applicationMenu.popup(options);
});
const PlayerIpc_ipc = main_di.get(SERVICE_IPC),
media = main_di.get(SERVICE_MEDIA),
powerSave = main_di.get(SERVICE_POWER_SAVE);
PlayerIpc_ipc.on(
"channel-player-state-update",
external_lodash_debounce_default()((event, state) => {
media.setPlayerInfo({ state }),
state === MediaPlayerState.Playing
? powerSave.start()
: powerSave.stop();
}, 3e3)
),
PlayerIpc_ipc.on(
"channel-player-track-update",
(event, track, player) => {
media.setPlayerInfo(player), media.setTrackInfo(track);
}
),
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);
});
const UpdaterIpc_ipc = main_di.get(SERVICE_IPC),
autoUpdater = main_di.get(SERVICE_UPDATER);
UpdaterIpc_ipc.on("channel-updater-install", () => {
autoUpdater.install();
});
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);
});
var application_awaiter = function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
}
function step(result) {
var value;
result.done
? resolve(result.value)
: ((value = result.value),
value instanceof P
? value
: new P(function (resolve) {
resolve(value);
})).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
const application = new (class {
constructor() {
(this.originalUserAgent = ""),
isDev() &&
(process.resourcesPath = external_path_default().join(
external_electron_namespaceObject.app.getAppPath(),
"resources"
)),
external_electron_namespaceObject.app.setName("Deezer"),
external_electron_namespaceObject.app.setAppUserModelId(
isWindowsStore() ? "Deezer.Music" : "com.deezer.deezer-desktop"
),
(this.window = null),
(this.originalUserAgent = ""),
(this.isFrameless = isPlatform(PLATFORM.WINDOWS)),
(this.appService = main_di.get(SERVICE_APPLICATION)),
(this.applicationMenu = main_di.get(SERVICE_APPLICATION_MENU)),
(this.cookie = main_di.get(SERVICE_COOKIE)),
(this.deepLink = main_di.get(SERVICE_DEEP_LINK)),
(this.history = main_di.get(SERVICE_HISTORY)),
(this.ipc = main_di.get(SERVICE_IPC)),
(this.network = main_di.get(SERVICE_NETWORK)),
(this.powerSave = main_di.get(SERVICE_POWER_SAVE)),
(this.thumbar = main_di.get(SERVICE_THUMBAR)),
(this.tray = main_di.get(SERVICE_TRAY)),
(this.updater = main_di.get(SERVICE_UPDATER)),
(this.user = main_di.get(SERVICE_USER)),
(this.windowState = main_di.get(SERVICE_WINDOW_STATE)),
(this.tld = getDzTld()),
(this.domain = getDomainName()),
this.init();
}
init() {
external_electron_log_default().debug("Init App"),
external_electron_namespaceObject.app.commandLine.appendSwitch(
"autoplay-policy",
"no-user-gesture-required"
),
external_electron_namespaceObject.app.on(
"second-instance",
(event, argv) => {
this.window &&
(external_electron_log_default().info(
`Handling from non single instance : ${JSON.stringify(argv)}`
),
this.window.show(),
this.deepLink.handlePath(this.deepLink.getPathFromArgv(argv)));
}
);
if (!external_electron_namespaceObject.app.requestSingleInstanceLock())
return (
external_electron_log_default().warn(
"Quitting second instance of the app"
),
void external_electron_namespaceObject.app.quit()
);
external_electron_namespaceObject.app.on("open-url", (event, url) => {
external_electron_log_default().info(
`Handling from open Url : ${url}`
),
event.preventDefault(),
this.deepLink.handlePath(this.deepLink.getPathFromUrl(url));
}),
external_electron_namespaceObject.app.on("ready", () =>
application_awaiter(this, void 0, void 0, function* () {
external_electron_log_default().debug("App is ready"),
yield i18n_init(),
this.applicationMenu.init(),
this.cookie.init(),
this.tray.init(),
this.updater.init(),
this.network.watch(),
this.powerSave.check(),
this.deepLink.getSchemes().forEach(scheme => {
external_electron_namespaceObject.app.setAsDefaultProtocolClient(
scheme
);
});
const dzrFilter = { urls: ["*://*/*"] },
DOMAINS_WHITELIST = [
"deezer.com",
"deezerdev.com",
"dzcdn.net",
"deez.re",
],
isValidDetailsForHeaderManipulation = details =>
details &&
details.url &&
DOMAINS_WHITELIST.some(host =>
new external_url_namespaceObject.URL(
details.url
).host.endsWith(host)
);
function cleanupHeaders(headers, headerToClean) {
return (
Object.keys(headers).forEach(headerName => {
headerName.toLowerCase() === headerToClean.toLowerCase() &&
delete headers[headerName];
}),
headers
);
}
external_electron_namespaceObject.session.defaultSession.webRequest.onBeforeSendHeaders(
dzrFilter,
(details, callback) => {
const { requestHeaders } = details;
isValidDetailsForHeaderManipulation(details) &&
(external_electron_log_default().debug(
"Added request headers for",
details.url
),
(requestHeaders.origin = `https://${this.domain}`)),
(requestHeaders["user-agent"] = this.appService
.getWebContents()
.getUserAgent()),
callback({ cancel: !1, requestHeaders });
}
),
external_electron_namespaceObject.session.defaultSession.webRequest.onHeadersReceived(
dzrFilter,
(details, callback) => {
const { responseHeaders, statusLine } = details;
isValidDetailsForHeaderManipulation(details) &&
(external_electron_log_default().debug(
"Added response headers for",
details.url
),
cleanupHeaders(
responseHeaders,
"access-control-allow-origin"
),
(responseHeaders["access-control-allow-origin"] = [
"file://",
]),
cleanupHeaders(
responseHeaders,
"access-control-allow-headers"
),
(responseHeaders["access-control-allow-headers"] = [
"x-deezer-user",
"x-ignore-service-worker",
"authorization",
"content-type",
"range",
])),
callback({ cancel: !1, responseHeaders, statusLine });
}
),
external_electron_namespaceObject.session.defaultSession.webRequest.onBeforeRequest(
null,
(details, callback) => {
if (-1 !== details.url.indexOf("blob:file"))
return void callback({ cancel: !1 });
if (-1 === details.url.indexOf("file:"))
return void callback({ cancel: !1 });
const encodedUrl = new external_url_namespaceObject.URL(
details.url
).toString(),
encodedAppPath = new external_url_namespaceObject.URL(
`${
isPlatform(PLATFORM.WINDOWS) ? "file:///" : "file://"
}${external_electron_namespaceObject.app.getAppPath()}`
).toString();
0 === encodedUrl.indexOf(encodedAppPath)
? callback({ cancel: !1 })
: callback({
cancel: !1,
redirectURL: details.url.replace(
"file://",
"https://"
),
});
}
),
external_electron_log_default().debug("Creating Window"),
this.createWindow(),
this.loadWindow(),
this.ipc.send("channel-autostart-init");
})
),
external_electron_namespaceObject.app.on("window-all-closed", () => {
external_electron_log_default().debug("Window All Closed"),
external_electron_namespaceObject.app.quit();
}),
external_electron_namespaceObject.app.on("activate", () => {
external_electron_log_default().debug("App activated"),
null === this.window
? (this.createWindow(), this.loadWindow())
: this.window.show();
}),
external_electron_namespaceObject.app.on("before-quit", () => {
external_electron_log_default().debug("App on before quit"),
this.powerSave.stop(),
this.ipc.send("history-closing-app"),
this.cookie.flushStore(),
external_electron_namespaceObject.session.defaultSession.flushStorageData();
}),
isDev() &&
external_electron_namespaceObject.app.on(
"certificate-error",
(event, webContents, url, error, certificate, callback) => {
[
"https://docker-files.deezerdev.com",
"https://docker-images.deezerdev.com",
"https://docker-www.deezerdev.com",
].some(domain => url.startsWith(domain))
? (event.preventDefault(), callback(!0))
: callback(!1);
}
);
}
createWindow() {
const webPreferences = {
autoplayPolicy: "no-user-gesture-required",
devTools: hasDevTools(),
contextIsolation: !1,
enableRemoteModule: !0,
nodeIntegration: !0,
nodeIntegrationInSubFrames: !1,
preload: external_path_default().resolve(
getRealPath(__dirname),
"preload.js"
),
},
windowOptions = {
title: "Deezer Desktop",
minWidth: 990,
minHeight: 600,
icon: external_electron_namespaceObject.nativeImage.createFromPath(
getAppIcon()
),
titleBarStyle: "hiddenInset",
backgroundColor: "#F8F8F9",
show: !1,
frame: !this.isFrameless,
autoHideMenuBar: !0,
webPreferences,
},
windowState = this.windowState.get();
if (
((this.window = new external_electron_namespaceObject.BrowserWindow(
Object.assign(Object.assign({}, windowOptions), {
width: windowState.width,
height: windowState.height,
x: windowState.x,
y: windowState.y,
})
)),
this.isFrameless)
) {
const mainView = new external_electron_namespaceObject.BrowserView({
webPreferences,
});
this.window.setBrowserView(mainView),
this.appService.setWindow(this.window, mainView),
this._adjustViewToContentSize(),
mainView.setAutoResize({ width: !0, height: !0 });
} else this.appService.setWindow(this.window, void 0);
if ((this.appService.setUserAgent(), isPlatform(PLATFORM.DARWIN))) {
let isQuitting = !1;
external_electron_namespaceObject.app.on(
"before-quit",
() => (isQuitting = !0)
),
this.window.on("close", event => {
isQuitting ||
this.updater.isUpdating ||
(event.preventDefault(), this.window.hide());
}),
this.window.on("moved", () => {
this.windowState.save();
});
} else
this.window.on("move", () => {
this.windowState.save();
});
this.window.on("resize", () => {
this.isFrameless && this._adjustViewToContentSize(),
this.windowState.save();
}),
this.window.once("ready-to-show", () => {
if (windowState.isMaximized) this.window.maximize();
else if (isPlatform(PLATFORM.WINDOWS)) {
const curWinSize = this.window.getSize(),
curContentSize = this.window.getContentSize(),
minWinSize = this.window.getMinimumSize(),
finalMinSize = [
minWinSize[0] + curWinSize[0] - curContentSize[0],
minWinSize[1] + curWinSize[1] - curContentSize[1],
];
this.window.setMinimumSize(finalMinSize[0], finalMinSize[1]),
curWinSize[0] < finalMinSize[0] &&
this.window.setSize(finalMinSize[0], curWinSize[1]),
curWinSize[1] < finalMinSize[1] &&
this.window.setSize(curWinSize[0], finalMinSize[1]),
external_electron_log_default().debug(
"Setting minimum size to ",
finalMinSize[0],
finalMinSize[1]
);
}
isDev() ? this.window.showInactive() : this.window.show(),
this.thumbar.init();
}),
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,
});
}
loadWindow() {
const report = () => {
this.ipc.send("update-data", {
canGoBack: this.appService.getWebContents().canGoBack(),
canGoForward: this.appService.getWebContents().canGoForward(),
}),
this.history.setHistoryInfo({
canGoBack: this.appService.getWebContents().canGoBack(),
canGoForward: this.appService.getWebContents().canGoForward(),
});
};
this.appService.getWebContents().on("did-navigate-in-page", report),
this.appService.getWebContents().on("did-navigate", report),
this.appService
.getWebContents()
.on("did-fail-load", (event, code, desc, validatedURL) => {
external_electron_log_default().error(
"Web content failed to load:",
code,
desc,
validatedURL
);
}),
isPlatform(PLATFORM.WINDOWS) &&
this.window.on("app-command", (e, cmd) => {
"browser-backward" === cmd &&
this.appService.getWebContents().canGoBack() &&
this.appService.getWebContents().goBack(),
"browser-forward" === cmd &&
this.appService.getWebContents().canGoForward() &&
this.appService.getWebContents().goForward();
}),
isPlatform(PLATFORM.WINDOWS) && this.loadMenu(),
this.appService.loadPage(this.deepLink.getPathFromArgv(process.argv));
this.appService
.getWebContents()
.on("new-window", (event, targetUrl) => {
if (
(external_electron_log_default().debug(
`Asking opening of ${targetUrl}`
),
null !== this.appService.getViewContainer() &&
targetUrl !== this.appService.getWebContents().getURL())
) {
const currentUrl = external_url_default().parse(
this.appService.getWebContents().getURL()
),
basePageUrl = external_url_default()
.format(currentUrl)
.replace(currentUrl.hash, "");
0 === targetUrl.indexOf(basePageUrl)
? (targetUrl = targetUrl.replace(`${basePageUrl}#/`, ""))
: 0 === targetUrl.indexOf("file://") &&
((targetUrl = targetUrl.replace(
isPlatform(PLATFORM.WINDOWS) ? "file:///" : "file://",
""
)),
(targetUrl = external_path_default().relative(
"/",
targetUrl
))),
0 !== targetUrl.indexOf("http") &&
(targetUrl = `https://${this.domain}/` + targetUrl),
external_electron_log_default().debug(
`Opening ${targetUrl} externally`
),
event.preventDefault(),
external_electron_namespaceObject.shell.openExternal(targetUrl);
}
}),
this.appService.getWebContents().on("crashed", event => {
external_electron_log_default().error(
"WebContents crashed:\n",
event
),
this.window.close(),
external_electron_namespaceObject.app.quit();
}),
this.window.on("unresponsive", () => {
external_electron_log_default().warn("Window is not responsive");
});
}
loadMenu() {
this.window.webContents.clearHistory(),
this.window.webContents.loadURL(
external_url_default().format({
pathname: external_path_default().resolve(
getRealPath(external_electron_namespaceObject.app.getAppPath()),
"build/titlebar.html"
),
protocol: "file:",
slashes: !0,
})
);
}
loadPage() {
this.appService.loadPage(this.deepLink.getPathFromArgv(process.argv));
}
})();
external_electron_settings_default().configure({
dir: external_path_default().join(
external_electron_namespaceObject.app.getPath("home"),
".config/deezer-desktop"
),
fileName: "settings.json",
}),
external_electron_namespaceObject.crashReporter.start({
companyName: "Deezer",
productName: "Deezer Desktop",
ignoreSystemCrashHandler: !0,
compress: !0,
submitURL:
"https://sentry.io/api/1450937/minidump/?sentry_key=5f16f060cbad488588de87a1a85ad777",
}),
main_di.get(SERVICE_SENTRY).init(),
(external_electron_log_default().variables = {
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.sentry = function (msg) {
"error" === msg.level &&
(msg.data[0] instanceof Error
? external_raven_default().captureException(msg.data[0])
: external_raven_default().captureMessage(
Array.isArray(msg.data) ? msg.data.join(", ") : msg.data
));
});
const main = application;
})(),
(module.exports = __webpack_exports__);
})();
Offline
That file does indeed not look as expected. Note the patch expects line 7 to be
87: (module) => {
(note the missing parentheses in your file)
I second Scimmia's suggestion to try a clean build. Somehow your source appears to have been modified and/or be remains of a previous build with older sources.
Offline
When you say "clean build", its "sudo pacman -Scc" or "yay -Sc" ? It's done
Offline
It means `makepkg -C` (or alternatively a clean chroot build). Please avoid using helpers while trying to solve AUR issues (this makes easier to help as the the helper factor is taken out, and not everyone uses a helper)
Offline
Thanks for your help, but i resolved this problem with youtube-music a really good apps...
More seriously i opened an issue on github, I'll wait.
Offline
Did you do a clean build? what is the output?
I think installing other app it's just avoid the problem.
Solo soy un loco más. Please use [code] [/code] tags.
Command cheatsheet ♠ Command not found?
If I write something wrong in English, please correct me.
Offline
Sry, I didn't understand a "clean build", i tried `makepkg -C` `makepkg -sc` `makepkg -si`, witch Yay, and i have every time the same error, my arch is up to date
Offline
1 deezer (Build Files Exist) ==> Packages to cleanBuild? ==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4) ==> :: PKGBUILD up to date, Skipping (1/0): deezer
This is where yay asks you to enter "A" if you want to do a clean build.
For makepkg, see the wiki.
Offline
Sry, I didn't understand a "clean build", i tried `makepkg -C` `makepkg -sc` `makepkg -si`, witch Yay, and i have every time the same error, my arch is up to date
Well, you did not post the logs for those commands so we cannot know... And by the way, I cannot reproduce the issue.
Edit: grammar
Last edited by a821 (2022-07-05 12:31:28)
Offline
Please follow the steps below exactly which run makepkg in a separate directory without using an AUR helper. Please post the output from makepkg if it fails.
mkdir deezer-clean
cd deezer-clean/
git clone https://aur.archlinux.org/deezer.git
cd deezer
makepkg
Edit:
I also could not replicate the issue.
Last edited by loqs (2022-07-05 10:28:09)
Offline