Skip to content

Commit

Permalink
Bugfix/4.1.1 (#161)
Browse files Browse the repository at this point in the history
* - 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 <[email protected]>
  • Loading branch information
Mastermindzh and vincens2005 authored Aug 23, 2022
1 parent 1439a11 commit 4941aae
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/),
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

- Added `tidal://` protocol support
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tidal-hifi",
"version": "4.1.0",
"version": "4.1.1",
"description": "Tidal on Electron with widevine(hifi) support",
"main": "src/main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ app.on("ready", async () => {
if (isMainInstanceOrMultipleInstancesAllowed()) {
await components.whenReady();
createWindow();
addMenu();
addMenu(mainWindow);
createSettingsWindow();
addGlobalShortcuts();
store.get(settings.trayIcon) && addTray(mainWindow, { icon }) && refreshTray();
Expand Down
9 changes: 6 additions & 3 deletions src/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const appName = "Tidal Hifi";
let currentSong = "";
let player;
let currentPlayStatus = statuses.paused;
let isMutedArtist = false;
let isMutedArtist = true;

const elements = {
play: '*[data-test="play"]',
Expand Down Expand Up @@ -327,6 +327,8 @@ function getTrackURL() {
setInterval(function () {
const title = elements.getText("title");
const artists = elements.getArtists();
muteArtistIfFoundInMutedArtistsList(); // doing this here so that nothing can possibly fail before we call this function

const album = elements.getAlbumName();
const current = elements.getText("current");
const duration = elements.getText("duration");
Expand All @@ -342,10 +344,11 @@ setInterval(function () {
duration,
"app-name": appName,
};



const titleOrArtistChanged = currentSong !== songDashArtistTitle;

muteArtistIfFoundInMutedArtistsList();

// update title, url and play info with new info
setTitle(songDashArtistTitle);
Expand Down Expand Up @@ -390,7 +393,7 @@ setInterval(function () {
isMutedArtist = true;
elements.click("volume");
}
} else if (currentStatus === statuses.playing && isMutedArtist && elements.isMuted()) {
} else if (isMutedArtist && elements.isMuted()) {
elements.click("volume");
isMutedArtist = false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ menuModule.getMenu = function (mainWindow) {
return Menu.buildFromTemplate(mainMenu);
};

menuModule.addMenu = function () {
Menu.setApplicationMenu(menuModule.getMenu());
menuModule.addMenu = function (mainWindow) {
Menu.setApplicationMenu(menuModule.getMenu(mainWindow));
};

module.exports = menuModule;

0 comments on commit 4941aae

Please sign in to comment.