1.1.18 - imagine useful commit messages

This commit is contained in:
exttex 2021-04-01 19:47:42 +02:00
parent 984a5d9296
commit 85f293893a
23 changed files with 15937 additions and 284 deletions

3
.gitignore vendored
View File

@ -7,3 +7,6 @@ app/client/node_modules/
electron_dist/ electron_dist/
freezer-*.tgz freezer-*.tgz
translations.zip translations.zip
package-lock.json
app/package-lock.json
app/client/package-lock.json

View File

@ -2,7 +2,7 @@ const {app, BrowserWindow, ipcMain, Tray, Menu, session, dialog, shell, nativeTh
const {createServer} = require('./src/server'); const {createServer} = require('./src/server');
const path = require('path'); const path = require('path');
const arg = require('arg'); const arg = require('arg');
const { exit } = require('process'); const { exit, platform } = require('process');
const packageJson = require('./package.json'); const packageJson = require('./package.json');
const chalk = require('chalk'); const chalk = require('chalk');
const {Settings} = require('./src/settings'); const {Settings} = require('./src/settings');
@ -174,6 +174,10 @@ if (!singleInstanceLock) {
//Create window //Create window
app.on('ready', async () => { app.on('ready', async () => {
//No mac
if (platform == 'darwin')
process.exit(-1);
await startServer(); await startServer();
//Server mode //Server mode
if (args['--server']) return; if (args['--server']) return;

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@
}, },
"dependencies": { "dependencies": {
"@mdi/font": "^5.9.55", "@mdi/font": "^5.9.55",
"axios": "^0.19.2", "axios": "^0.21.1",
"roboto-fontface": "*", "roboto-fontface": "*",
"vue": "^2.6.12", "vue": "^2.6.12",
"vue-esc": "^3.0.1", "vue-esc": "^3.0.1",

View File

@ -1,5 +1,5 @@
<template> <template>
<div> <div :class='{"enable-bgi": $root.settings.backgroundImage}'>
<v-app v-esc='closePlayer'> <v-app v-esc='closePlayer'>
<v-system-bar <v-system-bar
@ -18,7 +18,14 @@
</v-system-bar> </v-system-bar>
<!-- Fullscreen player overlay --> <!-- Fullscreen player overlay -->
<v-overlay :value='showPlayer' opacity='1.00' z-index="100"> <v-overlay
:dark='!$root.settings.lightTheme'
:light='$root.settings.lightTheme' :value='showPlayer'
:opacity='$root.settings.backgroundImage ? 0.0 : 1.0'
z-index="100"
:color='$root.settings.lightTheme ? "#ffffff" : "#212121"'>
<img :src='backgroundSrc' class='wallpaper-overlay' v-if='$root.settings.backgroundImage'>
<FullscreenPlayer @close='closePlayer' @volumeChange='volume = $root.volume'></FullscreenPlayer> <FullscreenPlayer @close='closePlayer' @volumeChange='volume = $root.volume'></FullscreenPlayer>
</v-overlay> </v-overlay>
@ -149,7 +156,7 @@
</v-list> </v-list>
</v-navigation-drawer> </v-navigation-drawer>
<v-app-bar app dense color='#1e1e1e'> <v-app-bar app dense :color='$root.settings.lightTheme ? null : "#1e1e1e"'>
<v-btn icon @click='previous'> <v-btn icon @click='previous'>
<v-icon>mdi-arrow-left</v-icon> <v-icon>mdi-arrow-left</v-icon>
@ -172,6 +179,7 @@
:loading='searchLoading' :loading='searchLoading'
@keyup='search' @keyup='search'
ref='searchBar' ref='searchBar'
:background-color='$root.settings.lightTheme ? "#ffffff00" : "#00000000"'
v-model='searchQuery' v-model='searchQuery'
:search-input.sync='searchInput' :search-input.sync='searchInput'
:items='suggestions' :items='suggestions'
@ -182,13 +190,13 @@
<!-- Main --> <!-- Main -->
<v-main> <v-main>
<img :src='backgroundSrc' class='wallpaper' v-if='$root.settings.backgroundImage'>
<v-container <v-container
class='overflow-y-auto' class='overflow-y-auto'
fluid fluid
style='height: calc(100vh - 140px);'> style='height: calc(100vh - 140px);'>
<keep-alive include='Search,PlaylistPage,HomeScreen,DeezerPage'> <keep-alive include='Search,PlaylistPage,HomeScreen,DeezerPage'>
<router-view></router-view> <router-view class='router-wiev'></router-view>
</keep-alive> </keep-alive>
</v-container> </v-container>
</v-main> </v-main>
@ -297,6 +305,10 @@
.v-navigation-drawer__content { .v-navigation-drawer__content {
overflow-y: hidden !important; overflow-y: hidden !important;
} }
.enable-bgi {
@import 'styles/bg-image.scss';
}
</style> </style>
<style lang='scss' scoped> <style lang='scss' scoped>
.seekbar { .seekbar {
@ -312,6 +324,22 @@
.topbarbutton { .topbarbutton {
-webkit-app-region: no-drag; -webkit-app-region: no-drag;
} }
.wallpaper {
width: 100vw;
height: 100vh;
top: -48px;
left: -56px;
z-index: -100;
position: absolute;
object-fit: fill;
}
.wallpaper-overlay {
width: 100vw;
height: 100vh;
z-index: -100;
position: absolute;
object-fit: fill;
}
</style> </style>
<script> <script>
@ -451,6 +479,12 @@ export default {
if (p > 100) if (p > 100)
p = 100; p = 100;
return Math.round(p); return Math.round(p);
},
//Get background src
backgroundSrc() {
if (this.$root.settings.backgroundImage && this.$root.settings.backgroundImage.startsWith("http"))
return this.$root.settings.backgroundImage;
return process.env.NODE_ENV === 'development' ? "http://localhost:10069/background" : "/background";
} }
}, },
async mounted() { async mounted() {

View File

@ -25,7 +25,7 @@
dense dense
:label='$t("Search")' :label='$t("Search")'
solo solo
class='mx-2 mt-1' class='mx-2'
v-model='searchQuery' v-model='searchQuery'
></v-text-field> ></v-text-field>
</div> </div>

View File

@ -25,7 +25,7 @@
dense dense
:label='$t("Search")' :label='$t("Search")'
solo solo
class='mx-2 mt-1' class='mx-2'
v-model='searchQuery' v-model='searchQuery'
></v-text-field> ></v-text-field>
</div> </div>

View File

@ -27,7 +27,7 @@
dense dense
:label='$t("Search")' :label='$t("Search")'
solo solo
class='mx-2 mt-1' class='mx-2'
v-model='searchQuery' v-model='searchQuery'
></v-text-field> ></v-text-field>
</div> </div>

View File

@ -19,7 +19,7 @@
dense dense
:label='$t("Search")' :label='$t("Search")'
solo solo
class='mx-2 mt-1' class='mx-2'
v-model='searchQuery' v-model='searchQuery'
></v-text-field> ></v-text-field>
</div> </div>

View File

@ -9,7 +9,7 @@
v-for='(lyric, index) in lyrics.lyrics' v-for='(lyric, index) in lyrics.lyrics'
:key='lyric.offset' :key='lyric.offset'
class='my-6 mx-4 pa-2 rounded' class='my-6 mx-4 pa-2 rounded'
:class='{"grey darken-3": playingNow(index)}' :class='{"grey darken-3": (playingNow(index) && !$root.settings.lightTheme), "grey lighten-1": (playingNow(index) && $root.settings.lightTheme)}'
@click='seekTo(index)'> @click='seekTo(index)'>
<span <span
class='my-8' class='my-8'

View File

@ -11,6 +11,6 @@ export default new Vuetify({
dark: true, dark: true,
options: { options: {
customProperties: true customProperties: true
} },
} }
}); });

View File

@ -11,7 +11,7 @@ import i18n from './js/i18n';
let ipcRenderer; let ipcRenderer;
//Axios //Axios
let axiosInstance = axios.create({ let axiosInstance = axios.create({
baseURL: `${window.location.origin}`, baseURL: process.env.NODE_ENV === 'development' ? "http://localhost:10069" : `${window.location.origin}`,
timeout: 16000, timeout: 16000,
responseType: 'json' responseType: 'json'
}); });
@ -53,7 +53,7 @@ Vue.prototype.$filesize = (bytes) => {
//Sockets //Sockets
Vue.use(new VueSocketIO({ Vue.use(new VueSocketIO({
connection: window.location.toString(), connection: process.env.NODE_ENV === 'development' ? "http://localhost:10069" : window.location.toString(),
options: {path: '/socket'} options: {path: '/socket'}
})); }));
@ -236,7 +236,7 @@ new Vue({
this.playbackInfo = playbackInfo; this.playbackInfo = playbackInfo;
//Stream URL //Stream URL
let url = `${window.location.origin}${this.playbackInfo.url}`; let url = `${process.env.NODE_ENV === 'development' ? "http://localhost:10069" : window.location.origin}${this.playbackInfo.url}`;
//Cancel loading //Cancel loading
this.loaders--; this.loaders--;
if (this.loaders > 0) { if (this.loaders > 0) {
@ -424,7 +424,7 @@ new Vue({
if (this.gapless.promise) resolve(); if (this.gapless.promise) resolve();
} }
this.gapless.info = info this.gapless.info = info
this.gapless.audio = new Audio(`${window.location.origin}${info.url}`); this.gapless.audio = new Audio(`${process.env.NODE_ENV === 'development' ? "http://localhost:10069" : window.location.origin}${info.url}`);
this.gapless.audio.volume = 0.00; this.gapless.audio.volume = 0.00;
this.gapless.audio.preload = 'auto'; this.gapless.audio.preload = 'auto';
this.gapless.crossfade = false; this.gapless.crossfade = false;
@ -526,6 +526,9 @@ new Vue({
let res = await this.$axios.get('/settings'); let res = await this.$axios.get('/settings');
this.settings = res.data; this.settings = res.data;
this.$vuetify.theme.themes.dark.primary = this.settings.primaryColor; this.$vuetify.theme.themes.dark.primary = this.settings.primaryColor;
this.$vuetify.theme.themes.light.primary = this.settings.primaryColor;
if (this.settings.lightTheme)
this.$vuetify.theme.dark = false;
i18n.locale = this.settings.language; i18n.locale = this.settings.language;
this.volume = this.settings.volume; this.volume = this.settings.volume;

View File

@ -10,7 +10,7 @@
></v-img> ></v-img>
<div class='pl-4'> <div class='pl-4'>
<v-overlay absolute :value="loading" z-index="3" opacity='0.9'> <v-overlay absolute :value="loading" z-index="3" opacity='0'>
<v-progress-circular indeterminate></v-progress-circular> <v-progress-circular indeterminate></v-progress-circular>
</v-overlay> </v-overlay>
<h1>{{album.title}}</h1> <h1>{{album.title}}</h1>

View File

@ -11,7 +11,7 @@
></v-img> ></v-img>
<div class='pl-4'> <div class='pl-4'>
<v-overlay absolute :value="loading" z-index="3" opacity='0.9'> <v-overlay absolute :value="loading" z-index="3" opacity='0'>
<v-progress-circular indeterminate></v-progress-circular> <v-progress-circular indeterminate></v-progress-circular>
</v-overlay> </v-overlay>
<h1>{{artist.name}}</h1> <h1>{{artist.name}}</h1>

View File

@ -39,6 +39,7 @@
:value='position' :value='position'
ref='seeker' ref='seeker'
class='seekbar' class='seekbar'
color='primary'
hide-details> hide-details>
</v-slider> </v-slider>
</v-col> </v-col>
@ -108,6 +109,7 @@
step='0.01' step='0.01'
v-model='$root.volume' v-model='$root.volume'
class='px-8' class='px-8'
color='primary'
style='padding-top: 2px;' style='padding-top: 2px;'
@change='updateVolume' @change='updateVolume'
@click:prepend='$root.toggleMute()' @click:prepend='$root.toggleMute()'

View File

@ -10,7 +10,7 @@
></v-img> ></v-img>
<div class='pl-4'> <div class='pl-4'>
<v-overlay absolute :value="loading" z-index="3" opacity='0.9'> <v-overlay absolute :value="loading" z-index="3" opacity='0'>
<v-progress-circular indeterminate></v-progress-circular> <v-progress-circular indeterminate></v-progress-circular>
</v-overlay> </v-overlay>
<h1> <h1>

View File

@ -135,6 +135,19 @@
:items='languageNames' :items='languageNames'
@change='updateLanguage' @change='updateLanguage'
></v-select> ></v-select>
<!-- Light theme -->
<v-list-item>
<v-list-item-action>
<v-checkbox
v-model='$root.settings.lightTheme'
class='pl-2'
@change='$vuetify.theme.dark = !$root.settings.lightTheme'
></v-checkbox>
</v-list-item-action>
<v-list-item-content>
<v-list-item-title>{{$t("Light theme")}}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<!-- Primary color --> <!-- Primary color -->
<v-list-item @click='colorPicker = true'> <v-list-item @click='colorPicker = true'>
<v-list-item-avatar> <v-list-item-avatar>

View File

@ -0,0 +1,56 @@
.theme--dark.v-tabs > .v-tabs-bar {
background-color: #00000000 !important;
backdrop-filter: blur(16px);
}
.theme--dark.v-list {
background-color: #00000000 !important;
}
.theme--light.v-list {
background-color: #ffffff00 !important;
}
.theme--dark.v-application {
background-color: #000000aa !important;
}
.theme--light.v-application {
background-color: #ffffff00 !important;
}
.v-list-item {
background-color: #00000000;
}
.v-list {
background-color: #000000aa !important;
}
.v-item-group {
background-color: #00000000 !important;
backdrop-filter: blur(16px);
}
.v-card {
background-color: #00000000 !important;
backdrop-filter: blur(16px);
}
.v-navigation-drawer {
background-color: #00000000 !important;
}
.theme--dark.v-navigation-drawer--is-mouseover {
background-color: #12121277 !important;
backdrop-filter: blur(16px);
}
.theme--light.v-navigation-drawer--is-mouseover {
background-color: #ffffff66 !important;
backdrop-filter: blur(16px);
}
.v-toolbar {
background-color: #00000000 !important;
}
.v-navigation-drawer--mini-variant {
background-color: #00000000 !important;
}
.v-footer {
background-color: #00000000 !important;
}
.theme--dark.v-select-list div {
background-color: #212121;
}
.theme--light.v-select-list div {
background-color: #ffffff;
}

2933
app/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{ {
"name": "freezer", "name": "freezer",
"private": true, "private": true,
"version": "1.1.17", "version": "1.1.18",
"description": "", "description": "",
"main": "background.js", "main": "background.js",
"scripts": { "scripts": {
@ -16,6 +16,7 @@
"chalk": "^4.1.0", "chalk": "^4.1.0",
"cheerio": "^1.0.0-rc.5", "cheerio": "^1.0.0-rc.5",
"compare-versions": "^3.6.0", "compare-versions": "^3.6.0",
"cors": "^2.8.5",
"discord-rpc": "^3.1.4", "discord-rpc": "^3.1.4",
"express": "^4.17.1", "express": "^4.17.1",
"lastfmapi": "^0.1.1", "lastfmapi": "^0.1.1",

View File

@ -1,4 +1,5 @@
const express = require('express'); const express = require('express');
const cors = require('cors');
const path = require('path'); const path = require('path');
const packageJson = require('../package.json'); const packageJson = require('../package.json');
const fs = require('fs'); const fs = require('fs');
@ -11,7 +12,6 @@ const {Track, Album, Artist, Playlist, DeezerProfile, SearchResults, DeezerLibra
const {DownloadManager} = require('./downloads'); const {DownloadManager} = require('./downloads');
const {Integrations} = require('./integrations'); const {Integrations} = require('./integrations');
const {Importer} = require('./importer'); const {Importer} = require('./importer');
const { url } = require('inspector');
let settings; let settings;
let deezer; let deezer;
@ -24,6 +24,7 @@ let sockets = [];
const app = express(); const app = express();
app.use(express.json({limit: '50mb'})); app.use(express.json({limit: '50mb'}));
app.use(express.static(path.join(__dirname, '../client', 'dist'))); app.use(express.static(path.join(__dirname, '../client', 'dist')));
app.use(cors({origin: 'http://localhost:8080'}));
//Server //Server
const server = require('http').createServer(app); const server = require('http').createServer(app);
const io = require('socket.io').listen(server, { const io = require('socket.io').listen(server, {
@ -632,6 +633,15 @@ app.get('/updates', async (req, res) => {
} }
}); });
//Background image
app.get('/background', async (req, res) => {
//Missing
if (!settings.backgroundImage && !fs.existsSync(settings.backgroundImage)) {
return res.status(404).end();
}
res.sendFile(path.resolve(settings.backgroundImage));
});
//Redirect to index on unknown path //Redirect to index on unknown path
app.all('*', (req, res) => { app.all('*', (req, res) => {
res.redirect('/'); res.redirect('/');

View File

@ -44,6 +44,10 @@ class Settings {
this.contentLanguage = 'en'; this.contentLanguage = 'en';
this.contentCountry = 'US'; this.contentCountry = 'US';
this.sidebarOpen = false; this.sidebarOpen = false;
//Has to be local path
this.backgroundImage = null;
this.lightTheme = false;
} }
//Based on electorn app.getPath //Based on electorn app.getPath
@ -121,7 +125,7 @@ class Settings {
await fs.promises.mkdir(Settings.getDir(), {recursive: true}); await fs.promises.mkdir(Settings.getDir(), {recursive: true});
} catch (_) {} } catch (_) {}
await fs.promises.writeFile(Settings.getPath(), JSON.stringify(this), 'utf-8'); await fs.promises.writeFile(Settings.getPath(), JSON.stringify(this, null, 2), 'utf-8');
} }
} }

View File

@ -1,7 +1,7 @@
{ {
"name": "freezer", "name": "freezer",
"private": true, "private": true,
"version": "1.1.17", "version": "1.1.18",
"description": "Freezer PC", "description": "Freezer PC",
"scripts": { "scripts": {
"pack": "electron-builder --dir", "pack": "electron-builder --dir",
@ -47,7 +47,9 @@
}, },
"linux": { "linux": {
"target": [ "target": [
"AppImage", "deb", "tar.gz" "AppImage",
"deb",
"tar.gz"
], ],
"category": "audio", "category": "audio",
"icon": "build/iconset", "icon": "build/iconset",
@ -62,7 +64,15 @@
} }
}, },
"deb": { "deb": {
"depends": ["libssl-dev", "gconf2", "gconf-service", "libnotify4", "libappindicator1", "libxtst6", "libnss3"] "depends": [
"libssl-dev",
"gconf2",
"gconf-service",
"libnotify4",
"libappindicator1",
"libxtst6",
"libnss3"
]
} }
} }
} }