Bugfix/4.1.1 (#161)

* - Fixed `cannot read property of undefined` error because of not passing mainWindow around.
- vincens2005, fixed inconsistent auto muting

* Fix inconsistent auto-muting (#159)

* fix muting sometimes not working

* fix inconsistent unmuting

* fix bad code in inconsistent muting fig

Co-authored-by: Cukmekerb <cukmekerb@gmail.com>
This commit is contained in:
Rick van Lieshout 2022-08-23 21:20:46 +02:00 committed by GitHub
parent 1439a11969
commit 4941aae950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 9 deletions

View File

@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 4.1.1
- Fixed `cannot read property of undefined` error because of not passing mainWindow around.
- vincens2005, fixed inconsistent auto muting
## 4.1.0 ## 4.1.0
- Added `tidal://` protocol support - Added `tidal://` protocol support

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "tidal-hifi", "name": "tidal-hifi",
"version": "4.1.0", "version": "4.1.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "tidal-hifi", "name": "tidal-hifi",
"version": "4.1.0", "version": "4.1.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@electron/remote": "^2.0.8", "@electron/remote": "^2.0.8",

View File

@ -1,6 +1,6 @@
{ {
"name": "tidal-hifi", "name": "tidal-hifi",
"version": "4.1.0", "version": "4.1.1",
"description": "Tidal on Electron with widevine(hifi) support", "description": "Tidal on Electron with widevine(hifi) support",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -136,7 +136,7 @@ app.on("ready", async () => {
if (isMainInstanceOrMultipleInstancesAllowed()) { if (isMainInstanceOrMultipleInstancesAllowed()) {
await components.whenReady(); await components.whenReady();
createWindow(); createWindow();
addMenu(); addMenu(mainWindow);
createSettingsWindow(); createSettingsWindow();
addGlobalShortcuts(); addGlobalShortcuts();
store.get(settings.trayIcon) && addTray(mainWindow, { icon }) && refreshTray(); store.get(settings.trayIcon) && addTray(mainWindow, { icon }) && refreshTray();

View File

@ -12,7 +12,7 @@ const appName = "Tidal Hifi";
let currentSong = ""; let currentSong = "";
let player; let player;
let currentPlayStatus = statuses.paused; let currentPlayStatus = statuses.paused;
let isMutedArtist = false; let isMutedArtist = true;
const elements = { const elements = {
play: '*[data-test="play"]', play: '*[data-test="play"]',
@ -327,6 +327,8 @@ function getTrackURL() {
setInterval(function () { setInterval(function () {
const title = elements.getText("title"); const title = elements.getText("title");
const artists = elements.getArtists(); const artists = elements.getArtists();
muteArtistIfFoundInMutedArtistsList(); // doing this here so that nothing can possibly fail before we call this function
const album = elements.getAlbumName(); const album = elements.getAlbumName();
const current = elements.getText("current"); const current = elements.getText("current");
const duration = elements.getText("duration"); const duration = elements.getText("duration");
@ -343,9 +345,10 @@ setInterval(function () {
"app-name": appName, "app-name": appName,
}; };
const titleOrArtistChanged = currentSong !== songDashArtistTitle; const titleOrArtistChanged = currentSong !== songDashArtistTitle;
muteArtistIfFoundInMutedArtistsList();
// update title, url and play info with new info // update title, url and play info with new info
setTitle(songDashArtistTitle); setTitle(songDashArtistTitle);
@ -390,7 +393,7 @@ setInterval(function () {
isMutedArtist = true; isMutedArtist = true;
elements.click("volume"); elements.click("volume");
} }
} else if (currentStatus === statuses.playing && isMutedArtist && elements.isMuted()) { } else if (isMutedArtist && elements.isMuted()) {
elements.click("volume"); elements.click("volume");
isMutedArtist = false; isMutedArtist = false;
} }

View File

@ -115,8 +115,8 @@ menuModule.getMenu = function (mainWindow) {
return Menu.buildFromTemplate(mainMenu); return Menu.buildFromTemplate(mainMenu);
}; };
menuModule.addMenu = function () { menuModule.addMenu = function (mainWindow) {
Menu.setApplicationMenu(menuModule.getMenu()); Menu.setApplicationMenu(menuModule.getMenu(mainWindow));
}; };
module.exports = menuModule; module.exports = menuModule;