From e0b7ca468434a79f14458ec3fd3e78f209943566 Mon Sep 17 00:00:00 2001 From: "Heliomar P. Marques" Date: Tue, 28 Mar 2023 10:59:33 -0300 Subject: [PATCH] v1.12.1 --- CHANGE_LOG.md | 17 +++++--- assets/js/app.js | 71 +++++++-------------------------- assets/js/auto_authenticator.js | 34 ++++++++++++++++ index.js | 6 +-- package.json | 2 +- 5 files changed, 63 insertions(+), 67 deletions(-) create mode 100644 assets/js/auto_authenticator.js diff --git a/CHANGE_LOG.md b/CHANGE_LOG.md index b4812d51..27ece873 100644 --- a/CHANGE_LOG.md +++ b/CHANGE_LOG.md @@ -1,16 +1,21 @@ # Change Log ---- -## Version [1.12.0](https://github.com/heliomarpm/udemy-downloader-gui/compare/v1.11.10...v1.12.0) +## Version [1.12.1](https://github.com/heliomarpm/udemy-downloader-gui/compare/v1.11.10...v1.12.1) ##### Mar, 26 2023 -![](https://img.shields.io/github/downloads/heliomarpm/udemy-downloader-gui/v1.12.0/total) +![](https://img.shields.io/github/downloads/heliomarpm/udemy-downloader-gui/v1.12.1/total) -### Change - * Added support for Subscriber Account _[#100](https://github.com/heliomarpm/udemy-downloader-gui/issues/100) | [#105](https://github.com/heliomarpm/udemy-downloader-gui/issues/105)_ - * Messaging enhancement +### Added + * Support for Subscriber Account _[#100](https://github.com/heliomarpm/udemy-downloader-gui/issues/100) | [#105](https://github.com/heliomarpm/udemy-downloader-gui/issues/105)_ + * Global Error Handling ### Fixed - * Failed to load preload.js file, impacting error monitoring + * Failed to load environment variables file, impacting error monitoring + +### Other Changes + * Messaging improvement + * Code Cleanup + ---- ## Version [1.11.10](https://github.com/heliomarpm/udemy-downloader-gui/compare/v1.11.6...v1.11.10) diff --git a/assets/js/app.js b/assets/js/app.js index 5deae5c6..e8ced42f 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -11,11 +11,6 @@ const Downloader = require("mt-files-downloader"); const https = require("https"); const cookie = require("cookie"); -// var awaitingLogin = false; -// const server = require("http").createServer(); -// const socketIO = require("socket.io")(server); -// const $loginAuthenticator = $(".ui.login.authenticator"); - const pageSize = 25; const msgDRMProtected = translate("Contains DRM protection and cannot be downloaded"); const ajaxTimeout = 60000; // 60 segundos @@ -29,34 +24,7 @@ var $subDomain = $(".ui.login #subdomain"); var subDomain = settings.get("subdomain") || "www"; var settingsCached = settings.getAll(); - -// server.listen(50490); -// socketIO.on("connect", function (socket) { -// console.log('io.onConnect'); -// $loginAuthenticator.removeClass("disabled"); - -// socket.on("disconnect", function () { -// console.log('socket.onDisconnect'); -// $loginAuthenticator.addClass("disabled"); -// $(".ui.authenticator.dimmer").removeClass("active"); -// awaitingLogin = false; -// }); - -// $loginAuthenticator.click(function () { -// $(".ui.authenticator.dimmer").addClass("active"); -// awaitingLogin = true; -// socket.emit("awaitingLogin"); -// }); - -// socket.on("newLogin", function (data) { -// console.log('socket.onNewLogin'); -// if (awaitingLogin) { -// settings.set("access_token", data.access_token); -// settings.set("subdomain", data.subdomain); -// checkLogin(); -// } -// }); -// }); +// require('auto_authenticator.js'); const downloadFiles = { LecturesAndAttachments: 0, @@ -288,7 +256,7 @@ $(".ui.dashboard .content").on("click", ".open-in-browser", function () { $(".ui.dashboard .content").on("click", ".open-dir", function () { const pathDownloaded = $(this).parents(".course.item").find('input[name="path-downloaded"]').val(); - shell.openItem(pathDownloaded); + shell.openPath(pathDownloaded); }); $(".ui.dashboard .content").on("click", ".dismiss-download", function () { @@ -2016,27 +1984,6 @@ function checkLogin() { } } -function loginWithPassword() { - if ($(".ui.login .form").find('input[name="business"]').is(":checked")) { - if (!$subDomain.val()) { - prompt.alert("Type Business Name"); - return; - } - } else { - $subDomain.val("www"); - } - - - // prompt.prompt("Access Token", function (access_token) { - // if (access_token) { - // const submain = $subDomain.val(); - // settings.set("access_token", access_token); - // settings.set("subdomain", submain.length == 0 ? "www" : submain); - // checkLogin(); - // } - // }); -} - function loginWithAccessToken() { const $formLogin = $(".ui.login .form"); @@ -2082,7 +2029,7 @@ function sendNotification(pathCourse, course_name, urlImage = null) { }); notification.onclick = function () { - shell.openItem(pathCourse); + shell.openPath(pathCourse); } } @@ -2194,4 +2141,14 @@ function saveLogFile() { } -console.table(getAllDownloadsHistory()); \ No newline at end of file +process.on('uncaughtException', (error) => { + appendLog("uncaughtException", error.stack); + Sentry.captureException(error); +}) + +process.on('unhandledRejection', (error) => { + appendLog("unhandledRejection", error.stack); + Sentry.captureException(error); +}) + +console.table(getAllDownloadsHistory()); diff --git a/assets/js/auto_authenticator.js b/assets/js/auto_authenticator.js new file mode 100644 index 00000000..e8e70511 --- /dev/null +++ b/assets/js/auto_authenticator.js @@ -0,0 +1,34 @@ + +// var awaitingLogin = false; +// const server = require("http").createServer(); +// const socketIO = require("socket.io")(server); + +// const $loginAuthenticator = $(".ui.login.authenticator"); + +// server.listen(50490); +// socketIO.on("connect", function (socket) { +// console.log('io.onConnect'); +// $loginAuthenticator.removeClass("disabled"); + +// socket.on("disconnect", function () { +// console.log('socket.onDisconnect'); +// $loginAuthenticator.addClass("disabled"); +// $(".ui.authenticator.dimmer").removeClass("active"); +// awaitingLogin = false; +// }); + +// $loginAuthenticator.click(function () { +// $(".ui.authenticator.dimmer").addClass("active"); +// awaitingLogin = true; +// socket.emit("awaitingLogin"); +// }); + +// socket.on("newLogin", function (data) { +// console.log('socket.onNewLogin'); +// if (awaitingLogin) { +// settings.set("access_token", data.access_token); +// settings.set("subdomain", data.subdomain); +// checkLogin(); +// } +// }); +// }); \ No newline at end of file diff --git a/index.js b/index.js index 1a0f40ed..850c55f3 100644 --- a/index.js +++ b/index.js @@ -29,18 +29,18 @@ function createWindow() { const size = screen.getPrimaryDisplay().workAreaSize // Create the browser window. let win = new BrowserWindow({ - title: `Udeler | Udemy Course Downloader - v${appVersion} ${process.env.SENTRY_DSN==undefined ? "": " 🚴‍♂️"}`, + title: `Udeler | Udemy Course Downloader - v${appVersion} ${process.env.SENTRY_DSN == undefined ? "" : " 🕘"}`, minWidth: 650, minHeight: 550, width: 650, height: size.height - 150, - icon: __dirname + "/assets/images/build/icon.png", + icon: path.join(__dirname, "/assets/images/build/icon.png"), resizable: true, maximizable: true, webPreferences: { nodeIntegration: true, enableRemoteModule: true, - // contextIsolation: true, + contextIsolation: false, preload: path.join(__dirname, "/preload.js") } }); diff --git a/package.json b/package.json index 676543e7..7aa9d0f9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "udeler", "productName": "Udeler", - "version": "1.12.0", + "version": "1.12.1", "main": "index.js", "urlHelp": "https://heliomarpm.notion.site/heliomarpm/How-to-get-an-Access-Token-b0ce5f89073c4965b47721197dcb2497", "repository": {