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
logs
*.log
__pycache__
*/__pycache__
.DS_Store
node_modules
# pyinstaller build dirs
/dist
/build
# local env files
/env/
/venv/
.env.local
.env.*.local
# Log files
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
# Editor directories and files
# .vscode
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Private configs
/config.py
tailwind.config.full.js
# development
*.map
dev.sh
# distribution
dist/*
server-dist/*
public/js/bundle.js

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.
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
- `rollup-plugin-vue@4.2.0` is needed because of https://github.com/vuejs/rollup-plugin-vue/issues/238
# License

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

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