Compare commits

...

35 Commits
2.0 ... main

Author SHA1 Message Date
a7d7afa2c3 Version 2.4.2 - Change Logo Version 2023-09-17 14:08:34 +02:00
2413f42686 Version 2.4.2 - Change Logo Version 2023-09-17 14:06:19 +02:00
e4981ca3fc Logo Changé 2023-09-07 23:32:02 +02:00
8ce7f71fad Version 2.4.0 - Update to Site" 2023-08-29 12:20:07 +02:00
8653740ea9 2.3.0 Change Some little thing 2023-05-05 19:29:17 +02:00
fa38043a23 2.2.9 Change Some little thing 2023-05-05 19:16:19 +02:00
fe2688d6b6 2.2.8 Change Volume 2023-05-05 13:53:36 +02:00
738020b16f 2.2.7 Change Volume 2023-05-04 22:12:49 +02:00
3e89e43d6b 2.2.6 Rework Graphique 2023-05-04 22:04:06 +02:00
8f52c1549a 2.2.5 Final 2 Version 2023-05-04 17:46:02 +02:00
601cf636cb 2.2.4 Official Version 2023-05-03 20:47:04 +02:00
0d7a77a3bd 2.2.3 Official Version 2023-05-02 21:20:47 +02:00
d03014cd42 2.2.2 Official Version 2023-05-02 21:09:29 +02:00
d5d1226f8a 2.2.1 Official Version 2023-05-02 20:59:07 +02:00
5d601785fd 2.2.1 Official Version 2023-05-02 20:52:28 +02:00
152e4f8995 Stable Version 2.2.0 2023-05-02 20:43:06 +02:00
d47152c7c9 2.2.0 Official Version 2023-05-02 20:40:55 +02:00
634a6e2b7b 2.1.7 Offical Version 2023-05-02 12:22:33 +02:00
1bb292d1c2 2.1.6 Offical Version 2023-05-02 00:01:40 +02:00
b7b6846c0e 2.1.5 Offical Version 2023-05-01 23:55:21 +02:00
4af63ae4bd 2.1.4 Offical Version 2023-05-01 23:49:21 +02:00
411a2785bc 2.1.3 Offical Version 2023-05-01 23:44:41 +02:00
af6041af0c 2.1.2 Offical Version 2023-05-01 23:41:37 +02:00
e130e2c761 2.1.2 Offical Version 2023-05-01 23:39:49 +02:00
5523e94cff 2.1.1 PreRelease Version 2023-04-30 23:42:49 +02:00
93f793bd95 2.0.1 Official Version 2023-04-30 19:00:04 +02:00
bc37d7811f 2.0.9 PreRelease Version 2023-04-29 23:23:37 +02:00
733aa33b2a 2.0.8 PreRelease Version 2023-04-29 20:05:31 +02:00
ca6922c84a 2.0.7 PreRelease Version 2023-04-29 19:36:06 +02:00
832e81decf 2.0.6 PreRelease Version 2023-04-29 19:32:36 +02:00
856db533ad 2.0.5 PreRelease Version 2023-04-29 19:29:33 +02:00
df7d47d920 2.0.4 PreRelease Version 2023-04-29 19:21:36 +02:00
59eb33dc94 2.0.3 PreRelease Version 2023-04-29 19:07:38 +02:00
3d38fea6c5 2.0.2 PreRelease Version 2023-04-29 19:03:19 +02:00
8701ea5d4a First try implements AutoUpdate 2023-04-29 18:19:45 +02:00
33 changed files with 1745 additions and 1676 deletions

193
README.md
View File

@ -1,2 +1,193 @@
# manager <h1><u>Subsonics 2.2.7</u></h1>
<p>Sortie le : 04/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Volume : Possibilité d'aller à 200%</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.6</u></h1>
<p>Sortie le : 04/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Modification de certains textes</li>
<li><strong>[CHANGE]</strong> : Modification des tailles et du positionnement des éléments </li>
</ul>
<hr>
<h1><u>Subsonics 2.2.5</u></h1>
<p>Sortie le : 04/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Changement du titre pour toutes les fenêtres de l'application</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.4</u></h1>
<p>Sortie le : 03/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Changement du titre de l'application</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.3</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Fix Canal</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.2</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Fix import settings</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.1</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Fix import settings</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.0</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> : Update : Add Dev & Stable Canal for update.</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.7</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Settings : Favoris won't be deleted on new connection</li>
<li><strong>[FIX]</strong> : Logs : Logs goes on wrong folder</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.6</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Logs : Logs goes on wrong folder</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.5</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Second Tentative to fix Update Checker</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.4</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Settings : Settings wont't be deleted after signout</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.3</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Update Checker</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.2</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> : Favoris : Vous pouvez désormais sauvegarder plusieurs playlists de lecture.</li>
<li><strong>[FIX]</strong> : Profil : Augumentation de la taille de l'image</li>
<li><strong>[AJOUT]</strong> : Site : Création d'un site pour télécharger le logiciel. </li>
</ul>
<hr>
<h1><u>Subsonics 2.1.1</u></h1>
<p>Sortie le : 31/04/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Bug ou Suggestion Report : Se clear après utilisation</li>
<li><strong>[AJOUT]</strong> : Update : Ajout de l'Update forcée.</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.0</u></h1>
<p>Sortie le : 30/04/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> : Bug ou Suggestion Report : Disponible dans les paramètres. Nouvelle onglet qui permet de soit faire une suggestion ou de reporter un bug.</li>
<li><strong>[FIX]</strong> : UserState : Enième tentative qui a l'air de marcher pour fixer le bug du token et du user inconnu ce qui empechait d'afficher le pseudo de l'utilisateur</li>
<li><strong>[AJOUT]</strong> : Liste de lecture : Déplacement des chansons dans la liste de lecture.</li>
<li><strong>[FIX]</strong> : Tray : Fix de l'icone qui ne se chargait pas.</li>
<li><strong>[CHANGE]</strong> : Dev Version : Remise en forme de la banderole pour éviter le gros bandeau rouge abusif</li>
</ul>
<hr>
<h1><u>Subsonics 2.0.9</u></h1>
<p>Sortie le : 29/04/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Le fichier de MAJ compressé est désormais supprimé au début et à la fin de la MAJ afin d'éviter les SoftLock en cas de bugs</li>
<li><strong>[AJOUT]</strong> : Dev Version : Une banderole s'affiche lorsque la version est expérimentale.</li>
<li><strong>[AJOUT]</strong> : Logs : Disponible dans l'emplacement de l'application puis dans ./resources/app/logs/</li>
<li><strong>[AJOUT]</strong> : Patch Note : Ajout de la fonctionnalité de ce que vous lisez en ce moment.</li>
<li><strong>[CHANGE]</strong> : Graphique : Uniformisation des couleurs.</li>
</ul>
<hr>
<!--Info version Example
<hr>
<h1><u>Subsonics x.x.x</u></h1>
<p>Sortie le : --/--/----</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> </li>
<li><strong>[FIX]</strong> </li>
</ul>
<hr>
-->

230
infoupdate.html Normal file
View File

@ -0,0 +1,230 @@
<h1><u>Subsonics 2.3.0</u></h1>
<p>Sortie le : 05/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Modification des tailles et du positionnement des éléments </li>
</ul>
<hr>
<h1><u>Subsonics 2.2.9</u></h1>
<p>Sortie le : 05/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Modification des tailles et du positionnement des éléments </li>
<li><strong>[CHANGE]</strong> : Modification des couleurs pour préparer au rework graphique. </li>
</ul>
<hr>
<h1><u>Subsonics 2.2.8</u></h1>
<p>Sortie le : 05/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Modification des tailles et du positionnement des éléments </li>
<li><strong>[CHANGE]</strong> : Modification des couleurs pour préparer au rework graphique. </li>
<li><strong>[FIX]</strong> : Volume : Se reset après déconnexion</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.7</u></h1>
<p>Sortie le : 04/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Volume : Possibilité d'aller à 200%</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.6</u></h1>
<p>Sortie le : 04/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Modification de certains textes</li>
<li><strong>[CHANGE]</strong> : Modification des tailles et du positionnement des éléments </li>
</ul>
<hr>
<h1><u>Subsonics 2.2.5</u></h1>
<p>Sortie le : 04/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Changement du titre pour toutes les fenêtres de l'application</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.4</u></h1>
<p>Sortie le : 03/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[CHANGE]</strong> : Changement du titre de l'application</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.3</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Fix Canal</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.2</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Fix import settings</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.1</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Fix import settings</li>
</ul>
<hr>
<h1><u>Subsonics 2.2.0</u></h1>
<p>Sortie le : 02/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> : Update : Add Dev & Stable Canal for update.</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.7</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Settings : Favoris won't be deleted on new connection</li>
<li><strong>[FIX]</strong> : Logs : Logs goes on wrong folder</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.6</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Logs : Logs goes on wrong folder</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.5</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Second Tentative to fix Update Checker</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.4</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Settings : Settings wont't be deleted after signout</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.3</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Update Checker</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.2</u></h1>
<p>Sortie le : 01/05/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> : Favoris : Vous pouvez désormais sauvegarder plusieurs playlists de lecture.</li>
<li><strong>[FIX]</strong> : Profil : Augumentation de la taille de l'image</li>
<li><strong>[AJOUT]</strong> : Site : Création d'un site pour télécharger le logiciel. </li>
</ul>
<hr>
<h1><u>Subsonics 2.1.1</u></h1>
<p>Sortie le : 31/04/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Bug ou Suggestion Report : Se clear après utilisation</li>
<li><strong>[AJOUT]</strong> : Update : Ajout de l'Update forcée.</li>
</ul>
<hr>
<h1><u>Subsonics 2.1.0</u></h1>
<p>Sortie le : 30/04/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> : Bug ou Suggestion Report : Disponible dans les paramètres. Nouvelle onglet qui permet de soit faire une suggestion ou de reporter un bug.</li>
<li><strong>[FIX]</strong> : UserState : Enième tentative qui a l'air de marcher pour fixer le bug du token et du user inconnu ce qui empechait d'afficher le pseudo de l'utilisateur</li>
<li><strong>[AJOUT]</strong> : Liste de lecture : Déplacement des chansons dans la liste de lecture.</li>
<li><strong>[FIX]</strong> : Tray : Fix de l'icone qui ne se chargait pas.</li>
<li><strong>[CHANGE]</strong> : Dev Version : Remise en forme de la banderole pour éviter le gros bandeau rouge abusif</li>
</ul>
<hr>
<h1><u>Subsonics 2.0.9</u></h1>
<p>Sortie le : 29/04/2022</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[FIX]</strong> : Update : Le fichier de MAJ compressé est désormais supprimé au début et à la fin de la MAJ afin d'éviter les SoftLock en cas de bugs</li>
<li><strong>[AJOUT]</strong> : Dev Version : Une banderole s'affiche lorsque la version est expérimentale.</li>
<li><strong>[AJOUT]</strong> : Logs : Disponible dans l'emplacement de l'application puis dans ./resources/app/logs/</li>
<li><strong>[AJOUT]</strong> : Patch Note : Ajout de la fonctionnalité de ce que vous lisez en ce moment.</li>
<li><strong>[CHANGE]</strong> : Graphique : Uniformisation des couleurs.</li>
</ul>
<hr>
<!--Info version Example
<hr>
<h1><u>Subsonics x.x.x</u></h1>
<p>Sortie le : --/--/----</p>
<h2 style="font-size: 18px;">Ajouts & Fixes :</h2>
<ul>
<li><strong>[AJOUT]</strong> </li>
<li><strong>[FIX]</strong> </li>
</ul>
<hr>
-->

341
main.js
View File

@ -3,9 +3,8 @@ const path = require("path")
const fs = require("fs") const fs = require("fs")
const ipc = ipcMain const ipc = ipcMain
const { io } = require("socket.io-client"); const { io } = require("socket.io-client");
const log = require("./sublog"); const log = require("./sub-log");
const { platform } = require("os"); const updater = require("./updatetools")
// [Function] Main Window Function // [Function] Main Window Function
// BUILDER "build": " // BUILDER "build": "
@ -13,354 +12,46 @@ const { platform } = require("os");
async function createWindow() { async function createWindow() {
const win = new BrowserWindow({ const win = new BrowserWindow({
width: 300, width: 1920,
height: 500, height: 1080,
minWidth: 300, minWidth: 1280,
minHeight: 500, minHeight: 720,
resizable: false, resizable: true,
movable: true, movable: true,
closable: true, closable: true,
frame: false, frame: true,
autoHideMenuBar: true,
icon: path.join(__dirname, './src/logo.ico'), icon: path.join(__dirname, './src/logo.ico'),
title: "Submanager", title: "Submanager",
webPreferences: { webPreferences: {
nodeIntegration: true,
contextIsolation: false,
devTools: true devTools: true
} }
}) })
if(process.env.DEV != "true") {
updater.checkUpdate()
await win.loadFile("templates/login/login.html")
var socket = null
if(process.env.DEV == "true") {
socket = io("ws://localhost:4000", {
autoConnect: false,
reconnection: false
});
log.client("DEVELOPMENT MODE --- QUIT IMMEDIATELY")
} else {
socket = io("ws://alpha.raphix.fr:4000", {
autoConnect: false,
reconnection: false
})
}
socket.connect()
socket.on("connect", () => {
log.client("Connexion au serveur ... Finish !")
if(!fs.existsSync( __dirname + path.sep + "settings.json")) {
win.webContents.send("connectSuccess")
} else {
const settings = require( __dirname + path.sep + "settings.json")
if(settings.token) {
log.client("Auth : Connexion avec le Token Discord !")
socket.emit("authByToken", settings.token)
} else {
win.webContents.send("connectSuccess")
}
}
})
socket.on("authByTokenAnswer", (resp, token) => {
if(resp == true) {
win.loadFile("templates/app/app.html")
} else {
fs.rmSync( __dirname + path.sep + "settings.json")
win.webContents.send("connectFailed")
}
})
socket.io.on("error", () => {
log.client("Erreur lors de la connexion entre le serveur et le client !")
win.webContents.send("connectFailed")
})
ipc.on("retryLogin", () => {
log.client("Reconnexion au serveur ... Progressing !")
socket.close()
socket.connect()
})
ipc.on("stateOfConnection", () => {
if(socket.disconnected == true) {
socket.connect()
} else { } else {
if(!fs.existsSync( __dirname + path.sep + "settings.json")) { log.update("Desactivation des mises a jour -> DEV MOD ENABLE")
win.webContents.send("connectSuccess")
} else {
const settings = require( __dirname + path.sep + "settings.json")
if(settings.token) {
log.client("Auth : Connexion avec le Token Discord !")
socket.emit("authByToken", settings.token)
} else {
win.webContents.send("connectSuccess")
} }
} await win.loadURL("https://subsonics.raphix.fr")
}
})
ipc.on("discordlogin", () => {
socket.emit("authNeedLogin")
log.client("Discord Auth : Demande du Token vers le serveur !")
win.minimize()
})
socket.on("authFailed", () => {
win.webContents.send("discordFailed")
win.restore()
log.client("Discord Auth : Erreur lors de la connexion vers Discord !")
})
socket.on("checkFailed", () => {
win.webContents.send("discordCheckFailed")
win.restore()
log.client("Discord Auth : Erreur lors de la vérification de Discord !")
})
socket.on("authOpenLink", (link) => {
log.client("Discord Auth : Redirection vers le service Discord !")
shell.openExternal(link)
})
socket.on("successLogin", (token) => {
const settings = {}
settings["token"] = token
fs.writeFile(__dirname + path.sep + "settings.json", JSON.stringify(settings, null, 2), (err) => {
log.client("Saving token in settings !")
log.client("Discord Auth : Redirection fait avec succes !")
win.loadFile("templates/app/app.html")
askUpdateState()
win.restore()
})
})
socket.on("updateState", (data) => {
log.client("State : Update en cours !")
win.webContents.send("updateData", data)
})
socket.on("actualize", (data) => {
log.client("Actualisation : Update en cours !")
win.webContents.send("actualize", data)
})
socket.on("findResult", (data) => {
log.client("Recherche : Termine et recupere")
win.webContents.send("findResult", data)
})
ipc.on("play", () => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Play / Pause Requested !")
socket.emit("play", settings.token)
})
ipc.on("loop", () => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Loop Requested !")
socket.emit("loop", settings.token)
})
ipc.on("forward", () => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Forward Requested !")
socket.emit("forward", settings.token)
})
ipc.on("backward", () => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Backward Requsted !")
socket.emit("backward", settings.token)
})
ipc.on("exitBot", () => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Exit Bot Requsted !")
socket.emit("exit", settings.token)
})
ipc.on("deleteQueue", (ev, identifier) => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Delete Track queue Bot Requsted !")
socket.emit("deleteQueue", settings.token, identifier)
})
ipc.on("findReq", (ev, value) => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Find search Bot Requsted !")
socket.emit("find", settings.token, value)
})
ipc.on("addQueue", (ev, url) => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Add song Bot Requsted !")
socket.emit("addQueue", settings.token, url)
})
ipc.on("listClear", () => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Clear Queue Bot Requsted !")
socket.emit("listClear", settings.token)
})
ipc.on("restart", () => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Restart Bot Requsted !")
socket.emit("restart", settings.token)
})
ipc.on("seek", (ev, pos) => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Seek Bot Requsted !")
socket.emit("seek", settings.token, pos)
})
ipc.on("volume", (ev, pos) => {
const settings = require( __dirname + path.sep + "settings.json")
log.client("Control : Volume Bot Requsted !")
socket.emit("volume", settings.token, pos)
})
ipc.on("signout", () => {
if(fs.statSync(__dirname + path.sep + "settings.json")) {
fs.rmSync(__dirname + path.sep + "settings.json")
}
win.loadFile("template/login/login.html")
socket.disconnect()
})
if (process.defaultApp) {
if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient('submanager', process.execPath, [path.resolve(process.argv[1])])
}
} else {
app.setAsDefaultProtocolClient('submanager')
}
ipc.on("close", () => {
socket.disconnect()
app.quit()
})
ipc.on("minimize", () => {
win.minimize()
})
ipc.on("askUpdateState", () => {
askUpdateState()
})
async function askUpdateState() {
const settings = require( __dirname + path.sep + "settings.json")
console.log(settings.token)
await socket.emit("getState", settings.token)
}
socket.on("disconnect", async () => {
await win.loadFile("templates/login/login.html")
await win.webContents.send("connectFailed")
});
} }
function sts() {
const settings = require( __dirname + path.sep + "settings.json")
return settings
}
app.on("open-url", (ev, url) => { app.on("open-url", (ev, url) => {
app.quit() app.quit()
}) })
app.whenReady().then(() => { app.whenReady().then(() => {
const icon = nativeImage.createFromPath('src/logo.png') const icon = nativeImage.createFromPath(__dirname + path.sep + 'src' + path.sep + "logo.ico")
tray = new Tray(icon) tray = new Tray(icon)
@ -373,8 +64,10 @@ app.whenReady().then(() => {
//[Operation] - Check settings //[Operation] - Check settings
createWindow() log.client("Submanager - Version : " + require("./package.json").version + " - Raphix")
log.client("Starting Application") log.client("Starting Application")
createWindow()
app.on('activate', () => { app.on('activate', () => {

961
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,12 @@
{ {
"name": "subsonics-manager", "name": "subsonics-manager",
"version": "2.0.0", "version": "2.4.2",
"description": "Manager for subsonics", "description": "Manager for subsonics",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
"start": "electron .", "start": "electron .",
"dev": "set DEV=true& electron .", "dev": "set DEV=true& electron .",
"build": "electron-packager . submanager-app --platform='win32' --out='./dist/' --icon='./src/logo.ico' --overwrite --ignore='(settings.json)'" "build": "electron-packager . submanager-app --platform='win32' --out='./dist/' --icon='./src/logo.ico' --overwrite --ignore='(settings.json)'"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -17,13 +16,13 @@
"author": "Raphix", "author": "Raphix",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"decompress": "^4.2.1",
"fs-extra": "^11.1.1",
"socket.io-client": "^4.6.1" "socket.io-client": "^4.6.1"
}, },
"devDependencies": { "devDependencies": {
"electron": "^24.1.2", "electron": "^24.1.2",
"electron-packager": "^17.1.1" "electron-packager": "^17.1.1"
},
"dev": true
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 64 KiB

BIN
src/title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/title.png~ Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

88
sub-log.js Normal file
View File

@ -0,0 +1,88 @@
const fs = require("fs")
const path = require("path")
const { app } = require("electron")
if(!fs.existsSync(__dirname + path.sep + "logs" + path.sep)) {
fs.mkdirSync(__dirname + path.sep + "logs")
}
var logStream = fs.createWriteStream(__dirname + path.sep + "logs" + path.sep + getDate() + ".log", {
flags: 'a'
});
logStream.write("[" + require("./package.json").name + "@" + require("./package.json").version + "] - [" + getDate() + "]" + "\n")
logStream.write("Submanager by Raphix" + "\n")
logStream.write("----------------------------------------------------------------" + "\n")
module.exports.client = (message) => {
logStream.write("[Subsonics-Client] - " + getDate() + " - " + message + "\n")
console.log("[Subsonics-Client] - " + getDate() + " - " + message)
}
module.exports.client.error = (message) => {
logStream.write("[Subsonics-Client] - [ERROR] - " + getDate() + " - " + message + "\n")
console.error("[Subsonics-Client] - [ERROR] - " + getDate() + " - " + message)
}
module.exports.update = (message) => {
logStream.write("[Subsonics-Update] - " + getDate() + " - " + message + "\n")
console.error("[Subsonics-Update] - " + getDate() + " - " + message)
}
function getDate() {
var date = new Date()
// [Date Format] - Format de la date
var gmonth = date.getMonth()
var gday = date.getDate()
var gHour = date.getHours()
var gMinute = date.getMinutes()
var gSecondes = date.getSeconds()
if(date.getMonth() + 1 <= 9) {
gmonth = "0" + (date.getMonth() + 1)
}
if(date.getDate() + 1 <= 9) {
gday = "0" + date.getDate()
}
if(date.getHours() + 1 <= 9) {
gHour = "0" + date.getHours()
}
if(date.getMinutes() + 1 <= 9) {
gMinute = "0" + date.getMinutes()
}
if(date.getSeconds() + 1 <= 9) {
gSecondes = "0" + date.getSeconds()
}
return date.getFullYear() + "-" + gmonth + "-" + gday + "-" + gHour + "h" + "-" + gMinute + "m" + "-" + gSecondes + "s"
}
process.on('uncaughtException', (err) => {
logStream.write("[" + getDate() + "] - ["+ "FATAL" + "] - [ Subsonics-Manager ]" + " The programm has encountered an error ! Please Restart ! #E = " + err + "\n")
logStream.end( "["+ "UNCAUGHT_EXCEPTION" + "]" + " - [END OF LOGS] - [" + getDate() + ']')
logStream.close()
});
app.on("before-quit", () => {
logStream.end( "["+ "NORMAL_END" + "]" + " - [END OF LOGS] - [" + getDate() + ']')
logStream.close()
})

View File

@ -1,76 +0,0 @@
module.exports.client = (message) => {
var date = new Date()
// [Date Format] - Format de la date
var gmonth = date.getMonth()
var gday = date.getDate()
var gHour = date.getHours()
var gMinute = date.getMinutes()
var gSecondes = date.getSeconds()
if(date.getMonth() + 1 <= 9) {
gmonth = "0" + (date.getMonth() + 1)
}
if(date.getDate() + 1 <= 9) {
gday = "0" + date.getDate()
}
if(date.getHours() + 1 <= 9) {
gHour = "0" + date.getHours()
}
if(date.getMinutes() + 1 <= 9) {
gMinute = "0" + date.getMinutes()
}
if(date.getSeconds() + 1 <= 9) {
gSecondes = "0" + date.getSeconds()
}
var currentDate = date.getFullYear() + "-" + gmonth + "-" + gday + "-" + gHour + "h" + "-" + gMinute + "m" + "-" + gSecondes + "s"
console.log("[Subsonics-Client] - " + currentDate + " - " + message)
}
module.exports.client.error = (message) => {
var date = new Date()
// [Date Format] - Format de la date
var gmonth = date.getMonth()
var gday = date.getDate()
var gHour = date.getHours()
var gMinute = date.getMinutes()
var gSecondes = date.getSeconds()
if(date.getMonth() + 1 <= 9) {
gmonth = "0" + (date.getMonth() + 1)
}
if(date.getDate() + 1 <= 9) {
gday = "0" + date.getDate()
}
if(date.getHours() + 1 <= 9) {
gHour = "0" + date.getHours()
}
if(date.getMinutes() + 1 <= 9) {
gMinute = "0" + date.getMinutes()
}
if(date.getSeconds() + 1 <= 9) {
gSecondes = "0" + date.getSeconds()
}
var currentDate = date.getFullYear() + "-" + gmonth + "-" + gday + "-" + gHour + "h" + "-" + gMinute + "m" + "-" + gSecondes + "s"
console.error("[Subsonics-Client] - [ERROR] - " + currentDate + " - " + message)
}

View File

@ -1,500 +0,0 @@
.logo {
width: 15%;
border-radius: 100%;
margin-right: 5px;
}
.box {
display: flex;
padding: 5%;
color: white;
border-radius: 15px;
background-color: rgb(38, 37, 37);
font-size: 12px;
justify-content: space-between;
align-items: center;
margin-top: 5px;
}
.exitNotShow {
display: none;
}
.number {
font-size: 11px;
color: black;
box-shadow: 1px 1px 5px white;
border: none;
border-radius: 100%;
text-align: center;
justify-content: center;
vertical-align: middle;
width: 14px;
height: 14px;
background-color: white;
margin: 0;
position: absolute; /* Position the badge within the relatively positioned button */
top: 0;
right: -2px;
}
.list {
display: inline-block;
position: relative;
}
.controller-box {
display: flex;
flex-direction: column;
padding: 5%;
color: white;
border-radius: 15px;
background-color: rgb(38, 37, 37);
font-size: 12px;
justify-content: space-between;
align-items: center;
margin-top: 5px;
}
.signout {
background-color: transparent;
color: red;
border: none;
transition: all 0.2s ease 0s;
height: 30px;
width: 30px;
}
.signout:hover {
border-radius: 100%;
background-color: red;
border-color: transparent;
color: white;
}
.signout:active {
background-color: transparent;
color: red;
border: none;
transition: all 0.2s ease 0s;
}
.act {
display: flex;
flex-direction: row;
}
.settings {
background-color: transparent;
color: white;
border: none;
transition: all 0.2s ease 0s;
height: 30px;
width: 30px;
margin-right: 5px;
}
.settings:hover {
border-radius: 100%;
background-color: rgb(46, 196, 255);
border-color: transparent;
color: black;
}
.settings:active {
background-color: transparent;
color: rgb(46, 196, 255);
border: none;
transition: all 0.2s ease 0s;
}
.restart {
font-family: 'Open Sans', sans-serif !important;
background-color: transparent;
border: solid;
border-radius: 15px;
padding: 2%;
border-color: rgb(46, 196, 255);
color: white;
transition: all 0.2s ease 0s;
}
.restart:hover {
color: black;
background-color: rgb(46, 196, 255);
box-shadow: 2px 2px 5px rgb(46, 196, 255);
}
.restart:active {
background-color: transparent;
color: white;
}
.stLine {
display: flex;
flex-direction: row;
text-align: start;
align-items: center;
}
.stPct {
text-align: center;
}
.stLine p {
width: 100px;
margin: 0;
}
.online-light {
border-radius: 15%;
background-color: rgb(55, 255, 37);
padding: 2%;
color: black;
display: flex;
align-items: center;
vertical-align: center;
margin-left: 10px;
}
.numtext {
display: inline-block;
padding-top: 2px !important;
padding-left: 1px;
}
.thumbnail {
width: 30px;
height: 20px;
margin-right: 10px;
}
.title {
word-break: keep-all;
}
.grised {
filter : invert(50%);
}
.playbar {
width: 100%;
border: none;
row-gap: 10px;
display: flex;
text-align: center;
align-items: center;
justify-content: center;
gap: 10px;
}
.bbar {
width: 100%;
padding: 10%;
display: flex;
display: flex;
text-align: center;
align-items: center;
justify-content: space-between;
padding-bottom: 0;
}
.sbar {
width: 100%;
padding: 1%;
display: flex;
text-align: center;
align-items: center;
justify-content: space-between;
}
.durationText {
margin: 0;
margin-left: 5px;
}
input[type=range] {
height: 26px;
-webkit-appearance: none;
margin: 10px 0;
width: 100%;
background-color: transparent;
-webkit-user-select: none;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 8px;
cursor: pointer;
transition: 0.2s;
box-shadow: 1px 1px 2px #000000;
background: #B8B8B8;
border-radius: 50px;
border: 0px solid #000000;
}
input[type=range]::-webkit-slider-thumb {
box-shadow: 1px 1px 1px #000000;
border: 1px solid #000000;
height: 13px;
width: 13px;
border-radius: 50px;
background: #FFFFFF;
cursor: pointer;
-webkit-appearance: none;
margin-top: -3px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #B8B8B8;
}
input[type=range]:focus::-webkit-sl {
}
.secondary {
background-color: #171A21;
color: white;
border: none;
border-radius: 100%;
font-size: 30px;
padding: 2%;
padding-right: 7%;
padding-left: 7%;
transition: all 0.2s ease 0s;
border: solid;
border-width: 5px;
border-color: #171A21 ;
}
.secondary:active {
background-color: transparent;
}
.primary {
background-color: white ;
color: #171A21;
border: none;
border-radius: 100%;
font-size: 35px;
padding: 5%;
padding-right: 10%;
padding-left: 10%;
transition: all 0.2s ease 0s;
border: solid;
border-width: 5px;
border-color: white ;
}
.primary:active {
background-color: transparent;
color: white;
}
.third {
color: white;
background-color: transparent;
border: none;
border-radius: 100%;
text-shadow: 1px 1px 10px white;
font-size: 16px;
}
.third-join {
color: rgb(53, 255, 35);
background-color: transparent;
border: none;
border-radius: 100%;
text-shadow: 1px 1px 10px rgb(53, 255, 35);
font-size: 16px;
}
.third-leave {
color: rgb(255, 35, 35);
background-color: transparent;
border: none;
border-radius: 100%;
text-shadow: 1px 1px 10px rgb(255, 27, 27);
font-size: 16px;
}
.error {
color: rgb(255, 35, 35);
background-color: transparent;
border: none;
border-radius: 100%;
text-shadow: 1px 1px 5px rgb(255, 27, 27);
font-size: 12px;
text-align: center;
}
#listContent {
padding: 5%;
}
.infoVersion {
color: rgb(31, 30, 30);
text-align: center;
font-size: 10px;
}
.menu {
border: none;
padding: 5%;
color: white;
border-radius: 15px;
background-color: rgb(61, 61, 61);
font-size: 12px;
justify-content: space-between;
align-items: center;
width: 100%;
}
.listTitle {
color: white;
margin: 0;
font-size: 10px;
}
.menuheader {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
text-align: center;
}
.listHeader {
text-align: center;
margin: 0;
font-size: 16px;
text-shadow: 1px 1px 3px white;
}
/* width */
::-webkit-scrollbar {
width: 5px;
margin-right: 10px;
}
/* Track */
::-webkit-scrollbar-track {
box-shadow: inset 0 0 5px grey;
border-radius: 10px;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #171A21;
border-radius: 10px;
}
.song {
display: flex;
flex-direction: row;
margin: 0;
vertical-align: middle;
align-items: center;
justify-content: space-between;
}
.titleSong {
width: 100%;
}
.finder {
margin-top: 10px;
width: 100%;
background-color: transparent;
transition: all 0.2s ease 0s;
border: solid white 1px;
border-radius: 15px;
padding: 7px;
color: white;
padding-left: 20px;
text-decoration: none;
margin-bottom: 10px;
}
.finder:hover {
box-shadow: 1px 1px 5px white;
}
.cp {
margin: 0;
}

View File

@ -1,107 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Submanager - Login</title>
<link rel="stylesheet" href="../common/common.css">
<link rel="stylesheet" href="app.css">
</head>
<body>
<header>
<div class="top-title">
<h1><img class="top-logo rounded" src="../../src/logo.png" alt="Logo"> Subsonics</h1>
</div>
<button id="minimizeBtn" class="buttonReduce"><i class="fas fa-window-minimize"></i></button>
<button id="closeBtn" class="buttonClose"><i class="fas fa-times"></i></button>
</header>
<div class="content">
<div class="box">
<span id="music_img"><img class="thumbnail" src="../common/Mediamodifier-Design.svg"></span>
<span id="music_title" class="title">Aucun titre joué</span>
<div class="online-light"><i style="margin-right: 2px;" class="fas fa-user-friends"></i> <span id="online">0</span></div>
</div>
<div class="controller-box">
<div class="playbar">
<button id="backward" class="secondary"><i class="fas fa-step-backward"></i></button>
<button id="play" class="primary"><i class="fas fa-play"></i></button>
<button id="forward" class="secondary"><i class="fas fa-step-forward"></i></button>
</div>
<div class="bbar">
<button id="search" class="third"><i class="fa fa-search"></i></button>
<button id="loop" class="third"><i class="fa fa-retweet"></i></button>
<span id="exitSpan" class="exit"></span>
<button id="list" class="list third"><i class="fa fa-list-ol"><p class="number" id="listNumber"></p></i></button>
</div>
<div class="sbar">
<input id="duration" type="range" value="0" max="100">
<p id="durationText" class="durationText">0:00/0:00</p>
</div>
</div>
<div class="box">
<div>
<span id="logo"><img class="logo" src="../../src/logo.png"></span>
<span id="username"></span>
</div>
<div class="act">
<button id="settings" class="settings"><i class="fas fa-gear"></i></button>
<button id="signout" class="signout"><i class="fas fa-sign-out"></i></button>
</div>
</div>
</div>
<dialog id="listDialog" class="menu">
<div class="menuheader">
<p class="listHeader"><i style="margin-right: 3px" class="fa fa-list-ol"></i> Liste de lecture</p>
<div>
<button class="buttonClose" id="listClear"><i class="fas fa-trash"></i></button>
<button class="buttonClose" id="listClose"><i class="fas fa-times"></i></button>
</div>
</div>
<div id="listContent">
</div>
</dialog>
<dialog id="searchDialog" class="menu">
<div class="menuheader">
<p class="listHeader"><i style="margin-right: 3px" class="fa fa-search"></i> Rechercher</p>
<button class="buttonClose" id="searchClose"><i class="fas fa-times"></i></button>
</div>
<input id="searchBar" class="finder" type="text" placeholder="Nom ou lien">
<div id="searchContent">
</div>
</dialog>
<dialog id="stDialog" class="menu">
<div class="menuheader">
<p class="listHeader"><i style="margin-right: 3px" class="fa fa-gear"></i> Paramètres</p>
<button class="buttonClose" id="stClose"><i class="fas fa-times"></i></button>
</div>
<div class="stLine">
<p>Volume :</p>
<input type="range" id="volCursor">
<p class="stPct" id="volPct">0%</p>
</div>
<div class="stLine">
<p>Actions :</p>
<button id="restart" class="restart"><i class="fas fa-power-off"></i> Redémarrer</button>
</div>
</dialog>
<div class="infoVersion">
<p class="cp">Submanager - Version <span id="version"></span></p>
<p style="margin: 0;">Fait avec 💖 par Raphix</p>
</div>
<script src="../common/bundle.js"></script>
<script src="app.js"></script>
</body>
</html>

View File

@ -1,470 +0,0 @@
const {ipcRenderer} = require("electron");
const ipc = ipcRenderer;
const fs = require("fs")
const packageJson = require("../../package.json")
const logo = document.getElementById("logo")
const username = document.getElementById("username")
const signout = document.getElementById("signout")
const onlineNumber = document.getElementById("online")
const closeBtn = document.getElementById("closeBtn");
const minimizeBtn = document.getElementById("minimizeBtn");
const musicTitle = document.getElementById("music_title")
const musicURL = document.getElementById("music_img")
const exitSpan = document.getElementById("exitSpan")
const list = document.getElementById("list")
const listDialog = document.getElementById("listDialog")
const listClose = document.getElementById("listClose")
const listClear = document.getElementById("listClear")
const listcontent = document.getElementById("listContent")
const listNumber = document.getElementById("listNumber")
const search = document.getElementById("search")
const searchBar = document.getElementById("searchBar")
const searchDialog = document.getElementById("searchDialog")
const searchClose = document.getElementById("searchClose")
const searchcontent = document.getElementById("searchContent")
const durationBar = document.getElementById("duration")
const durationText = document.getElementById("durationText")
const stDialog = document.getElementById("stDialog")
const settings = document.getElementById("settings")
const stClose = document.getElementById("stClose")
const volCursor = document.getElementById("volCursor")
const volPct = document.getElementById("volPct")
const restart = document.getElementById("restart")
restart.addEventListener("click", () => {
stDialog.close()
ipc.send("restart")
})
var durationAll = 0
var durationProgress = 0
var isPlaying = false
settings.addEventListener("click", () => {
stDialog.showModal()
})
stClose.addEventListener("click", () => {
stDialog.close()
})
durationBar.value = 0
listNumber.classList.add("exitNotShow")
function setTime() {
durationBar.max = durationAll
durationProgress += 1000
durationBar.value = durationProgress
const maxhours = Math.floor(durationAll / 3600000);
const nowhours = Math.floor(durationProgress / 3600000);
var maxmin = Math.trunc(durationAll / 60000) - (Math.floor(durationAll / 60000 / 60) * 60);
var maxsec = Math.floor(durationAll / 1000) - (Math.floor(durationAll / 1000 / 60) * 60);
var nowmin = Math.trunc(durationProgress / 60000) - (Math.floor(durationProgress / 60000 / 60) * 60);
var nowsec = Math.floor(durationProgress / 1000) - (Math.floor(durationProgress / 1000 / 60) * 60);
console.log(durationAll)
console.log(durationProgress)
console.log("---------------------")
var now = ""
var max = ""
if (maxmin < 10) {
maxmin = `0${maxmin}`;
}
if (nowmin < 10) {
nowmin = `0${nowmin}`;
}
if (maxsec < 10) {
maxsec = `0${maxsec}`;
}
if (nowsec < 10) {
nowsec = `0${nowsec}`;
}
if(maxhours != 0) {
max = maxhours + ":" + maxmin + ":" + maxsec
} else {
max = maxmin + ":" + maxsec
}
if(nowhours != 0) {
now = nowhours + ":" + nowmin + ":" + nowsec
} else {
now = nowmin + ":" + nowsec
}
durationText.innerHTML = now + "/" + max
}
setInterval(() => {
if(isPlaying == true) {
setTime()
}
}, 1000)
durationBar.addEventListener("change", () => {
ipc.send("seek", durationBar.value)
})
volCursor.addEventListener("change", () => {
ipc.send("volume", volCursor.value)
})
const loop = document.getElementById("loop")
loop.addEventListener("click", () => {
ipc.send("loop")
})
listClear.addEventListener("click", () => {
ipc.send("listClear")
})
searchBar.addEventListener("change", () => {
ipc.send("findReq", searchBar.value)
})
ipc.on("findResult", (ev, list) => {
if(list.tracks != null) {
const data = list.tracks
var contentToPush = new Array()
for(var title of data) {
contentToPush.push(' <div class="song"> <img class="thumbnail" src="' + title.thumbnail + '"><div class="titleSong"> <p class="searchTitle">' + title.title + '</p></div> <button id="' + data.indexOf(title) + '_add" class="buttonReduce"><i class="fa fa-plus"></i></button> </div>')
}
if(contentToPush.join("") == "") {
searchcontent.innerHTML = '<p class="error">Aucun morceau trouvé !</p>'
} else {
searchcontent.innerHTML = contentToPush.join("")
}
for(var title of data) {
const titleBtn = document.getElementById(data.indexOf(title)+ "_add")
titleBtn.addEventListener("click", () => {
searchDialog.close()
searchcontent.innerHTML = ""
searchBar.value = ""
ipc.send("addQueue", data[titleBtn.id.replace("_add", "")].uri)
})
}
} else {
searchcontent.innerHTML = '<p class="error">Aucun morceau trouvé !</p>'
}
})
list.addEventListener("click", () => {
listDialog.showModal()
})
listClose.addEventListener("click", () => {
listDialog.close()
})
search.addEventListener("click", () => {
searchDialog.showModal()
})
searchClose.addEventListener("click", () => {
searchDialog.close()
})
const backward = document.getElementById("backward")
const play = document.getElementById("play")
const forward = document.getElementById("forward")
ipc.send("askUpdateState")
document.getElementById("version").innerHTML = packageJson.version
closeBtn.addEventListener("click", () => {
ipc.send("close");
});
minimizeBtn.addEventListener("click", () => {
ipc.send("minimize")
})
play.addEventListener("click" ,() => {
ipc.send("play")
console.log("PLAY")
})
backward.addEventListener("click" ,() => {
ipc.send("backward")
console.log("BACKWARD")
})
forward.addEventListener("click" ,() => {
ipc.send("forward")
console.log("FORWARD")
})
ipc.on("actualize", (ev, data) => {
isPlaying = false
console.log(data)
onlineNumber.innerHTML = data.onlineNumber
if(data.loop == true) {
loop.innerHTML = '<i class="third-join fa fa-retweet"></i>'
} else {
loop.innerHTML = '<i class="fa fa-retweet"></i>'
}
if(data.volume) {
volCursor.step = 1
volCursor.max = 100
volCursor.value = Math.trunc(data.volume / 10)
volPct.innerHTML = Math.trunc(data.volume / 10) + "%"
} else {
volPct.innerHTML = "0%"
}
if(data.isOnline == true) {
exitSpan.classList.remove("exitNotShow")
loop.classList.remove("exitNotShow")
exitSpan.innerHTML = ' <button id="exit" class="third-leave"><i class="fa fa-phone-slash"></i></button>'
const exit = document.getElementById("exit")
exit.addEventListener("click", () => {
ipc.send("exitBot")
})
volCursor.disabled = false
volCursor.classList.remove("grised")
durationBar.disabled = false
durationBar.classList.remove("grised")
} else {
exitSpan.classList.add("exitNotShow")
loop.classList.add("exitNotShow")
exitSpan.innerHTML = ""
durationBar.disabled = true
durationBar.classList.add("grised")
durationBar.value = 0
volCursor.disabled = true
volCursor.classList.add("grised")
volCursor.value = 0
}
if(data.queue != null) {
var contentToPush = new Array()
var queueNum = 0
for(var title of data.queue) {
queueNum += 1
console.log(queueNum)
console.log(data.queue.indexOf(title) + " - " + title.title)
contentToPush.push(' <div class="song"> <img class="thumbnail" src="' + title.thumbnail + '"><div class="titleSong"> <p class="listTitle">' + title.title + '</p></div> <button id="' + data.queue.indexOf(title) + '_delete" class="buttonClose"><i class="fa fa-trash"></i></button> </div>')
}
if(contentToPush.join("") == "") {
listNumber.classList.add("exitNotShow")
listcontent.innerHTML = '<p class="error">Aucun morceau dans la liste de lecture !</p>'
} else {
listNumber.innerHTML = '<span class="numtext">' + queueNum + '</span>'
listNumber.classList.remove("exitNotShow")
listcontent.innerHTML = contentToPush.join("")
}
for(var title of data.queue) {
console.log(data.queue.indexOf(title) + " - " + title.title)
const titleBtn = document.getElementById(data.queue.indexOf(title)+ "_delete")
titleBtn.addEventListener("click", () => {
ipc.send("deleteQueue", titleBtn.id.replace("_delete", ""))
})
}
} else {
listcontent.innerHTML = '<p class="error">Aucun morceau dans la liste de lecture !</p>'
listNumber.classList.add("exitNotShow")
}
if(data.current == null) {
musicURL.innerHTML = '<img class="thumbnail" src="../common/Mediamodifier-Design.svg">'
musicTitle.innerHTML = "Aucun titre joué"
} else {
setTime()
musicURL.innerHTML = '<img class="thumbnail" src="' + data.current.thumbnail + '">'
musicTitle.innerHTML = data.current.title
}
durationProgress = 0
durationAll = 0
durationBar.value = 0
durationText.innerHTML = "=:==/=:=="
if(data.durationAll) {
isPlaying = true
durationBar.disabled = false
durationBar.classList.remove("grised")
setTime()
durationAll = data.durationAll
durationProgress = data.durationNow
durationBar.value = durationProgress
} else {
isPlaying = false
durationAll = 0
durationProgress = 0
durationBar.disabled = true
durationBar.classList.add("grised")
durationBar.value = 0
durationText.innerHTML = "=:==/=:=="
}
if(data.playing == 1) {
play.innerHTML = '<i style="width: 25px; height: 25px" class="fas fa-pause"></i>'
isPlaying = true
setTime()
} else {
play.innerHTML = '<i style="width: 25px; height: 25px" class="fas fa-play"></i>'
isPlaying = false
}
if(data.current && data.playing == 0) {
setTime()
}
})
ipc.on("updateData", (ev, data) => {
username.innerHTML = data.username
logo.innerHTML = "<img class='logo' src='https://cdn.discordapp.com/avatars/" + data.id + "/" + data.avatar + ".png'>"
})
signout.addEventListener("click", () => {
ipc.send("signout")
})

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1080" height="1080" viewBox="0 0 1080 1080" xml:space="preserve">
<desc>Created with Fabric.js 5.2.4</desc>
<defs>
</defs>
<g transform="matrix(1 0 0 1 540 540)" id="62b31009-58bd-4583-b2ee-2de1a88a2294" >
<rect style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; visibility: hidden;" vector-effect="non-scaling-stroke" x="-540" y="-540" rx="0" ry="0" width="1080" height="1080" />
</g>
<g transform="matrix(1 0 0 1 540 540)" id="35f6f108-8527-4064-90d7-62893c6938d3" >
</g>
<g transform="matrix(28.93 0 0 28.84 605.98 607.54)" id="cb89d947-dfe9-4413-8d9c-111793543295" >
<circle style="stroke: rgb(0,0,0); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" cx="0" cy="0" r="35" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,101 +0,0 @@
@import url('https://fonts.googleapis.com/css2?family=Open+Sans&display=swap');
body {
background-color: #92bcea !important;
font-family: 'Open Sans', sans-serif !important;
}
.top-title {
display: flex;
font-size: medium;
vertical-align: center;
justify-content: center;
-webkit-user-select: none;
-webkit-app-region: drag;
width: 100%;
padding: 5% !important;
padding-bottom: 0% !important;
}
.top-logo {
width: 15%;
}
.buttonClose {
background-color: transparent;
border: none;
border-radius: 15px;
cursor: pointer;
transition: all 0.3s ease 0s;
font-family: 'noto Sans', sans-serif;
font-weight: 500;
font-size: 15px;
color: white;
text-decoration: none;
-webkit-app-region: no-drag;
margin: 5px;
outline: none;
}
.buttonClose:hover {
color: red;
}
.buttonClose:active {
color: rgb(255, 255, 255);
}
.buttonReduce {
background-color: transparent;
border: none;
border-radius: 15px;
cursor: pointer;
transition: all 0.3s ease 0s;
font-family: 'noto Sans', sans-serif;
font-weight: 500;
font-size: 13px;
color: white;
text-decoration: none;
-webkit-app-region: no-drag;
margin: 5px;
outline: none;
}
.buttonReduce:hover {
color: rgb(46, 196, 255);
}
.buttonReduce:active {
color: rgb(255, 255, 255);
}
header {
display: flex;
}
.content {
padding: 5%;
padding-top: 0;
}

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 -28.5 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
<g>
<path d="M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z" fill="#5865F2" fill-rule="nonzero">
</path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path fill="#ffffff" d="M12.9 3.1c1.3 1.2 2.1 3 2.1 4.9 0 3.9-3.1 7-7 7s-7-3.1-7-7c0-1.9 0.8-3.7 2.1-4.9l-0.8-0.8c-1.4 1.5-2.3 3.5-2.3 5.7 0 4.4 3.6 8 8 8s8-3.6 8-8c0-2.2-0.9-4.2-2.3-5.7l-0.8 0.8z"></path>
</svg>

Before

Width:  |  Height:  |  Size: 579 B

View File

@ -33,11 +33,11 @@
text-align: center; text-align: center;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-color: rgb(38, 37, 37); background-color: #36374c;
padding: 10%; padding: 10%;
color: white; color: white;
border-radius: 15px; border-radius: 15px;
box-shadow: 2px 2px 5px rgb(38, 37, 37) ; box-shadow: 2px 2px 5px #36374c ;
-webkit-user-select: none; -webkit-user-select: none;
user-select: none; user-select: none;

View File

@ -11,7 +11,8 @@
<body> <body>
<header> <header>
<div class="top-title"> <div class="top-title">
<h1><img class="top-logo rounded" src="../../src/logo.png" alt="Logo"> Subsonics</h1> <img class="top-logo rounded" src="../../src/logo.png" alt="Logo">
<img class="top-title-image rounded" src="../../src/title.png" alt="Logo">
</div> </div>
<button id="minimizeBtn" class="buttonReduce"><i class="fas fa-window-minimize"></i></button> <button id="minimizeBtn" class="buttonReduce"><i class="fas fa-window-minimize"></i></button>
<button id="closeBtn" class="buttonClose"><i class="fas fa-times"></i></button> <button id="closeBtn" class="buttonClose"><i class="fas fa-times"></i></button>

View File

@ -0,0 +1,87 @@
.top-title {
padding: 5% !important;
}
.box {
text-align: center;
display: flex;
flex-direction: column;
background-color: #36374c;
padding: 10%;
color: white;
border-radius: 15px;
box-shadow: 2px 2px 5px #36374c ;
-webkit-user-select: none;
user-select: none;
align-items: center
}
.loading {
width: 30%;
height: 30%;
filter: invert(1)
}
.loadingRot {
-webkit-animation: rotating 1s linear infinite;
animation: rotating 1s linear infinite;
text-align: center;
;
}
.loadingSpan {
font-size: 20vw;
}
.infoSpan {
color: white;
font-size: 12px;
}
@-webkit-keyframes rotating {
from{
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
to{
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.buttonTryAgain {
font-family: 'Open Sans', sans-serif !important;
background-color: transparent;
border: solid;
border-radius: 15px;
padding: 2%;
border-color: rgb(46, 196, 255);
color: white;
transition: all 0.2s ease 0s;
}
.buttonTryAgain:hover {
color: black;
background-color: rgb(46, 196, 255);
box-shadow: 2px 2px 5px rgb(46, 196, 255);
}
.buttonTryAgain:active {
background-color: transparent;
}

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Submanager - Login</title>
<link rel="stylesheet" href="../common/common.css">
<link rel="stylesheet" href="update.css">
</head>
<body>
<header>
<div class="top-title">
<img class="top-logo rounded" src="../../src/logo.png" alt="Logo">
<img class="top-title-image rounded" src="../../src/title.png" alt="Logo">
</div>
</header>
<div id="content">
<div class="content">
<div class="box">
<p>Mise à jour de l'application</p>
<span id="loadingSpan" class="loadingSpan"><img class="loading" src="../common/mettre-a-jour.png"></span>
<br>
<p id="infoSpan" class="infoSpan">Veuillez patienter pendant que l'application se met à jour !</p>
<span class="infoSpan"><p>Submanager - Version : <span id="version"></span></p></span>
<span id="load"><img style="width: 5%; height: 5%;" class="loadingRot" src="../common/spinner-third-svgrepo-com.svg"></span>
</div>
</div>
</div>
<script src="../common/bundle.js"></script>
<script src="update.js"></script>
</body>
</html>

View File

@ -0,0 +1,29 @@
const {ipcRenderer} = require("electron");
const packageJson = require("../../package.json")
const ipc = ipcRenderer;
const fs = require("fs")
const loadingSpan = document.getElementById("loadingSpan")
const infoSpan = document.getElementById("infoSpan")
const load = document.getElementById("load")
document.getElementById("version").innerHTML = packageJson.version
ipc.on("error", () => {
loadingSpan.innerHTML = "<i class='fa fa-times'></i>"
load.innerHTML = "<button style='padding: 10%;' class='buttonTryAgain' id='close'>Fermer</button>"
infoSpan.innerHTML = 'Une erreur est apparue lors de la mise à jour, fermez puis relancez !'
const close = document.getElementById("close")
close.addEventListener("click", () => {
ipc.send("close")
})
})

150
updatetools.js Normal file
View File

@ -0,0 +1,150 @@
const log = require("./sub-log")
const { BrowserWindow, app, ipcMain } = require("electron")
const https = require('https');
const fs = require('fs');
const fse = require('fs-extra');
const BWin = BrowserWindow
const path = require("path")
const decompress = require('decompress');
function getSettings() {
var settings = {}
settings.canaldev = null
if(fs.existsSync(__dirname + path.sep + "settings.json")){
settings = JSON.parse(fs.readFileSync(__dirname + path.sep + "settings.json"))
}
return settings
}
module.exports.checkUpdate = () => {
var settings = getSettings()
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))
}
function checkUpdateProcessing(serverPackage) {
const clientPackage = require("./package")
if(serverPackage.version.replace(".", "") > clientPackage.version.replace(".", "")) {
log.update("Verification des mises a jour ... Finish !")
log.update("Mise a jour disponible ! Nouvelle version : " + serverPackage.version + " - Client : " + clientPackage.version + " - Git : " + serverPackage.version)
selfUpdate()
} else {
log.update("Verification des mises a jour ... Finish !")
log.update("Cette version est la derniere version ! - Client : " + clientPackage.version + " - Git : " + serverPackage.version)
}
}
function selfUpdate() {
var settings = getSettings()
const win = BWin.getFocusedWindow()
var link = "https://git.raphix.fr/subsonics/manager/archive/main.tar.gz"
win.loadFile("templates/update/update.html")
ipcMain.on("close", () => {
app.quit()
})
log.update("Telechargement de la mise a jour ... Processing !")
if(fs.existsSync(__dirname + path.sep + "update.tar.gz")) {
fs.rmSync(__dirname + path.sep + "update.tar.gz")
}
const updatePack = fs.createWriteStream(__dirname + path.sep + "update.tar.gz");
const request = https.get(link, function(response) {
response.pipe(updatePack);
// after download completed close filestream
updatePack.on("finish", () => {
updatePack.close();
log.update("Telechargement de la mise a jour ... Finish !")
install(__dirname + path.sep + "update.tar.gz")
});
updatePack.on("error", (err) => {
log.update("Erreur lors du telechargement de la mise a jour !")
updatePack.close();
console.log(err)
})
});
}
module.exports.update = () => {
selfUpdate()
}
function install(filename) {
log.update("Extraction de la mise a jour ... Processing !")
decompress(filename, __dirname).then(files => {
log.update("Extraction de la mise a jour ... Finish !")
log.update("Installation de la mise a jour ... Processing !")
fse.copy(__dirname + path.sep + "manager", __dirname, { overwrite: true }, () => {
fs.rm(filename, () => {
fs.rm(__dirname + path.sep + "manager", { recursive: true, force: true }, (err) => {
if(err) {
console.log(err)
}
log.update("Installation de la mise a jour ... Finish !")
log.update("Redemarrage de l'application.")
app.relaunch()
app.exit()
})
})
})
}).catch(err => catchError(err, true));
}
function catchError(err, inUp) {
log.update("Erreur lors de la verification des mises a jour !")
log.update(err)
if(inUp == true) {
win.webContents.send("error")
}
}