diff --git a/infoupdate.html b/infoupdate.html index d086db7..d1b3696 100644 --- a/infoupdate.html +++ b/infoupdate.html @@ -1,3 +1,13 @@ +

Subsonics 2.2.0

+

Sortie le : 02/05/2022

+

Ajouts & Fixes :

+ +
+

Subsonics 2.1.7

Sortie le : 01/05/2022

Ajouts & Fixes :

diff --git a/package.json b/package.json index 5af3237..42d500c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "subsonics-manager", - "version": "2.1.7", + "version": "2.2.0", "description": "Manager for subsonics", "main": "main.js", "scripts": { diff --git a/templates/app/app.css b/templates/app/app.css index e3207cc..21e2bd2 100644 --- a/templates/app/app.css +++ b/templates/app/app.css @@ -188,21 +188,26 @@ display: flex; flex-direction: row; + justify-content: space-between; text-align: start; align-items: center; margin-top: 10px; } + + .stPct { - text-align: center; + text-align:end; + padding-left: 3%; + } .stLine p { - width: 100px; margin: 0; + margin-right: 2%; } .online-light { diff --git a/templates/app/app.html b/templates/app/app.html index a64f547..4b8ed25 100644 --- a/templates/app/app.html +++ b/templates/app/app.html @@ -99,22 +99,35 @@
-

Volume :

+

Volume

0%

-

Actions :

+

Actions

-

Bug ou suggestion :

+

Bug ou suggestion

-

Forcer la mise à jour :

+

Forcer la mise à jour

+
+

Canal de mise à jour

+
+
+ +

Stable

+
+
+ +

Dev

+
+
+
diff --git a/templates/app/app.js b/templates/app/app.js index 6b3e447..8b2b472 100644 --- a/templates/app/app.js +++ b/templates/app/app.js @@ -64,6 +64,34 @@ const favClose = document.getElementById("favClose") const favClear = document.getElementById("favClear") const favContent = document.getElementById("favContent") +const cStable = document.getElementById("cStable") +const cDev = document.getElementById("cDev") + + + +cDev.addEventListener("change", () => { + + const settings = getSettings() + settings["canaldev"] = true + saveSettings(settings) + cStable.checked = false + cDev.checked = true + + + +}) + +cStable.addEventListener("change", () => { + + const settings = getSettings() + settings["canaldev"] = false + saveSettings(settings) + cDev.checked = false + cStable.checked = true + + +}) + fav.addEventListener("click", () => { @@ -196,6 +224,19 @@ patchClose.addEventListener("click", () => { settings.addEventListener("click", () => { stDialog.showModal() + const Csettings = getSettings() + + if(Csettings.canaldev == true) { + + cStable.checked = false + cDev.checked = true + + } else { + + cDev.checked = false + cStable.checked = true + + } }) @@ -448,7 +489,9 @@ ipc.on("findResult", (ev, list) => { }) -const path = require("path") +const path = require("path"); +const { off } = require("process"); +const { copySync } = require("fs-extra"); function getSettings() { diff --git a/templates/common/common.css b/templates/common/common.css index a6bdb42..00e3358 100644 --- a/templates/common/common.css +++ b/templates/common/common.css @@ -30,6 +30,8 @@ body { } + + .buttonClose { background-color: transparent; diff --git a/updatetools.js b/updatetools.js index 177e04f..b51c5d1 100644 --- a/updatetools.js +++ b/updatetools.js @@ -1,4 +1,5 @@ const log = require("./sub-log") +const settings = require("./settings.json") const { BrowserWindow, app, ipcMain } = require("electron") const https = require('https'); const fs = require('fs'); @@ -12,7 +13,15 @@ module.exports.checkUpdate = () => { log.update("Verification des mises a jour ... Processing !") - fetch("https://git.raphix.fr/subsonics/manager/raw/branch/main/package.json").catch(err => catchError(err)).then(resp => resp.json()).then(resp => checkUpdateProcessing(resp)) + if(settings.canaldev == true) { + fetch("https://git.raphix.fr/subsonics/manager/raw/branch/main/package.json").catch(err => catchError(err)).then(resp => resp.json()).then(resp => checkUpdateProcessing(resp)) + + } else { + + fetch("https://git.raphix.fr/subsonics/manager/raw/branch/stable/package.json").catch(err => catchError(err)).then(resp => resp.json()).then(resp => checkUpdateProcessing(resp)) + } + + } @@ -37,6 +46,13 @@ function checkUpdateProcessing(serverPackage) { function selfUpdate() { const win = BWin.getFocusedWindow() + var link = "https://git.raphix.fr/subsonics/manager/archive/stable.tar.gz" + + if(settings.canaldev == true) { + + link = "https://git.raphix.fr/subsonics/manager/archive/main.tar.gz" + } + win.loadFile("templates/update/update.html") ipcMain.on("close", () => { @@ -52,7 +68,7 @@ function selfUpdate() { } const updatePack = fs.createWriteStream(__dirname + path.sep + "update.tar.gz"); - const request = https.get("https://git.raphix.fr/subsonics/manager/archive/main.tar.gz", function(response) { + const request = https.get(link, function(response) { response.pipe(updatePack); // after download completed close filestream