Skip to content

Commit

Permalink
Merge pull request #231 from Araxeus/dependencies-update
Browse files Browse the repository at this point in the history
Dependencies update
  • Loading branch information
th-ch authored Apr 29, 2021
2 parents a406ba4 + 79d95d9 commit f95e29d
Show file tree
Hide file tree
Showing 4 changed files with 732 additions and 595 deletions.
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,38 +62,37 @@
"npm": "Please use yarn and not npm"
},
"dependencies": {
"@cliqz/adblocker-electron": "^1.20.1",
"@cliqz/adblocker-electron": "^1.20.4",
"@ffmpeg/core": "^0.8.5",
"@ffmpeg/ffmpeg": "^0.9.7",
"YoutubeNonStop": "git://github.com/lawfx/YoutubeNonStop.git#v0.8.1",
"YoutubeNonStop": "git://github.com/lawfx/YoutubeNonStop.git#v0.9.0",
"async-mutex": "^0.3.1",
"browser-id3-writer": "^4.4.0",
"custom-electron-titlebar": "^3.2.6",
"discord-rpc": "^3.2.0",
"downloads-folder": "^3.0.1",
"electron-debug": "^3.2.0",
"electron-is": "^3.0.0",
"electron-localshortcut": "^3.2.1",
"electron-store": "^7.0.2",
"electron-store": "^7.0.3",
"electron-unhandled": "^3.0.2",
"electron-updater": "^4.3.6",
"electron-updater": "^4.3.8",
"filenamify": "^4.2.0",
"md5": "^2.3.0",
"node-fetch": "^2.6.1",
"open": "^8.0.3",
"ytdl-core": "^4.4.5",
"ytpl": "^2.0.5"
"ytdl-core": "^4.5.0",
"ytpl": "^2.1.1"
},
"devDependencies": {
"electron": "^11.2.3",
"electron-builder": "^22.9.1",
"electron": "^11.4.2",
"electron-builder": "^22.10.5",
"electron-devtools-installer": "^3.1.1",
"electron-icon-maker": "0.0.5",
"get-port": "^5.1.1",
"jest": "^26.6.3",
"rimraf": "^3.0.2",
"spectron": "^13.0.0",
"xo": "^0.37.1"
"xo": "^0.38.2"
},
"resolutions": {
"yargs-parser": "18.1.3"
Expand Down
4 changes: 2 additions & 2 deletions plugins/downloader/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const downloadsFolder = require("downloads-folder");
const { app } = require("electron");

module.exports.getFolder = (customFolder) => customFolder || downloadsFolder();
module.exports.getFolder = (customFolder) => customFolder || app.getPath("downloads");
module.exports.defaultMenuDownloadLabel = "Download playlist";
86 changes: 41 additions & 45 deletions plugins/taskbar-mediacontrol/back.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,53 @@ const getSongControls = require('../../providers/song-controls');
const getSongInfo = require('../../providers/song-info');
const path = require('path');

module.exports = win => {
win.hide = function () {
win.minimize();
win.setSkipTaskbar(true);
};

const show = win.show;
win.show = function () {
win.restore();
win.focus();
win.setSkipTaskbar(false);
show.apply(win);
};

win.isVisible = function () {
return !win.isMinimized();
};
let controls;
let currentSongInfo;

module.exports = win => {
const registerCallback = getSongInfo(win);
const {playPause, next, previous} = getSongControls(win);

// If the page is ready, register the callback
win.on('ready-to-show', () => {
registerCallback(songInfo => {
// Wait for song to start before setting thumbar
if (songInfo.title === '') {
return;
}
const { playPause, next, previous } = getSongControls(win);
controls = { playPause, next, previous };

// Win32 require full rewrite of components
win.setThumbarButtons([
{
tooltip: 'Previous',
icon: get('backward.png'),
click() {previous(win.webContents);}
}, {
tooltip: 'Play/Pause',
// Update icon based on play state
icon: songInfo.isPaused ? get('play.png') : get('pause.png'),
click() {playPause(win.webContents);}
}, {
tooltip: 'Next',
icon: get('forward.png'),
click() {next(win.webContents);}
}
]);
});
registerCallback(songInfo => {
//update currentsonginfo for win.on('show')
currentSongInfo = songInfo;
// update thumbar
setThumbar(win, songInfo);
});

// need to set thumbar again after win.show
win.on("show", () => {
setThumbar(win, currentSongInfo)
})
};

function setThumbar(win, songInfo) {
// Wait for song to start before setting thumbar
if (!songInfo?.title) {
return;
}

// Win32 require full rewrite of components
win.setThumbarButtons([
{
tooltip: 'Previous',
icon: get('backward.png'),
click() { controls.previous(win.webContents); }
}, {
tooltip: 'Play/Pause',
// Update icon based on play state
icon: songInfo.isPaused ? get('play.png') : get('pause.png'),
click() { controls.playPause(win.webContents); }
}, {
tooltip: 'Next',
icon: get('forward.png'),
click() { controls.next(win.webContents); }
}
]);
}

// Util
function get(file) {
return path.join(__dirname,"assets", file);
return path.join(__dirname, "assets", file);
}
Loading

0 comments on commit f95e29d

Please sign in to comment.