From 4485d6663beaf0d49f2ae38c53f98f1ac70a882f Mon Sep 17 00:00:00 2001 From: deeplydrumming Date: Mon, 22 Jul 2024 13:06:58 +0100 Subject: [PATCH] root folder update: package.json, readme, latest version, credits, gitignore, gitmodules, preload formatting --- .gitignore | 5 +++-- .gitmodules | 9 +++++++++ README.md | 18 +++++------------- credits.txt | 4 ++++ index.js | 34 +++++++++++++++++----------------- latest.txt | 1 + package.json | 21 +++++++++++---------- preload.js | 38 +++++++++++++++++++------------------- 8 files changed, 69 insertions(+), 61 deletions(-) create mode 100644 credits.txt create mode 100644 latest.txt diff --git a/.gitignore b/.gitignore index e1d3b45..a6608b5 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ build/Release # Dependency directories node_modules/ jspm_packages/ +yarn.lock # Typescript v1 declaration files typings/ @@ -68,6 +69,6 @@ typings/ *.map dev.sh -# distribution +# distribution and temp bundles dist/* -server-dist/* +webui/public/js/* \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 4937b8e..7f22ed0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,12 @@ [submodule "webui"] path = webui url = ../deemix-webui +[submodule "deemix"] + path = deemix + url = ../deemix +[submodule "server"] + path = server + url = ../server +[submodule "spotify-web-api-node"] + path = spotify-web-api-node + url = ../spotify-web-api-node \ No newline at end of file diff --git a/README.md b/README.md index 19cadee..a1e7ceb 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,12 @@ # deemix-gui -An electron app that wraps deemix-webui and lets you use the deemix-js library +An hybrid app that wraps deemix-webui and lets you use the deemix-js library ## Downloads -Downloads are available [here](https://www.reddit.com/r/deemix/comments/hmrhhs/download_links/) +https://bit.ly/DeemixFixBuilds ## Running from source -You need to use nodejs 16.x, using `yarn` is recommended. +You need to use `yarn`. -If you're using git to get this repo you should use `git submodule update --init --recursive` as well. If you're just downloading the archive.zip, make sure you download and extract deemix-webui into the webui folder. - -Install the dependencies using `yarn install-all` for production. Install the dependencies using `yarn install-all-dev` for development. Then you should be able to run the app with `yarn start`. If you want to further develop deemix-gui and propose a PR, use `yarn dev` @@ -17,10 +14,8 @@ If you want to further develop deemix-gui and propose a PR, use `yarn dev` Commands for easy setup: ```sh -# Production -git clone https://gitlab.com/RemixDev/deemix-gui.git . && git submodule update --init --recursive && yarn install-all # Development -git clone https://gitlab.com/RemixDev/deemix-gui.git . && git submodule update --init --recursive && yarn install-all-dev +git clone https://gitlab.com/deeplydrumming/DeemixFix.git && cd DeemixFix && git submodule update --init --recursive && yarn install-all-dev ``` You can change the default port by setting the environment variable `PORT` to any other number before starting the app. @@ -28,10 +23,7 @@ You can change the default port by setting the environment variable `PORT` to an ## Building the app To build the app you need to have git installed and the repo cloned with `git`. Make sure you've installed the dependencies for all packages (the root folder, `server` and `webui`). -Then from the root folder run `yarn dist` to make a distributable package for your current OS or `yarn dist-server` to make an executable for only the server. - -## Feature requests -Before asking for a feature make sure it isn't an already open issue on the repo +Then from the root folder run `yarn dist` to make a distributable package for your current OS or `yarn dist-server` to make an executable for the server versions. # License This program is free software: you can redistribute it and/or modify diff --git a/credits.txt b/credits.txt new file mode 100644 index 0000000..d3b65df --- /dev/null +++ b/credits.txt @@ -0,0 +1,4 @@ +https://gitlab.com/RemixDev -> For the original project +https://gitlab.com/waLplanet -> For an updated UI +https://gitlab.com/uh_wot -> for how to fix a recent Deezer API affecting the download of Spotify playlists + diff --git a/index.js b/index.js index 802b810..faffe69 100644 --- a/index.js +++ b/index.js @@ -6,11 +6,11 @@ const os = require('os') const yargs = require('yargs/yargs') const { hideBin } = require('yargs/helpers') const argv = yargs(hideBin(process.argv)).options({ - port: { type: 'string', default: '6595' }, - host: { type: 'string', default: '127.0.0.1' }, - dev: { type: 'boolean', default: false} + port: { type: 'string', default: '6595' }, + host: { type: 'string', default: '127.0.0.1' }, + dev: { type: 'boolean', default: false } }).argv -const { DeemixServer }= require('./server/dist/app.js') +const { DeemixServer } = require('./server/dist/app.js') const PORT = process.env.DEEMIX_SERVER_PORT || argv.port process.env.DEEMIX_SERVER_PORT = PORT @@ -41,7 +41,7 @@ function createWindow () { win.setMenu(null) - if (argv.dev){ + if (argv.dev) { const menu = new Menu() menu.append(new MenuItem({ label: 'DevTools', @@ -54,7 +54,7 @@ function createWindow () { } // Open links in external browser - win.webContents.on('new-window', function(e, url) { + win.webContents.on('new-window', function (e, url) { e.preventDefault() shell.openExternal(url) }) @@ -62,14 +62,14 @@ function createWindow () { win.loadURL(`http://${argv.host}:${PORT}`) if (windowState.maximized) { - win.maximize(); + win.maximize() } - win.on('close', (event)=>{ - windowState.saveState(win); - if (server.deemixApp.getSettings().settings.clearQueueOnExit){ - server.deemixApp.cancelAllDownloads() - } + win.on('close', (event) => { + windowState.saveState(win) + if (server.deemixApp.getSettings().settings.clearQueueOnExit) { + server.deemixApp.cancelAllDownloads() + } }) } @@ -95,15 +95,15 @@ app.on('window-all-closed', () => { } }) -ipcMain.on('openDownloadsFolder', (event)=>{ +ipcMain.on('openDownloadsFolder', (event) => { const { downloadLocation } = server.deemixApp.getSettings().settings shell.openPath(downloadLocation) }) -ipcMain.on('selectDownloadFolder', async (event, downloadLocation)=>{ - let path = await dialog.showOpenDialog(win, { +ipcMain.on('selectDownloadFolder', async (event, downloadLocation) => { + const path = await dialog.showOpenDialog(win, { defaultPath: downloadLocation, - properties: ["openDirectory", "createDirectory"] + properties: ['openDirectory', 'createDirectory'] }) - if (path.filePaths[0]) win.webContents.send("downloadFolderSelected", path.filePaths[0]) + if (path.filePaths[0]) win.webContents.send('downloadFolderSelected', path.filePaths[0]) }) diff --git a/latest.txt b/latest.txt new file mode 100644 index 0000000..9ecd1f7 --- /dev/null +++ b/latest.txt @@ -0,0 +1 @@ +2024.7.22-r15.2420ef2d75 \ No newline at end of file diff --git a/package.json b/package.json index 864a5b3..921f89d 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { - "name": "deemix-gui", - "version": "0.0.0", + "name": "deemix-fix", + "description": "An hybrid app that wraps deemix-webui and lets you use the deemix-js library", "main": "index.js", - "repository": "https://gitlab.com/RemixDev/deemix-gui.git", - "author": "RemixDev ", + "repository": "https://gitlab.com/deeplydrumming/DeemixFix2.git", + "author": "Deeplydrumming", "license": "GPL-3.0-only", "scripts": { - "install-all": "yarn install && yarn --cwd server install --production && yarn --cwd webui install --production", - "install-all-dev": "yarn install && yarn --cwd server install && yarn --cwd webui install", + "install-all": "yarn install && yarn --cwd deemix install --production && yarn --cwd server install && yarn --cwd spotify-web-api-node install --production && yarn --cwd webui install --production", + "install-all-dev": "yarn install && yarn --cwd deemix install && yarn --cwd server install && yarn --cwd spotify-web-api-node install && yarn --cwd webui install", "dev": "yarn --cwd webui dev", - "start": "electron . --dev", + "start": "electron . --dev ", "predist": "yarn build-server && yarn build-webui", "dist": "yarn set-version && electron-builder && yarn reset-version", "dist:dir": "yarn set-version && yarn predist && electron-builder --dir && yarn reset-version", @@ -21,9 +21,9 @@ "reset-version": "node scripts/reset-version.js" }, "devDependencies": { + "@yao-pkg/pkg": "5.12.0", "electron": "^22.0.0", - "electron-builder": "^23.6.0", - "pkg": "^5.8.0" + "electron-builder": "^23.6.0" }, "dependencies": { "electron-context-menu": "^3.6.1", @@ -88,5 +88,6 @@ "artifactName": "${productName}.${ext}", "requestExecutionLevel": "user" } - } + }, + "version": "0.0.0" } diff --git a/preload.js b/preload.js index 7ea935b..43488aa 100644 --- a/preload.js +++ b/preload.js @@ -1,25 +1,25 @@ const { - contextBridge, - ipcRenderer -} = require("electron"); + contextBridge, + ipcRenderer +} = require('electron') // Expose protected methods that allow the renderer process to use // the ipcRenderer without exposing the entire object contextBridge.exposeInMainWorld( - "api", { - send: (channel, data) => { - // whitelist channels - let validChannels = ["openDownloadsFolder", "selectDownloadFolder"]; - if (validChannels.includes(channel)) { - ipcRenderer.send(channel, data); - } - }, - receive: (channel, func) => { - let validChannels = ["downloadFolderSelected"]; - if (validChannels.includes(channel)) { - // Deliberately strip event as it includes `sender` - ipcRenderer.on(channel, (event, ...args) => func(...args)); - } - } + 'api', { + send: (channel, data) => { + // whitelist channels + const validChannels = ['openDownloadsFolder', 'selectDownloadFolder'] + if (validChannels.includes(channel)) { + ipcRenderer.send(channel, data) + } + }, + receive: (channel, func) => { + const validChannels = ['downloadFolderSelected'] + if (validChannels.includes(channel)) { + // Deliberately strip event as it includes `sender` + ipcRenderer.on(channel, (event, ...args) => func(...args)) + } } -); + } +)