Compare commits

..

No commits in common. "80b4b80508528eeb74243e9c7698207a9d8607c4" and "19862d7cd3ce0276e16169d3db3e37381e531df8" have entirely different histories.

289 changed files with 4981 additions and 20177 deletions

94
.gitignore vendored
View File

@ -1,73 +1,37 @@
# Logs __pycache__
logs */__pycache__
*.log
.DS_Store
node_modules
# pyinstaller build dirs
/dist
/build
# local env files
/env/
/venv/
.env.local
.env.*.local
# Log files
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
# Runtime data # Editor directories and files
pids # .vscode
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# next.js build output
.next
# IDE
.vscode
.idea .idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Private configs
/config.py
tailwind.config.full.js
# development # development
*.map *.map
dev.sh public/js/bundle.js
# distribution
dist/*
server-dist/*

View File

@ -1 +0,0 @@
save-prefix: ""

View File

@ -1,38 +1,20 @@
# Deemixer # deemix-webui
This is forked from [deemix-webui](https://gitlab.com/RemixDev/deemix-webui) and [deemix-gui](https://gitlab.com/RemixDev/deemix-webui). This is just the WebUI for deemix, it should be used with deemix-gui or something like that.
If you are a web developer and want to contribute to this project, please read the [COMPILE-UI](COMPILE-UI.md) file.
The submodule reference was removed and consolidated into this single repo. Git history was maintained. # "Hidden" features
## Running from source - `CTRL+SHIFT+Backspace` deletes all the search bar content
- `CTRL+F` focuses the search bar
- `CTRL+B` toggles the download bar
- `ALT+Left` goes back to the previous page, if present (like would happen in the browser)
- `ALT+Right` goes forward to the next page, if present (like would happen in the browser)
- Custom context menu: on certain elements, like download buttons or album covers, when opening the context menu, a custom one with more options will appear instead of the default one
You need to use nodejs 16.x, using `yarn` is recommended. # Deps
Install the dependencies using `yarn install-all` for production. - `rollup-plugin-vue@4.2.0` is needed because of https://github.com/vuejs/rollup-plugin-vue/issues/238
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`
Commands for easy setup:
```sh
# Production
git clone https://gitea.va.reichard.io/evan/Deemixer.git . && yarn install-all
# Development
git clone https://gitea.va.reichard.io/evan/Deemixer.git . && yarn install-all-dev
```
You can change the default port by setting the environment variable `PORT` to any other number before starting the app.
## 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
# License # License
@ -43,8 +25,8 @@ the Free Software Foundation, either version 3 of the License, or
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 52 KiB

109
index.js
View File

@ -1,109 +0,0 @@
const { app, BrowserWindow, ipcMain, shell, dialog, Menu, MenuItem } = require('electron')
const contextMenu = require('electron-context-menu')
const WindowStateManager = require('electron-window-state-manager')
const path = require('path')
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}
}).argv
const { DeemixServer }= require('./server/dist/app.js')
const PORT = process.env.DEEMIX_SERVER_PORT || argv.port
process.env.DEEMIX_SERVER_PORT = PORT
process.env.DEEMIX_HOST = argv.host
const server = new DeemixServer(argv.host, PORT, '/', false)
server.init()
let win
const windowState = new WindowStateManager('mainWindow', {
defaultWidth: 800,
defaultHeight: 600
})
function createWindow () {
win = new BrowserWindow({
width: windowState.width,
height: windowState.height,
x: windowState.x,
y: windowState.y,
useContentSize: true,
autoHideMenuBar: true,
icon: path.join(__dirname, os.platform() === 'win32' ? 'build/icon.ico' : 'build/64x64.png'),
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
win.setMenu(null)
if (argv.dev){
const menu = new Menu()
menu.append(new MenuItem({
label: 'DevTools',
submenu: [
{ role: 'reload', accelerator: 'f5', click: () => { win.reload() } },
{ role: 'devtools', accelerator: 'f12', click: () => { win.webContents.toggleDevTools() } }
]
}))
Menu.setApplicationMenu(menu)
}
// Open links in external browser
win.webContents.on('new-window', function(e, url) {
e.preventDefault()
shell.openExternal(url)
})
win.loadURL(`http://${argv.host}:${PORT}`)
if (windowState.maximized) {
win.maximize();
}
win.on('close', (event)=>{
windowState.saveState(win);
if (server.deemixApp.getSettings().settings.clearQueueOnExit){
server.deemixApp.cancelAllDownloads()
}
})
}
app.whenReady().then(() => {
createWindow()
contextMenu({
showLookUpSelection: false,
showSearchWithGoogle: false,
showInspectElement: false
})
// Only one istance per time
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
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, {
defaultPath: downloadLocation,
properties: ["openDirectory", "createDirectory"]
})
if (path.filePaths[0]) win.webContents.send("downloadFolderSelected", path.filePaths[0])
})

View File

@ -1,92 +1,61 @@
{ {
"name": "deemix-gui", "name": "deemix-webui",
"version": "0.0.0", "version": "1.9.3",
"main": "index.js", "scripts": {
"repository": "https://gitlab.com/RemixDev/deemix-gui.git", "clean": "rimraf public/js/bundle.js public/js/bundle.temp.js public/js/bundle.js.map",
"author": "RemixDev <RemixDev64@gmail.com>", "clean-temp": "rimraf public/js/bundle.temp.js",
"license": "GPL-3.0-only", "build:js": "rollup -c",
"scripts": { "minify": "esbuild public/js/bundle.temp.js --outfile=public/js/bundle.js --minify",
"install-all": "yarn install && yarn --cwd server install --production && yarn --cwd webui install --production", "build": "npm-run-all --sequential clean build:js minify clean-temp",
"install-all-dev": "yarn install && yarn --cwd server install && yarn --cwd webui install", "start:gui": "yarn --cwd ../ start",
"dev": "yarn --cwd webui dev", "watch:server": "yarn --cwd ../server watch",
"start": "electron . --dev", "watch:js": "rollup -c -w",
"predist": "yarn build-server && yarn build-webui", "dev": "npm-run-all --parallel watch:server watch:js",
"dist": "yarn set-version && electron-builder && yarn reset-version", "lint": "eslint src/**/*.{js,vue,mjs} --fix",
"dist:dir": "yarn set-version && yarn predist && electron-builder --dir && yarn reset-version", "lint-tests": "eslint src/**/*.js --fix",
"dist-server": "yarn set-version && yarn predist && ./node_modules/.bin/pkg --out-dir dist ./server/package.json && yarn reset-version", "test": "jest",
"start-server": "yarn --cwd server start", "test-watch": "jest --watch",
"build-server": "yarn --cwd server build", "testlang": "node ./tests/testlang.js"
"build-webui": "yarn --cwd webui build", },
"set-version": "node scripts/set-version.js", "dependencies": {
"reset-version": "node scripts/reset-version.js" "@rollup/plugin-alias": "3.1.5",
}, "@rollup/plugin-commonjs": "20.0.0",
"devDependencies": { "@rollup/plugin-node-resolve": "13.0.4",
"electron": "^22.0.0", "@rollup/plugin-replace": "3.0.0",
"electron-builder": "^23.6.0", "@vue/composition-api": "1.0.6",
"pkg": "^5.8.0" "esbuild": "0.12.19",
}, "flag-icon-css": "3.5.0",
"dependencies": { "lodash-es": "4.17.21",
"electron-context-menu": "^3.6.1", "npm-run-all": "4.1.5",
"electron-window-state-manager": "^0.3.2", "postcss": "8.3.6",
"yargs": "^17.6.2" "rimraf": "3.0.2",
}, "rollup": "2.56.1",
"build": { "rollup-plugin-analyzer": "4.0.0",
"appId": "app.deemix.gui", "rollup-plugin-postcss": "4.0.0",
"productName": "deemix-gui", "rollup-plugin-svg": "2.0.0",
"files": [ "rollup-plugin-vue": "4.2.0",
"index.js", "svg-country-flags": "1.2.10",
"preload.js", "tailwindcss": "1.9.6",
"server/dist/**/*", "toastify-js": "1.11.1",
"webui/public/**/*", "vue": "2.6.14",
"build/**/*", "vue-i18n": "8.25.0",
"package.json" "vue-router": "3.5.2",
], "vuex": "3.6.2"
"mac": { },
"target": [ "devDependencies": {
{ "@babel/core": "7.15.0",
"target": "dmg", "@babel/plugin-transform-modules-commonjs": "7.15.0",
"arch": "x64" "@nuxtjs/eslint-config": "6.0.1",
}, "@types/jest": "26.0.24",
{ "@typescript-eslint/eslint-plugin": "4.29.0",
"target": "dmg", "@typescript-eslint/parser": "4.29.0",
"arch": "arm64" "babel-jest": "27.0.6",
} "eslint": "7.32.0",
], "eslint-config-prettier": "8.3.0",
"artifactName": "deemix-gui_${arch}.${ext}", "eslint-plugin-prettier": "3.4.0",
"category": "public.app-category.music" "jest": "27.0.6",
}, "prettier": "2.3.2",
"win": { "typescript": "4.3.5",
"target": [ "vue-template-compiler": "2.6.14"
{ }
"target": "nsis",
"arch": "x64"
},
{
"target": "portable",
"arch": "x64"
}
]
},
"linux": {
"target": [
"appimage",
"deb"
],
"artifactName": "deemix-gui.${ext}",
"category": "AudioVideo,Audio",
"icon": "build/icon.icns"
},
"nsis": {
"artifactName": "${productName}_setup.${ext}",
"oneClick": false,
"license": "LICENSE.txt",
"allowToChangeInstallationDirectory": true,
"uninstallDisplayName": "${productName}",
"deleteAppDataOnUninstall": true
},
"portable": {
"artifactName": "${productName}.${ext}",
"requestExecutionLevel": "user"
}
}
} }

View File

@ -1,25 +0,0 @@
const {
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));
}
}
}
);

View File

Before

Width:  |  Height:  |  Size: 238 KiB

After

Width:  |  Height:  |  Size: 238 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -1,16 +0,0 @@
const { execSync } = require('child_process')
function generateVersion(){
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth()+1;
const day = now.getDate();
const commitsNumber = String(execSync('git rev-list --count HEAD')).trim()
const commitHash = String(execSync('git rev-parse --short=10 HEAD')).trim()
return `${year}.${month}.${day}-r${commitsNumber}.${commitHash}`
}
console.log(generateVersion())
module.exports = generateVersion

View File

@ -1,6 +0,0 @@
const { execSync } = require('child_process')
const fs = require('fs')
let package = JSON.parse(fs.readFileSync('package.json'))
package.version = "0.0.0"
fs.writeFileSync('package.json', JSON.stringify(package, null, 2)+"\n")

View File

@ -1,6 +0,0 @@
const fs = require('fs')
const generateVersion = require('./gen-version.js')
let package = JSON.parse(fs.readFileSync('package.json'))
package.version = generateVersion()
fs.writeFileSync('package.json', JSON.stringify(package, null, 2)+"\n")

View File

@ -1 +0,0 @@
dist/

View File

@ -1,16 +0,0 @@
---
extends:
- "@nuxtjs"
- plugin:prettier/recommended
plugins:
- "@typescript-eslint"
parserOptions:
parser: "@typescript-eslint/parser"
rules:
"@typescript-eslint/no-unused-vars":
- error
- args: all
argsIgnorePattern: ^_
no-unused-vars: off
no-console: off
camelcase: off

68
server/.gitignore vendored
View File

@ -1,68 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# next.js build output
.next
# IDE
.vscode
.idea
# development
dist/*

Some files were not shown because too many files have changed in this diff Show More