mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
Merge pull request #550 from Araxeus/download-playlist-badge-count
show a badge remaining items when downloading a playlist
This commit is contained in:
@ -8,7 +8,7 @@ const chokidar = require('chokidar');
|
||||
|
||||
const { setOptions } = require("../../config/plugins");
|
||||
const { sendError } = require("./back");
|
||||
const { defaultMenuDownloadLabel, getFolder, presets } = require("./utils");
|
||||
const { defaultMenuDownloadLabel, getFolder, presets, setBadge } = require("./utils");
|
||||
|
||||
let downloadLabel = defaultMenuDownloadLabel;
|
||||
let playingUrl = undefined;
|
||||
@ -37,7 +37,7 @@ module.exports = (win, options) => {
|
||||
return [
|
||||
{
|
||||
label: downloadLabel,
|
||||
click: () => downloadPlaylist(undefined, win, options)
|
||||
click: () => downloadPlaylist(undefined, win, options),
|
||||
},
|
||||
{
|
||||
label: "Choose download folder",
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
const electron = require("electron");
|
||||
const is = require('electron-is');
|
||||
|
||||
module.exports.getFolder = customFolder => customFolder || electron.app.getPath("downloads");
|
||||
module.exports.defaultMenuDownloadLabel = "Download playlist";
|
||||
@ -37,3 +38,9 @@ module.exports.presets = {
|
||||
ffmpegArgs: ["-acodec", "libopus"],
|
||||
},
|
||||
};
|
||||
|
||||
module.exports.setBadge = n => {
|
||||
if (is.linux() || is.macOS()) {
|
||||
electron.app.setBadgeCount(n);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user