finish + add package script (not working yet)

This commit is contained in:
janis
2023-11-06 16:19:52 +01:00
parent bdc117be3d
commit 32306c5ee4
7 changed files with 71 additions and 10 deletions

View File

@@ -114,8 +114,8 @@ app.get( '/clientStatusUpdate/:status', ( req, res ) => {
} );
app.get( '/openSongs', ( req, res ) => {
// res.send( '{ "data": [ "/home/janis/Music/KB2022" ] }' );
res.send( '{ "data": [ "/mnt/storage/SORTED/Music/audio/KB2022" ] }' );
res.send( '{ "data": [ "/home/janis/Music/KB2022" ] }' );
// res.send( '{ "data": [ "/mnt/storage/SORTED/Music/audio/KB2022" ] }' );
// res.send( { 'data': dialog.showOpenDialogSync( { properties: [ 'openDirectory' ], title: 'Open music library folder' } ) } );
} );

View File

@@ -133,7 +133,7 @@ body {
height: 55vh;
width: 100%;
margin-bottom: 0.5%;
margin-top: 0.5%;
margin-top: 0.25%;
}
.current-song {
@@ -141,7 +141,7 @@ body {
justify-content: center;
align-items: center;
flex-direction: column;
margin-top: 2vh;
margin-top: 1vh;
padding: 1vh;
text-align: center;
background-color: rgba( 0, 0, 0, 0.4 );
@@ -152,7 +152,7 @@ body {
width: 30vh;
object-fit: cover;
object-position: center;
margin-bottom: 20px;
margin-bottom: 10px;
font-size: 30vh !important;
}
@@ -182,3 +182,19 @@ body {
.mode-selector-wrapper:hover {
opacity: 1;
}
.dancing-style {
font-size: 250%;
margin: 0;
font-weight: bolder;
}
.info {
position: fixed;
font-size: 12px;
transform: rotate(270deg);
left: -150px;
margin: 0;
padding: 0;
top: 50%;
}

View File

@@ -12,6 +12,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
</head>
<body>
<div class="info">Designed and developed by Janis Hutz https://janishutz.com</div>
<div class="content" id="app">
<div v-if="hasLoaded" style="width: 100%">
<div class="current-song-wrapper">
@@ -21,6 +22,7 @@
<div class="current-song">
<progress max="1000" id="progress" :value="progressBar"></progress>
<h1>{{ playingSong.title }}</h1>
<p class="dancing-style" v-if="playingSong.dancingStyle">{{ playingSong.dancingStyle }}</p>
<p>{{ playingSong.artist }}</p>
</div>
</div>

View File

@@ -32,7 +32,7 @@ createApp( {
}
return ret;
},
getTimeUntil( ) {
getTimeUntil() {
return ( song ) => {
let timeRemaining = 0;
for ( let i = this.queuePos; i < this.songs.length; i++ ) {
@@ -41,11 +41,19 @@ createApp( {
}
timeRemaining += parseInt( this.songs[ i ].duration );
}
if ( this.isPlaying ) {
if ( timeRemaining === 0 ) {
return 'Currently playing';
} else {
return 'Playing in less than ' + Math.ceil( timeRemaining / 60 - this.pos / 60 ) + 'min';
}
} else {
if ( timeRemaining === 0 ) {
return 'Plays next';
} else {
return 'Playing less than ' + Math.ceil( timeRemaining / 60 - this.pos / 60 ) + 'min after starting to play';
}
}
}
}
},

View File

@@ -1,6 +1,7 @@
<template>
<div class="fancy-view">
<span class="material-symbols-outlined fancy-view-song-art" v-if="!song.hasCoverArt">music_note</span>
<img v-else-if="song.hasCoverArt && song.coverArtOrigin === 'api'" :src="song.coverArtURL" class="fancy-view-song-art">
<img v-else :src="'http://localhost:8081/getSongCover?filename=' + song.filename" class="fancy-view-song-art">
<button @click="exit()" id="exit-button"><span class="material-symbols-outlined" style="font-size: 4vh;">close</span></button>
<div class="controls-wrapper">

View File

@@ -1,4 +1,34 @@
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true
transpileDependencies: true,
pluginOptions: {
electronBuilder: {
nodeIntegration: true,
"appId": "com.janishutz.MusicPlayer",
"copyright": "Copyright (c) 2023 MusicPlayer contributors",
"buildVersion": "V2.0.0",
builderOptions: {
files: [
"**/*",
{
from: "./*",
to: "./*",
filter: [ "**/*" ]
}
],
extraFiles: [
{
from: "./src/config",
to: "./config",
filter: [ "*.config.json" ]
},
{
from: "./src/client",
to: "./client",
filter: [ "**/*" ]
}
]
}
}
}
})

4
package.sh Executable file
View File

@@ -0,0 +1,4 @@
cd frontend/
npm i
npm run electron:build -- --linux deb rpm --win nsis