diff --git a/plugins/downloader/menu.js b/plugins/downloader/menu.js index e519055c..a1913047 100644 --- a/plugins/downloader/menu.js +++ b/plugins/downloader/menu.js @@ -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", diff --git a/plugins/downloader/utils.js b/plugins/downloader/utils.js index 9e17c04d..70160188 100644 --- a/plugins/downloader/utils.js +++ b/plugins/downloader/utils.js @@ -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); + } +}