Compare commits

...

50 Commits

Author SHA1 Message Date
c9d07f5ef7 Merge pull request 'add a diffrent icon, if media is playing' (#39) from dev into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #39
2024-09-24 00:06:52 +02:00
Artem Anufrij
78e89d0c02 add a diffrent icon, if media is playing
All checks were successful
continuous-integration/drone Build is passing
continuous-integration/drone/pr Build is passing
2024-09-24 00:00:30 +02:00
dfa44db91f Merge pull request 'fix type "scan"' (#38) from dev into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #38
2024-02-22 23:37:10 +01:00
Artem Anufrij
f3bfe8b9ed use flat dialog for box view
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-02-22 23:32:00 +01:00
7e014b29a2 Merge branch 'main' into dev
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-02-22 22:08:39 +01:00
Artem Anufrij
d6a1e55e0d fix type "scan"
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-02-22 22:07:05 +01:00
a96c3ccacb public/config.json aktualisiert
All checks were successful
continuous-integration/drone/push Build is passing
2024-02-21 16:06:47 +01:00
ba175afbf7 public/config.json aktualisiert
All checks were successful
continuous-integration/drone Build is passing
2024-02-21 15:43:46 +01:00
2ed91884df Merge pull request 'fix round corners' (#36) from dev into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #36
2023-11-05 18:38:59 +01:00
Artem Anufrij
37e4856cdc fix round corners
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-11-05 18:37:01 +01:00
3dd098584c Merge pull request 'Flat Album dialog' (#34) from dev into main
All checks were successful
continuous-integration/drone Build is passing
Reviewed-on: #34
2023-11-05 18:15:02 +01:00
9ab6c3bb94 Merge branch 'main' into dev 2023-11-05 18:14:38 +01:00
Artem Anufrij
0f931e218a use flat dialog for albums 2023-11-05 18:12:41 +01:00
Artem Anufrij
96fe5f0505 use smaller artists cover
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-05 15:50:11 +02:00
367067eff8 Merge pull request 'dev' (#33) from dev into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #33
2023-10-05 13:32:55 +02:00
Artem Anufrij
740152500e load first pages serial instead parallel
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-10-05 13:31:46 +02:00
Artem Anufrij
836c46db32 code style
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-05 13:23:07 +02:00
Artem Anufrij
12d21b0407 remove sub title on home screen
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-05 13:22:50 +02:00
Artem Anufrij
d2c70fc006 use radius for flat dialogs
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-05 12:45:11 +02:00
Artem Anufrij
d724825e06 add "regular" icons
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-05 12:35:05 +02:00
Artem Anufrij
81b649bd59 change header bar. added "flatDialogHeader" property
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-05 10:52:30 +02:00
023649e647 Merge pull request 'main' (#32) from main into dev
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #32
2023-10-05 09:29:53 +02:00
Artem Anufrij
761001d686 remove empty class attribute
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-10-04 22:56:11 +02:00
Artem Anufrij
c2659f4c85 hide header in artist dialog
Some checks failed
continuous-integration/drone/push Build is failing
2023-10-04 22:49:06 +02:00
Artem Anufrij
426a024564 redesign artist dialog
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-04 22:33:31 +02:00
6ce9df7fd8 Merge pull request 'Merge pull request 'Merge pull request 'use new cover structure for radios' (#20) from dev into main' (#21) from main into dev' (#28) from dev into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #28
2023-10-04 11:34:00 +02:00
4dd3f939b8 Merge branch 'main' into dev
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-10-04 11:32:49 +02:00
Artem Anufrij
2b79f47d57 push history item after 10%. fix #27
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-04 11:29:32 +02:00
Artem Anufrij
2abc46216d adjust banner animation for smartphones
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-28 12:48:11 +02:00
Artem Anufrij
dbefc505dd adjust viewbox
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-27 22:35:09 +02:00
16bdebf796 Merge pull request 'fancy-banner' (#25) from fancy-banner into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #25
2023-09-27 22:14:40 +02:00
Artem Anufrij
a9d705298a don't reload random covers
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-09-27 22:13:10 +02:00
Artem Anufrij
d0b4590664 ready to use
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-27 22:10:16 +02:00
Artem Anufrij
7ebce51c2d load random covers
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-27 16:51:44 +02:00
Artem Anufrij
02e13cb642 wip
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-26 23:51:33 +02:00
Artem Anufrij
c7f6695416 show radio title in the palyer bar. fix #23
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-26 14:57:37 +02:00
ff7bb569fc Merge pull request 'Merge pull request 'use new cover structure for radios' (#20) from dev into main' (#21) from main into dev
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Reviewed-on: #21
2023-09-26 14:52:00 +02:00
Artem Anufrij
9c73510bc9 code style finish fix #24
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-22 23:29:27 +02:00
Artem Anufrij
9fcadd21ac save and restore video progress
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-22 22:36:18 +02:00
c1ceae5aa9 Merge pull request 'fix radio cover in histroy item' (#22) from dev into main
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Reviewed-on: #22
2023-09-22 15:00:50 +02:00
Artem Anufrij
4b266c4738 fix radio cover in histroy item
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-09-22 14:59:31 +02:00
e690201947 Merge pull request 'use new cover structure for radios' (#20) from dev into main
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Reviewed-on: #20
2023-09-22 14:17:39 +02:00
Artem Anufrij
1097c6aa3d use new object structure for radio covers
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-09-22 14:16:39 +02:00
6b9d73492b Merge pull request 'main' (#19) from main into dev
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #19
2023-09-22 14:13:12 +02:00
82b77876a8 Merge branch 'dev' into main
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-22 14:10:52 +02:00
Artem Anufrij
5ca85841e7 undo last changes
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-09-22 14:10:13 +02:00
Artem Anufrij
8c651108c4 switch to new cover property
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2023-09-22 14:04:22 +02:00
Artem Anufrij
d44176f86c change cover structure for radio fix #15
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-21 11:11:54 +02:00
Artem Anufrij
0a78c4ee19 try to fix behavior on safari
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2023-09-19 18:05:26 +02:00
Artem Anufrij
37919998dd restore progress after reloading the page (F5)
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-19 17:40:18 +02:00
27 changed files with 619 additions and 497 deletions

75
package-lock.json generated
View File

@@ -9,7 +9,8 @@
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.3.0", "@fortawesome/fontawesome-svg-core": "^6.3.0",
"@fortawesome/free-solid-svg-icons": "^6.3.0", "@fortawesome/free-regular-svg-icons": "^6.4.2",
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/vue-fontawesome": "^3.0.3", "@fortawesome/vue-fontawesome": "^3.0.3",
"axios": "^1.3.3", "axios": "^1.3.3",
"body-parser": "^1.20.1", "body-parser": "^1.20.1",
@@ -1890,18 +1891,48 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/@fortawesome/free-solid-svg-icons": { "node_modules/@fortawesome/free-regular-svg-icons": {
"version": "6.3.0", "version": "6.4.2",
"resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.3.0.tgz", "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.4.2.tgz",
"integrity": "sha512-x5tMwzF2lTH8pyv8yeZRodItP2IVlzzmBuD1M7BjawWgg9XAvktqJJ91Qjgoaf8qJpHQ8FEU9VxRfOkLhh86QA==", "integrity": "sha512-0+sIUWnkgTVVXVAPQmW4vxb9ZTHv0WstOa3rBx9iPxrrrDH6bNLsDYuwXF9b6fGm+iR7DKQvQshUH/FJm3ed9Q==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-common-types": "6.3.0" "@fortawesome/fontawesome-common-types": "6.4.2"
}, },
"engines": { "engines": {
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/@fortawesome/free-regular-svg-icons/node_modules/@fortawesome/fontawesome-common-types": {
"version": "6.4.2",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.2.tgz",
"integrity": "sha512-1DgP7f+XQIJbLFCTX1V2QnxVmpLdKdzzo2k8EmvDOePfchaIGQ9eCHj2up3/jNEbZuBqel5OxiaOJf37TWauRA==",
"hasInstallScript": true,
"engines": {
"node": ">=6"
}
},
"node_modules/@fortawesome/free-solid-svg-icons": {
"version": "6.4.2",
"resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.4.2.tgz",
"integrity": "sha512-sYwXurXUEQS32fZz9hVCUUv/xu49PEJEyUOsA51l6PU/qVgfbTb2glsTEaJngVVT8VqBATRIdh7XVgV1JF1LkA==",
"hasInstallScript": true,
"dependencies": {
"@fortawesome/fontawesome-common-types": "6.4.2"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@fortawesome/free-solid-svg-icons/node_modules/@fortawesome/fontawesome-common-types": {
"version": "6.4.2",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.2.tgz",
"integrity": "sha512-1DgP7f+XQIJbLFCTX1V2QnxVmpLdKdzzo2k8EmvDOePfchaIGQ9eCHj2up3/jNEbZuBqel5OxiaOJf37TWauRA==",
"hasInstallScript": true,
"engines": {
"node": ">=6"
}
},
"node_modules/@fortawesome/vue-fontawesome": { "node_modules/@fortawesome/vue-fontawesome": {
"version": "3.0.3", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/@fortawesome/vue-fontawesome/-/vue-fontawesome-3.0.3.tgz", "resolved": "https://registry.npmjs.org/@fortawesome/vue-fontawesome/-/vue-fontawesome-3.0.3.tgz",
@@ -14961,12 +14992,34 @@
"@fortawesome/fontawesome-common-types": "6.3.0" "@fortawesome/fontawesome-common-types": "6.3.0"
} }
}, },
"@fortawesome/free-solid-svg-icons": { "@fortawesome/free-regular-svg-icons": {
"version": "6.3.0", "version": "6.4.2",
"resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.3.0.tgz", "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.4.2.tgz",
"integrity": "sha512-x5tMwzF2lTH8pyv8yeZRodItP2IVlzzmBuD1M7BjawWgg9XAvktqJJ91Qjgoaf8qJpHQ8FEU9VxRfOkLhh86QA==", "integrity": "sha512-0+sIUWnkgTVVXVAPQmW4vxb9ZTHv0WstOa3rBx9iPxrrrDH6bNLsDYuwXF9b6fGm+iR7DKQvQshUH/FJm3ed9Q==",
"requires": { "requires": {
"@fortawesome/fontawesome-common-types": "6.3.0" "@fortawesome/fontawesome-common-types": "6.4.2"
},
"dependencies": {
"@fortawesome/fontawesome-common-types": {
"version": "6.4.2",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.2.tgz",
"integrity": "sha512-1DgP7f+XQIJbLFCTX1V2QnxVmpLdKdzzo2k8EmvDOePfchaIGQ9eCHj2up3/jNEbZuBqel5OxiaOJf37TWauRA=="
}
}
},
"@fortawesome/free-solid-svg-icons": {
"version": "6.4.2",
"resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.4.2.tgz",
"integrity": "sha512-sYwXurXUEQS32fZz9hVCUUv/xu49PEJEyUOsA51l6PU/qVgfbTb2glsTEaJngVVT8VqBATRIdh7XVgV1JF1LkA==",
"requires": {
"@fortawesome/fontawesome-common-types": "6.4.2"
},
"dependencies": {
"@fortawesome/fontawesome-common-types": {
"version": "6.4.2",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.2.tgz",
"integrity": "sha512-1DgP7f+XQIJbLFCTX1V2QnxVmpLdKdzzo2k8EmvDOePfchaIGQ9eCHj2up3/jNEbZuBqel5OxiaOJf37TWauRA=="
}
} }
}, },
"@fortawesome/vue-fontawesome": { "@fortawesome/vue-fontawesome": {

View File

@@ -14,7 +14,8 @@
"main": "electron.js", "main": "electron.js",
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.3.0", "@fortawesome/fontawesome-svg-core": "^6.3.0",
"@fortawesome/free-solid-svg-icons": "^6.3.0", "@fortawesome/free-regular-svg-icons": "^6.4.2",
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/vue-fontawesome": "^3.0.3", "@fortawesome/vue-fontawesome": "^3.0.3",
"axios": "^1.3.3", "axios": "^1.3.3",
"body-parser": "^1.20.1", "body-parser": "^1.20.1",

View File

@@ -1,5 +1,5 @@
{ {
"backend_de": "http://localhost:31204", "backend_de": "http://localhost:31204",
"backend_dev": "https://webplay.rocks", "backend_dev": "https://webplay.rocks",
"backend": "https://webplay.rocks" "backend": ""
} }

View File

@@ -85,23 +85,10 @@ td.fillCell>* {
text-align: center; text-align: center;
} }
.favourite {
z-index: 1;
position: absolute;
cursor: pointer;
}
.favourite.active { .favourite.active {
color: var(--yellow); color: var(--yellow);
} }
.keepPlaying {
z-index: 1;
position: absolute;
cursor: pointer;
right: 0;
}
/* /*
DIALOGS DIALOGS
@@ -638,9 +625,8 @@ td.fillCell>* {
} }
#artists .artistCover { #artists .artistCover {
min-width: 100%; width: 160px;
height: initial; height: initial;
min-height: 128px;
} }
#artists .artistName { #artists .artistName {

View File

@@ -1741,6 +1741,10 @@ td.strech {
box-shadow: 0 1px 4px var(--glow); box-shadow: 0 1px 4px var(--glow);
} }
.glow-text {
text-shadow: 0 1px 4px var(--glow);
}
.nowrap { .nowrap {
white-space: nowrap; white-space: nowrap;
} }

View File

@@ -1,6 +1,6 @@
<template> <template>
<div id="player" class="flex-column" v-show="selectedTrack._id || selectedRadio._id"> <div id="player" class="flex-column" v-show="selectedTrack._id || selectedRadio._id">
<input type="range" id="slider" min="0" max="100" step="0.1" v-model="selectedTrack.percent" @change="slideChanged" /> <input type="range" id="slider" min="0" max="100" step="0.1" v-model="selectedTrack.percent" @change="slideChanged"/>
<div id="playerBar" class="flex-row"> <div id="playerBar" class="flex-row">
<div class="flex-row grow"> <div class="flex-row grow">
<img class="cover pointer" :src="cover" :title="selectedTrack.parent.title" @click="gotoContainer" /> <img class="cover pointer" :src="cover" :title="selectedTrack.parent.title" @click="gotoContainer" />
@@ -9,6 +9,9 @@
from from
<b>{{ selectedTrack.parent.title }}</b> <b>{{ selectedTrack.parent.title }}</b>
</div> </div>
<div v-if="selectedRadio._id" class="flex-column">
<b>{{ selectedRadio.name }}</b>
</div>
</div> </div>
<div id="playerControls" class="flex-row center"> <div id="playerControls" class="flex-row center">
<button @click="switchShuffle" title="Shuffle mode" v-if="selectedTrack._id"> <button @click="switchShuffle" title="Shuffle mode" v-if="selectedTrack._id">
@@ -31,8 +34,8 @@
<img src="static/icons/media-no-repeat-dark.svg" class="small" v-show="$store.getters['player/repeatType'] == 'none'" /> <img src="static/icons/media-no-repeat-dark.svg" class="small" v-show="$store.getters['player/repeatType'] == 'none'" />
</button> </button>
</div> </div>
<div class="flex-row ma-right hideOnMobilePortrait grow right" v-show="selectedTrack.title"> <div class="flex-row ma-right hideOnMobilePortrait grow right">
{{ formatedP }}&nbsp;|&nbsp;{{ formatedD }} <span v-show="selectedTrack.title">{{ formatedP }}&nbsp;|&nbsp;{{ formatedD }}</span>
</div> </div>
</div> </div>
<audio preload="auto" ref="audioControl" type="audio/mpeg" @ended="nextTrack" @canplay="play" @playing="playing" @durationchange="durationChanged" @timeupdate="timeUpdate" src></audio> <audio preload="auto" ref="audioControl" type="audio/mpeg" @ended="nextTrack" @canplay="play" @playing="playing" @durationchange="durationChanged" @timeupdate="timeUpdate" src></audio>
@@ -124,7 +127,7 @@ export default {
let item = { let item = {
id: this.selectedRadio._id, id: this.selectedRadio._id,
cover128: this.selectedRadio.cover128, covers: { cover128: this.selectedRadio.covers.cover128 },
name: this.selectedRadio.name, name: this.selectedRadio.name,
type: "radio", type: "radio",
}; };
@@ -143,17 +146,14 @@ export default {
this.audio.pause(); this.audio.pause();
this.audio.src = url; this.audio.src = url;
this.pushHistoryItem();
if (this.currentTrackParent.progress) { if (this.currentTrackParent.progress) {
if (this.currentTrackParent.progress.id == this.selectedTrack._id) { if (this.currentTrackParent.progress.id == this.selectedTrack._id) {
this.skipToSecond(this.currentTrackParent.progress.progress); this.skipToSecond(this.currentTrackParent.progress.progress);
} }
this.currentTrackParent.progress = undefined; this.currentTrackParent.progress = undefined;
} else { }
// Try to fix SAFARI // Try to fix SAFARI
this.audio.play(); this.audio.play();
}
}, },
pushHistoryItem() { pushHistoryItem() {
if (!this.currentUser._id) { if (!this.currentUser._id) {
@@ -295,6 +295,7 @@ export default {
track: this.selectedTrack, track: this.selectedTrack,
rate: this.audioBpm, rate: this.audioBpm,
}); });
this.pushHistoryItem();
} }
}, },
}, },
@@ -312,8 +313,8 @@ export default {
if (this.selectedRadio) { if (this.selectedRadio) {
let res = "/static/icons/dummy/radio.svg"; let res = "/static/icons/dummy/radio.svg";
if (this.selectedRadio.cover64) { if (this.selectedRadio.covers.cover64) {
res = this.selectedRadio.cover64; res = this.selectedRadio.covers.cover64;
} }
return res; return res;
} }

View File

@@ -33,8 +33,8 @@ export default {
computed: { computed: {
cover() { cover() {
let res = "/static/icons/dummy/radio.svg"; let res = "/static/icons/dummy/radio.svg";
if (this.item && this.item.cover128) { if (this.item && this.item.covers.cover128) {
res = this.item.cover128; res = this.item.covers.cover128;
} }
return res; return res;
}, },

View File

@@ -1,65 +1,32 @@
<template> <template>
<div <div ref="dialogBackground" class="dialog-background" v-if="visible" @click="bgClicked">
ref="dialogBackground" <div class="dialog-window" :class="{
class="dialog-background"
v-if="visible"
@click="bgClicked"
>
<div
class="dialog-window"
:class="{
fullscreen: isFullscreen, fullscreen: isFullscreen,
'max-size': maxSize, 'max-size': maxSize,
playing: $store.getters['player/isPlaying'], playing: $store.getters['player/isPlaying'],
}" }">
> <div class="dialog-header" :class="{ hideOnMobile: showHeaderOnMobile == false, 'flat-dialog-header': flatDialogHeader == true }" v-if="showHeader" @dblclick="headerDoubleClick">
<div
class="dialog-header"
:class="{ hideOnMobile: showHeaderOnMobile == false }"
v-if="showHeader"
@dblclick="headerDoubleClick"
>
<div class="dialog-header-left"> <div class="dialog-header-left">
<slot name="header-left" /> <slot name="header-left" />
</div> </div>
<div class="dialog-header-center"> <div class="dialog-header-center">
<h3 v-if="dialogTitle">{{ dialogTitle }}</h3> <h3 v-if="dialogTitle && !flatDialogHeader">{{ dialogTitle }}</h3>
<slot name="header-center" /> <slot name="header-center" />
</div> </div>
<div class="dialog-header-right"> <div class="dialog-header-right">
<slot name="header-right" /> <slot name="header-right" />
<button <button class="hideOnMobile" @click="isFullscreen = !isFullscreen" v-if="showFullscreenButton" :title="isFullscreen ? 'Restore' : 'Fullscreen'">
class="hideOnMobile"
@click="isFullscreen = !isFullscreen"
v-if="showFullscreenButton"
:title="isFullscreen ? 'Restore' : 'Fullscreen'"
>
<awesome-icon v-if="isFullscreen" icon="compress" /> <awesome-icon v-if="isFullscreen" icon="compress" />
<awesome-icon v-else icon="expand" /> <awesome-icon v-else icon="expand" />
</button> </button>
<button <button @click="cancel" class="red" v-if="showCloseButton" title="Close">
@click="cancel"
class="red"
v-if="showCloseButton"
title="Close"
>
<awesome-icon icon="times" /> <awesome-icon icon="times" />
</button> </button>
</div> </div>
</div> </div>
<div <div class="dialog-body" :class="{ hideXScroll: disableXscroll == true, hideYScroll: disableYscroll == true, 'flat-dialog-header': flatDialogHeader == true }">
class="dialog-body"
:class="{
hideXScroll: disableXscroll == true,
hideYScroll: disableYscroll == true,
}"
>
<slot /> <slot />
<div <div class="dialog-body-content" v-if="dialogContent" v-html="dialogContent" />
class="dialog-body-content"
v-if="dialogContent"
v-html="dialogContent"
/>
</div> </div>
<div class="dialog-footer" v-if="showFooter"> <div class="dialog-footer" v-if="showFooter">
<div class="dialog-footer-left"> <div class="dialog-footer-left">
@@ -74,41 +41,15 @@
</div> </div>
<div> <div>
<slot name="footer-right" /> <slot name="footer-right" />
<div <div class="dialog-footer-controls" v-if="showFooterButtons &&
class="dialog-footer-controls"
v-if="
showFooterButtons &&
(openButtons == null || openButtons.length > 0) (openButtons == null || openButtons.length > 0)
" ">
> <button v-for="( button, i ) in dialogButtons " :key="i" @click="click('clicked', button.text || button)" :class="button.class || ''" :disabled="button.disabled" :title="button.title || ''" v-show="button.visible != false">
<button <awesome-icon v-if="button.icon" :icon="button.icon" class="ma-right8" />
v-for="(button, i) in dialogButtons"
:key="i"
@click="click('clicked', button.text || button)"
:class="button.class || ''"
:disabled="button.disabled"
:title="button.title || ''"
v-show="button.visible != false"
>
<awesome-icon
v-if="button.icon"
:icon="button.icon"
class="ma-right8"
/>
{{ button.text || button }} {{ button.text || button }}
</button> </button>
<button <button ref="dialogButton" @click="click('accept')" v-if="showFooterButtons && !dialogButtons" :disabled="!enableFooterButtons" :class="buttonClass">
ref="dialogButton" <awesome-icon v-if="buttonIcon" :icon="buttonIcon" class="ma-right8" />
@click="click('accept')"
v-if="showFooterButtons && !dialogButtons"
:disabled="!enableFooterButtons"
:class="buttonClass"
>
<awesome-icon
v-if="buttonIcon"
:icon="buttonIcon"
class="ma-right8"
/>
{{ buttonText }} {{ buttonText }}
</button> </button>
</div> </div>
@@ -143,6 +84,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
flatDialogHeader: {
type: Boolean,
default: false
},
showFooter: { showFooter: {
type: Boolean, type: Boolean,
default: true, default: true,
@@ -301,6 +246,7 @@ export default {
z-index: 1000; z-index: 1000;
animation: fadeIn ease 0.20s; animation: fadeIn ease 0.20s;
} }
.dialog-window { .dialog-window {
box-shadow: 0px 8px 32px var(--shadow); box-shadow: 0px 8px 32px var(--shadow);
background-color: var(--white); background-color: var(--white);
@@ -308,13 +254,16 @@ export default {
max-height: 80%; max-height: 80%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border-top-left-radius: 4px; border-top-left-radius: 8px;
border-top-right-radius: 4px; border-top-right-radius: 8px;
position: absolute;
} }
.dialog-window.max-size { .dialog-window.max-size {
width: 90%; width: 90%;
height: 90%; height: 90%;
} }
.dialog-window.fullscreen { .dialog-window.fullscreen {
max-width: initial; max-width: initial;
max-height: initial; max-height: initial;
@@ -329,10 +278,21 @@ export default {
flex-shrink: 0; flex-shrink: 0;
background-color: var(--background); background-color: var(--background);
box-shadow: 0px 1px 4px var(--shadow); box-shadow: 0px 1px 4px var(--shadow);
border-top-left-radius: 4px; border-top-left-radius: 8px;
border-top-right-radius: 4px; border-top-right-radius: 8px;
z-index: 1; z-index: 1;
} }
.dialog-header.flat-dialog-header {
background: transparent;
position: absolute;
left: 0;
right: 0;
top: 0;
box-shadow: none;
z-index: 101;
}
.dialog-header h3 { .dialog-header h3 {
flex-grow: 1; flex-grow: 1;
margin: 0; margin: 0;
@@ -344,6 +304,7 @@ export default {
align-self: center; align-self: center;
cursor: default; cursor: default;
} }
.dialog-header input, .dialog-header input,
.dialog-header select { .dialog-header select {
padding: 0 4px; padding: 0 4px;
@@ -352,6 +313,7 @@ export default {
background-color: var(--white); background-color: var(--white);
align-self: stretch; align-self: stretch;
} }
.dialog-header button, .dialog-header button,
.dialog-header a { .dialog-header a {
background-color: transparent; background-color: transparent;
@@ -365,85 +327,124 @@ export default {
.dialog-header button:hover { .dialog-header button:hover {
background-color: var(--light-gray); background-color: var(--light-gray);
} }
.dialog-header button.red:hover { .dialog-header button.red:hover {
background-color: var(--red50); background-color: var(--red50);
color: var(--white); color: var(--white);
} }
.dialog-header button.red svg { .dialog-header button.red svg {
color: var(--red); color: var(--red);
} }
.dialog-header button.red:hover svg { .dialog-header button.red:hover svg {
color: var(--white); color: var(--white);
} }
.dialog-header button.blue { .dialog-header button.blue {
background-color: var(--blue); background-color: var(--blue);
} }
.dialog-header button.green:hover { .dialog-header button.green:hover {
background-color: var(--green); background-color: var(--green);
color: var(--green); color: var(--green);
} }
.dialog-header button.green svg { .dialog-header button.green svg {
color: var(--green); color: var(--green);
} }
.dialog-header button.yellow { .dialog-header button.yellow {
background-color: var(--yellow); background-color: var(--yellow);
} }
/* SUCCESS */ /* SUCCESS */
.dialog-header button.success svg { .dialog-header button.success svg {
color: var(--success); color: var(--success);
} }
.dialog-header button.success:hover { .dialog-header button.success:hover {
background-color: var(--success); background-color: var(--success);
} }
.dialog-header button.success:hover svg { .dialog-header button.success:hover svg {
color: var(--white); color: var(--white);
} }
.dialog-header button.primary, .dialog-header button.primary,
.dialog-header a.primary { .dialog-header a.primary {
background-color: var(--primary); background-color: var(--primary);
color: var(--white); color: var(--white);
} }
.dialog-header button > span,
.dialog-header a > span { .dialog-header button>span,
.dialog-header a>span {
margin-left: 12px; margin-left: 12px;
} }
.dialog-header svg { .dialog-header svg {
width: 16px !important; width: 16px !important;
height: 16px; height: 16px;
} }
.dialog-header > div,
.dialog-footer > div { .dialog-header>div,
.dialog-footer>div {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.dialog-header > .dialog-header-center,
.dialog-footer > .dialog-footer-center { .dialog-header>.dialog-header-center,
.dialog-footer>.dialog-footer-center {
flex-grow: 1; flex-grow: 1;
justify-content: center; justify-content: center;
margin: 0 12px; margin: 0 12px;
} }
.dialog-header > .dialog-header-right input,
.dialog-header > .dialog-header-right select { .dialog-header>.dialog-header-right input,
.dialog-header>.dialog-header-right select {
border-left: 1px solid var(--light-border); border-left: 1px solid var(--light-border);
} }
.dialog-header.flat-dialog-header>.dialog-header-right>button {
color: var(--white);
}
.dialog-header.flat-dialog-header>.dialog-header-right>button:hover {
color: var(--gray);
}
.dialog-body { .dialog-body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: auto; overflow-y: auto;
flex-grow: 1; flex-grow: 1;
} }
.dialog-body.flat-dialog-header {
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
.dialog-window.fullscreen .dialog-body.flat-dialog-header {
border-top-left-radius: 0px;
border-top-right-radius: 0px;
}
.dialog-body.hideXScroll { .dialog-body.hideXScroll {
overflow-x: hidden; overflow-x: hidden;
} }
.dialog-body.hideYScroll { .dialog-body.hideYScroll {
overflow-y: hidden; overflow-y: hidden;
} }
.dialog-body-content { .dialog-body-content {
margin: 4px; margin: 4px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.dialog-footer { .dialog-footer {
border-top: 1px solid var(--light-border); border-top: 1px solid var(--light-border);
display: flex; display: flex;
@@ -451,27 +452,33 @@ export default {
align-items: center; align-items: center;
background-color: var(--background); background-color: var(--background);
} }
.dialog-footer button:disabled { .dialog-footer button:disabled {
opacity: 0.5; opacity: 0.5;
} }
.dialog-footer .dialog-message { .dialog-footer .dialog-message {
flex-grow: 1; flex-grow: 1;
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: 4px; margin-left: 4px;
} }
.dialog-footer .dialog-message svg { .dialog-footer .dialog-message svg {
margin-right: 4px; margin-right: 4px;
} }
.dialog-footer .dialog-footer-controls { .dialog-footer .dialog-footer-controls {
padding: 4px; padding: 4px;
display: flex; display: flex;
} }
.dialog-footer .dialog-footer-controls button:not(:last-child) { .dialog-footer .dialog-footer-controls button:not(:last-child) {
margin-right: 4px; margin-right: 4px;
} }
@media (max-width: 480px), (max-height: 480px) { @media (max-width: 480px),
(max-height: 480px) {
.dialog-window { .dialog-window {
max-width: initial; max-width: initial;
max-height: initial; max-height: initial;
@@ -480,14 +487,22 @@ export default {
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 0; border-top-right-radius: 0;
} }
.dialog-window.max-size { .dialog-window.max-size {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.dialog-header { .dialog-header {
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 0; border-top-right-radius: 0;
} }
.dialog-body.flat-dialog-header {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.dialog-window.playing { .dialog-window.playing {
margin-bottom: 60px; margin-bottom: 60px;
height: calc(100% - 60px); height: calc(100% - 60px);

View File

@@ -1,17 +1,46 @@
<template> <template>
<DialogBase ref="dialogWindow" :title="album_title" @canceled="closed" :showFooter="false" :disableXscroll="true" :disableYscroll="true"> <DialogBase ref="dialogWindow" :title="album_title" @canceled="closed" :showFooter="false" :disableXscroll="true" :disableYscroll="true" :flatDialogHeader="true">
<div id="albumViewer" class="flex-row"> <div id="albumViewer" class="flex-row">
<div id="header" class="flex-column"> <div id="header" class="flex-column grow">
<div id="background" :style="coverBackground" /> <div id="background" :style="coverBackground" />
<div class="grow z1 center flex-column"> <div id="title" class="flex-column pa grow z1">
<img class="glow ma24" :src="cover" @dblclick="dblclick" /> <img class="glow ma" :src="cover" />
</div> <span id="stats" class="center">
<awesome-icon icon="star" size="2x" class="favourite ma4" :class="{ active: isFavourite }" @click="toggleFavourite" title="Favourite" /> {{ selectedAlbum.title }}
<awesome-icon icon="play" size="2x" class="keepPlaying ma4 primary-text" @click="playProgress" v-if="selectedAlbum.progress" title="Keep playing" /> <br />
<div id="stats" class="flex-row z1"> by
<b @click="gotoArtist" class="pointer">{{ selectedAlbum.artist_name }}</b>
<br />
<span v-if="album_year">
from year <b>{{ album_year }}</b> </span><br />
<b>{{ album_tracks.length }}</b> Tracks with a duration of
<b>{{ album_duration }}</b>
</span>
<div class="grow"> </div>
<div class="flex-row grow ma-top">
<button class="flat ma-right" title="Favourite" @click="toggleFavourite">
<awesome-icon :icon="['fas', 'star']" size="2x" class="white-text favourite active" v-if="isFavourite" />
<awesome-icon :icon="['far', 'star']" size="2x" class="white-text favourite" v-else />
</button>
<button class="flat ma-right" title="Keep playing" v-if="selectedAlbum._id == selectedTrackContainer._id && isPlaying">
<awesome-icon icon="compact-disc" size="2x" class="primary-text" />
</button>
<button class="flat ma-right" title="Keep playing" @click="playProgress" v-else-if="selectedAlbum.progress">
<awesome-icon icon="play" size="2x" class="primary-text" />
</button>
<button class="flat ma-right" title="Play" @click="playAlbum" v-else>
<awesome-icon icon="play" size="2x" class="white-text" />
</button>
<button @click="gotoPrevAlbum" class="flat ma-left ma-right" :title="prevAlbum.name" :disabled="!prevAlbum._id">
<awesome-icon icon="angle-left" class="ma4 white-text" />
</button>
<button @click="gotoNextAlbum" class="flat" :title="nextAlbum.name" :disabled="!nextAlbum._id">
<awesome-icon icon="angle-right" class="ma4 white-text" />
</button>
<div class="grow"></div>
<DropDown v-if="$store.getters['user/isAdministrator']"> <DropDown v-if="$store.getters['user/isAdministrator']">
<button class="flat center" :title="visibility_text"> <button class="flat center" :title="visibility_text">
<awesome-icon :icon="visibility_icon" /> <awesome-icon :icon="visibility_icon" class="white-text" />
</button> </button>
<template v-slot:dropdown-content> <template v-slot:dropdown-content>
<div> <div>
@@ -33,24 +62,9 @@
</div> </div>
</template> </template>
</DropDown> </DropDown>
<div class="grow flex-column">
<p class="ma4 center">
<span class="grow center">
by
<b @click="gotoArtist" class="pointer">{{
selectedAlbum.artist_name
}}</b>
<br />
<span v-if="album_year">
from year <b>{{ album_year }}</b> </span><br />
<b>{{ album_tracks.length }}</b> Tracks with a duration of
<b>{{ album_duration }}</b>
</span>
</p>
</div>
<DropDown v-if="$store.getters['user/isAdministrator']"> <DropDown v-if="$store.getters['user/isAdministrator']">
<button class="flat center"> <button class="flat center">
<awesome-icon icon="ellipsis-v" /> <awesome-icon icon="ellipsis-v" class="white-text" />
</button> </button>
<template v-slot:dropdown-content> <template v-slot:dropdown-content>
<div> <div>
@@ -69,6 +83,7 @@
</DropDown> </DropDown>
</div> </div>
</div> </div>
</div>
<ul id="trackList" class="tracks"> <ul id="trackList" class="tracks">
<li v-for="track in selectedAlbum.tracks" :key="track._id"> <li v-for="track in selectedAlbum.tracks" :key="track._id">
<TrackItem :track="track" :showCover="false" /> <TrackItem :track="track" :showCover="false" />
@@ -100,7 +115,7 @@ export default {
window.location.origin + "/#/share?id=" + this.selectedAlbum.share._id; window.location.origin + "/#/share?id=" + this.selectedAlbum.share._id;
navigator.clipboard.writeText(url); navigator.clipboard.writeText(url);
}, },
dblclick() { playAlbum() {
this.$store.commit("tracks/resetSelectedTrack"); this.$store.commit("tracks/resetSelectedTrack");
this.$store.commit("radios/resetSelectedRadio"); this.$store.commit("radios/resetSelectedRadio");
this.$store.dispatch("tracks/playContainer", this.selectedAlbum); this.$store.dispatch("tracks/playContainer", this.selectedAlbum);
@@ -216,8 +231,13 @@ export default {
this.$store.dispatch("albums/shareDisable", this.selectedAlbum); this.$store.dispatch("albums/shareDisable", this.selectedAlbum);
}, },
loadUserProgress() { loadUserProgress() {
if (this.selectedTrack.parent._id != this.selectedAlbum._id) if (this.selectedTrack.parent._id != this.selectedAlbum._id) {
this.$store.dispatch("user/getProgress", this.selectedAlbum); this.$store
.dispatch("user/getProgress", this.selectedAlbum)
.then(() => {
this.gotoTrack();
});
}
} }
}, },
computed: { computed: {
@@ -226,7 +246,9 @@ export default {
nextAlbum: ["albums/nextAlbum"], nextAlbum: ["albums/nextAlbum"],
selectedAlbum: ["albums/selectedAlbum"], selectedAlbum: ["albums/selectedAlbum"],
selectedTrack: ["tracks/selectedTrack"], selectedTrack: ["tracks/selectedTrack"],
selectedTrackContainer: ["tracks/selectedTrackContainer"],
favourites: ["user/favourites"], favourites: ["user/favourites"],
isPlaying: ["player/isPlaying"],
}), }),
album_title() { album_title() {
return this.selectedAlbum.title; return this.selectedAlbum.title;
@@ -310,7 +332,6 @@ export default {
window.addEventListener("keydown", this.keydownListener); window.addEventListener("keydown", this.keydownListener);
} }
this.loadUserProgress(); this.loadUserProgress();
this.gotoTrack();
} else { } else {
if (this.$refs.dialogWindow.visible) { if (this.$refs.dialogWindow.visible) {
this.$refs.dialogWindow.close(); this.$refs.dialogWindow.close();
@@ -328,11 +349,13 @@ export default {
<style scoped> <style scoped>
#albumViewer { #albumViewer {
height: 366px; height: 400px;
width: 640px; width: 640px;
} }
#header { #header {
width: 304px;
height: 400px;
position: relative; position: relative;
background-color: black; background-color: black;
} }
@@ -344,13 +367,8 @@ export default {
#stats { #stats {
z-index: 2; z-index: 2;
align-items: center;
color: var(--white); color: var(--white);
text-shadow: 0 1px 2px black; text-shadow: 0 1px 2px black;
line-height: 1.4;
background-color: #ffffff40;
border-top: 1px solid #ffffff20;
border-bottom: 1px solid #00000020;
} }
.dropdown-activator button { .dropdown-activator button {

View File

@@ -1,11 +1,10 @@
<template> <template>
<DialogBase ref="dialogWindow" id="dialogWindow" :title="selectedArtist.name" @canceled="closed" :showFooter="false" :showFullscreenButton="true" :disableXscroll="true" :disableYscroll="true"> <DialogBase ref="dialogWindow" id="dialogWindow" :title="selectedArtist.name" @canceled="closed" :showFooter="false" :flatDialogHeader="true" :showFullscreenButton="true" :disableXscroll="true" :disableYscroll="true">
<div id="artistViewer"> <div id="artistViewer">
<div id="header" class="flex-column"> <div id="header" class="flex-column">
<div id="background" :style="coverBackground" /> <div id="background" :style="coverBackground" />
<awesome-icon icon="star" size="2x" class="favourite ma4" :class="{ active: isFavourite }" @click="toggleFavourite" /> <div id="title" class="flex-column ma-left ma-right pa-bottom">
<awesome-icon icon="play" size="2x" class="keepPlaying ma4 primary-text" @click="playProgress" v-if="selectedArtist.progress" title="Keep playing" /> <h1>
<h1 @dblclick="dblclick">
{{ selectedArtist.name }} {{ selectedArtist.name }}
</h1> </h1>
<span id="stats" class="ma-bottom"> <span id="stats" class="ma-bottom">
@@ -13,23 +12,30 @@
<b>{{ artist_albums.length }}</b> Albums with a duration of <b>{{ artist_albums.length }}</b> Albums with a duration of
<b>{{ artist_duration }}</b> <b>{{ artist_duration }}</b>
</span> </span>
<div id="albumList" class="flex-row showOnMobilePortrait"> <div class="flex-row ma-top ma-bottom">
<AlbumItem class="ma" :class="{ playing: playingAlbumId == album._id }" v-for="album in selectedArtist.albums" :key="album._id" :item="album" @click="scrollToAlbum(album)" @dblclick="playAlbum(album)" /> <button class="flat ma-right" @click="toggleFavourite" title="Favourite">
</div> <awesome-icon :icon="['fas', 'star']" size="2x" class="white-text favourite active" v-if="isFavourite" />
<div id="navigation" class="flex-row center ma-top"> <awesome-icon :icon="['far', 'star']" size="2x" class="white-text favourite" v-else />
<div class="flex-row grow"></div>
<div class="flex-row">
<button @click="gotoPrevArtist" class="primary ma4" :title="prevArtist.name" :disabled="!prevArtist._id">
<awesome-icon icon="angle-left" class="ma4" />
</button> </button>
<button @click="gotoNextArtist" class="primary ma4" :title="nextArtist.name" :disabled="!nextArtist._id"> <button class="flat ma-right" title="Keep playing" v-if="selectedArtist._id == selectedTrackContainer._id && isPlaying">
<awesome-icon icon="angle-right" class="ma4" /> <awesome-icon icon="compact-disc" size="2x" class="primary-text" />
</button> </button>
</div> <button class="flat ma-right" @click="playProgress" title="Keep playing" v-else-if="selectedArtist.progress">
<div class="flex-row grow right center"> <awesome-icon icon="play" size="2x" class="primary-text" />
<DropDown v-if="$store.getters['user/isAdministrator']" class="hideOnMobile"> </button>
<button class="flat pa8-left pa8-right"> <button class="flat ma-right" @click="playArtist" title="Play" v-else>
<awesome-icon icon="ellipsis-v" /> <awesome-icon icon="play" size="2x" class="white-text" />
</button>
<button @click="gotoPrevArtist" class="flat ma-left ma-right" :title="prevArtist.name" :disabled="!prevArtist._id">
<awesome-icon icon="angle-left" class="ma4 white-text" />
</button>
<button @click="gotoNextArtist" class="flat" :title="nextArtist.name" :disabled="!nextArtist._id">
<awesome-icon icon="angle-right" class="ma4 white-text" />
</button>
<DropDown v-if="$store.getters['user/isAdministrator']" class="ma-left hideOnMobile">
<button class="flat pa-left pa-right">
<awesome-icon icon="ellipsis-v" class="white-text" />
</button> </button>
<template v-slot:dropdown-content> <template v-slot:dropdown-content>
<div> <div>
@@ -48,6 +54,9 @@
</DropDown> </DropDown>
</div> </div>
</div> </div>
<div id="albumList" class="flex-row showOnMobilePortrait">
<AlbumItem class="ma" :class="{ playing: playingAlbumId == album._id }" v-for="album in selectedArtist.albums" :key="album._id" :item="album" @click="scrollToAlbum(album)" @dblclick="playAlbum(album)" />
</div>
</div> </div>
<div class="flex-row overflow-y"> <div class="flex-row overflow-y">
<div id="albumList" class="flex-column hideOnMobilePortrait"> <div id="albumList" class="flex-column hideOnMobilePortrait">
@@ -77,7 +86,7 @@ export default {
} }
}, },
methods: { methods: {
dblclick() { playArtist() {
this.$store.commit("tracks/resetSelectedTrack"); this.$store.commit("tracks/resetSelectedTrack");
this.$store.commit("radios/resetSelectedRadio"); this.$store.commit("radios/resetSelectedRadio");
this.$store.dispatch("tracks/playContainer", this.selectedArtist); this.$store.dispatch("tracks/playContainer", this.selectedArtist);
@@ -110,8 +119,9 @@ export default {
}, },
closed() { closed() {
if ( if (
window.history.state.back && (
window.history.state.back.indexOf("?") == -1 || window.history.state.back.indexOf("?") == -1 ||
window.history.state.back.startsWith("/search") window.history.state.back.startsWith("/search"))
) { ) {
this.$router.back(); this.$router.back();
} else { } else {
@@ -154,8 +164,13 @@ export default {
this.$store.dispatch("artists/uploadNewCover", this.selectedArtist); this.$store.dispatch("artists/uploadNewCover", this.selectedArtist);
}, },
loadUserProgress() { loadUserProgress() {
if (!this.isPlaying || this.selectedTrack.parent.parent._id != this.selectedArtist._id) if (!this.isPlaying || !this.selectedTrack.parent.parent || this.selectedTrack.parent.parent._id != this.selectedArtist._id) {
this.$store.dispatch("user/getProgress", this.selectedArtist); this.$store.dispatch("user/getProgress", this.selectedArtist).then(() => {
this.gotoTrack();
});
} else {
this.gotoTrack();
}
} }
}, },
computed: { computed: {
@@ -164,6 +179,7 @@ export default {
nextArtist: ["artists/nextArtist"], nextArtist: ["artists/nextArtist"],
selectedArtist: ["artists/selectedArtist"], selectedArtist: ["artists/selectedArtist"],
selectedTrack: ["tracks/selectedTrack"], selectedTrack: ["tracks/selectedTrack"],
selectedTrackContainer: ["tracks/selectedTrackContainer"],
favourites: ["user/favourites"], favourites: ["user/favourites"],
isPlaying: ["player/isPlaying"] isPlaying: ["player/isPlaying"]
}), }),
@@ -231,7 +247,6 @@ export default {
window.addEventListener("keydown", this.keydownListener); window.addEventListener("keydown", this.keydownListener);
} }
this.loadUserProgress(); this.loadUserProgress();
this.gotoTrack();
} else { } else {
if (this.$refs.dialogWindow.visible) { if (this.$refs.dialogWindow.visible) {
this.$refs.dialogWindow.close(); this.$refs.dialogWindow.close();
@@ -258,7 +273,6 @@ export default {
h1, h1,
#stats { #stats {
z-index: 1; z-index: 1;
text-align: center;
width: 100%; width: 100%;
color: var(--white); color: var(--white);
text-shadow: 0 1px 2px black; text-shadow: 0 1px 2px black;
@@ -276,6 +290,10 @@ h1,
max-width: 100%; max-width: 100%;
} }
#header #title {
z-index: 100;
}
#albumList { #albumList {
z-index: 1; z-index: 1;
overflow-y: auto; overflow-y: auto;

View File

@@ -1,38 +1,42 @@
<template> <template>
<DialogBase <DialogBase ref="dialogWindow" :title="selectedBox.title" @canceled="closed" :showFooter="false" :closeOnEscape="selectedVideo._id == null" :disableXscroll="true" :disableYscroll="true" :flatDialogHeader="true">
ref="dialogWindow"
:title="selectedBox.title"
@canceled="closed"
:showFooter="false"
:closeOnEscape="selectedVideo._id == null"
:disableXscroll="true"
:disableYscroll="true"
>
<div id="boxViewer" class="flex-row"> <div id="boxViewer" class="flex-row">
<div id="header" class="flex-column"> <div id="header" class="flex-column grow">
<div id="background" :style="coverBackground" /> <div id="background" :style="coverBackground" />
<div class="grow z1 center flex-column"> <div id="title" class="grow z1 pa flex-column">
<img class="glow ma24" :src="cover" @dblclick="dblclick" /> <img class="glow ma" :src="cover" />
</div> <span id="stats" class="center">
<awesome-icon <b>{{ selectedBox.title }}</b>
icon="star" <br />
size="2x" <b>{{ box_videos.length }}</b> Videos
class="favourite ma4 z2" </span>
:class="{ active: isFavourite }"
@click="toggleFavourite" <div class="grow"> </div>
/> <div class="flex-row ma-top grow">
<div id="stats" class="flex-row z1"> <button class="flat ma-right" title="Favourite" @click="toggleFavourite">
<awesome-icon :icon="['fas', 'star']" size="2x" class="white-text favourite active" v-if="isFavourite" />
<awesome-icon :icon="['far', 'star']" size="2x" class="white-text favourite" v-else />
</button>
<button class="flat ma-right" title="Keep playing" @click="playProgress" v-if="selectedBox.progress">
<awesome-icon icon="play" size="2x" class="primary-text" />
</button>
<button class="flat ma-right" title="Play" @dblclick="dblclick" v-else>
<awesome-icon icon="play" size="2x" class="white-text" />
</button>
<button @click="gotoPrevBox" class="flat ma-left ma-right" :title="prevBox.name" :disabled="!prevBox._id">
<awesome-icon icon="angle-left" class="ma4 white-text" />
</button>
<button @click="gotoNextBox" class="flat" :title="nextBox.name" :disabled="!nextBox._id">
<awesome-icon icon="angle-right" class="ma4 white-text" />
</button>
<div class="grow"></div>
<DropDown v-if="$store.getters['user/isAdministrator']"> <DropDown v-if="$store.getters['user/isAdministrator']">
<button class="flat center" :title="visibility_text"> <button class="flat center" :title="visibility_text">
<awesome-icon :icon="visibility_icon" /> <awesome-icon :icon="visibility_icon" class="white-text" />
</button> </button>
<template v-slot:dropdown-content> <template v-slot:dropdown-content>
<div> <div>
<button <button v-for="(item, i) in $store.state.system.lists.visibility" :key="i" @click="setVisibility(item)">
v-for="(item, i) in $store.state.system.lists.visibility"
:key="i"
@click="setVisibility(item)"
>
<awesome-icon :icon="getVisibilityIcon(item)" />{{ <awesome-icon :icon="getVisibilityIcon(item)" />{{
getVisibilityText(item) getVisibilityText(item)
}} }}
@@ -41,10 +45,7 @@
<button v-if="!selectedBox.share._id" @click="shareEnable"> <button v-if="!selectedBox.share._id" @click="shareEnable">
<awesome-icon icon="share" />Share this box <awesome-icon icon="share" />Share this box
</button> </button>
<button <button v-if="selectedBox.share._id" @click="addShareUrlToClipboard">
v-if="selectedBox.share._id"
@click="addShareUrlToClipboard"
>
<awesome-icon icon="clipboard" />Copy url into clipboard <awesome-icon icon="clipboard" />Copy url into clipboard
</button> </button>
<button v-if="selectedBox.share._id" @click="shareDisable"> <button v-if="selectedBox.share._id" @click="shareDisable">
@@ -53,18 +54,9 @@
</div> </div>
</template> </template>
</DropDown> </DropDown>
<div class="grow flex-column">
<p class="ma4 center">
<span class="">
<b>{{ selectedBox.title }}</b>
<br />
<b>{{ box_videos.length }}</b> Videos
</span>
</p>
</div>
<DropDown v-if="$store.getters['user/isAdministrator']"> <DropDown v-if="$store.getters['user/isAdministrator']">
<button class="flat center"> <button class="flat center">
<awesome-icon icon="ellipsis-v" /> <awesome-icon icon="ellipsis-v" class="white-text" />
</button> </button>
<template v-slot:dropdown-content> <template v-slot:dropdown-content>
<div> <div>
@@ -83,7 +75,7 @@
</DropDown> </DropDown>
</div> </div>
</div> </div>
</div>
<ul id="videoList" class="videos"> <ul id="videoList" class="videos">
<li v-for="item in selectedBox.videos" :key="item._id"> <li v-for="item in selectedBox.videos" :key="item._id">
<VideoItem :video="item" /> <VideoItem :video="item" />
@@ -121,6 +113,14 @@ export default {
} }
} }
}, },
playProgress() {
let video = this.selectedBox.videos.find(
(f) => f._id == this.selectedBox.progress.id
);
if (video) {
this.$store.dispatch("videos/play", video);
}
},
gotoNextBox() { gotoNextBox() {
this.$store.dispatch("boxes/gotoNextBox"); this.$store.dispatch("boxes/gotoNextBox");
}, },
@@ -192,6 +192,15 @@ export default {
shareDisable() { shareDisable() {
this.$store.dispatch("boxes/shareDisable", this.selectedBox); this.$store.dispatch("boxes/shareDisable", this.selectedBox);
}, },
loadUserProgress() {
if (this.selectedVideo.parent._id != this.selectedBox._id) {
this.$store
.dispatch("user/getProgress", this.selectedBox)
.then(() => {
this.gotoVideo();
});
}
}
}, },
computed: { computed: {
...mapGetters({ ...mapGetters({
@@ -249,7 +258,7 @@ export default {
this.$refs.dialogWindow.open(); this.$refs.dialogWindow.open();
window.addEventListener("keydown", this.keydownListener); window.addEventListener("keydown", this.keydownListener);
} }
this.gotoVideo(); this.loadUserProgress();
} else { } else {
if (this.$refs.dialogWindow.visible) { if (this.$refs.dialogWindow.visible) {
this.$refs.dialogWindow.close(); this.$refs.dialogWindow.close();
@@ -267,39 +276,36 @@ export default {
<style scoped> <style scoped>
#boxViewer { #boxViewer {
height: 462px; height: 486px;
} }
#header { #header {
position: relative; position: relative;
background-color: black; background-color: black;
} }
#header img { #header img {
align-self: center; align-self: center;
width: 256px; width: 256px;
} }
#stats { #stats {
z-index: 2; z-index: 2;
align-items: center;
color: var(--white); color: var(--white);
text-shadow: 0 1px 2px black; text-shadow: 0 1px 2px black;
line-height: 1.4;
background-color: #ffffff40;
border-top: 1px solid #ffffff20;
border-bottom: 1px solid #00000020;
} }
.dropdown-activator button { .dropdown-activator button {
width: 32px; width: 32px;
height: 32px; height: 32px;
} }
#stats p {
max-width: 192px;
align-self: center;
}
#videoList { #videoList {
background-color: var(--white); background-color: var(--white);
z-index: 1; z-index: 1;
overflow: overlay; overflow: overlay;
} }
.video { .video {
width: 220px; width: 220px;
} }
@@ -308,26 +314,32 @@ export default {
#boxViewer { #boxViewer {
flex-direction: column; flex-direction: column;
} }
#stats p { #stats p {
max-width: initial; max-width: initial;
} }
} }
@media (max-width: 480px), (max-height: 480px) {
@media (max-width: 480px),
(max-height: 480px) {
#boxViewer { #boxViewer {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
#header img { #header img {
width: 192px; width: 192px;
} }
#videoList { #videoList {
height: initial; height: initial;
flex-grow: 1; flex-grow: 1;
} }
.video { .video {
width: initial; width: initial;
} }
} }
@media (max-height: 480px) {
} @media (max-height: 480px) {}
</style> </style>

View File

@@ -118,8 +118,8 @@ export default {
}, },
cover(radio) { cover(radio) {
let res = "/static/icons/dummy/radio.svg"; let res = "/static/icons/dummy/radio.svg";
if (radio.cover32) { if (radio.covers.cover32) {
res = radio.cover32; res = radio.covers.cover32;
} }
return res; return res;
}, },

View File

@@ -1,37 +1,14 @@
<template> <template>
<DialogBase <DialogBase ref="dialogWindow" @closing="closing" :showFooter="false" :showFullscreenButton="true">
ref="dialogWindow"
@closing="closing"
:showFooter="false"
:showFullscreenButton="true"
>
<template v-slot:header-right> <template v-slot:header-right>
<span v-if="selectedVideo.tracks && selectedVideo.tracks.length > 1" <span v-if="selectedVideo.tracks && selectedVideo.tracks.length > 1">Language:</span>
>Language:</span <select v-if="selectedVideo.tracks && selectedVideo.tracks.length > 1" @change="langChanged" v-model="selectedLang">
> <option v-for="(lang, i) in selectedVideo.tracks" :key="i" :value="lang" :title="lang.title">
<select
v-if="selectedVideo.tracks && selectedVideo.tracks.length > 1"
@change="langChanged"
v-model="selectedLang"
>
<option
v-for="(lang, i) in selectedVideo.tracks"
:key="i"
:value="lang"
:title="lang.title"
>
{{ lang.lang.toUpperCase() }} {{ lang.lang.toUpperCase() }}
</option> </option>
</select> </select>
</template> </template>
<video <video @ended="nextVideo" @timeupdate="timeUpdate" @playing="playing" @pause="pause" controls style="height: 100%; width: 100%; background: black" ref="videoControl" src></video>
@ended="nextVideo"
@timeupdate="timeUpdate"
controls
style="height: 100%; width: 100%; background: black"
ref="videoControl"
src
></video>
</DialogBase> </DialogBase>
</template> </template>
<script> <script>
@@ -42,6 +19,7 @@ export default {
languages: [], languages: [],
selectedLang: {}, selectedLang: {},
preConvert: false, preConvert: false,
intervalState: 0,
}; };
}, },
methods: { methods: {
@@ -50,6 +28,30 @@ export default {
this.$store.getters["videos/getStreamUrl"] + this.langIndex; this.$store.getters["videos/getStreamUrl"] + this.langIndex;
this.video.play(); this.video.play();
}, },
pause() {
window.clearInterval(this.intervalState);
},
playing() {
window.clearInterval(this.intervalState);
this.pushState();
this.intervalState = setInterval(() => {
this.pushState();
}, 10000);
},
pushState() {
if (!this.currentUser._id || !this.video || !this.selectedVideo._id) {
return;
}
let item = {
id: this.selectedVideo._id,
parentId: this.selectedVideo.parent._id,
type: "video",
progress: Math.round(this.video.currentTime)
}
this.$store.dispatch("user/saveProgress", item);
},
playVideo(video) { playVideo(video) {
this.$store.commit("radios/resetSelectedRadio"); this.$store.commit("radios/resetSelectedRadio");
this.$store.commit("tracks/resetSelectedTrack"); this.$store.commit("tracks/resetSelectedTrack");
@@ -81,6 +83,13 @@ export default {
this.video.src = this.video.src =
this.$store.getters["videos/getStreamUrl"] + this.langIndex; this.$store.getters["videos/getStreamUrl"] + this.langIndex;
if (this.selectedVideo.parent.progress) {
if (this.selectedVideo.parent.progress.id == this.selectedVideo._id) {
this.skipToSecond(this.selectedVideo.parent.progress.progress);
}
this.selectedVideo.parent.progress = undefined;
}
this.video.play(); this.video.play();
this.pushHistoryItem(); this.pushHistoryItem();
@@ -120,7 +129,22 @@ export default {
}); });
} }
}, },
reset() {
if (this.$refs.dialogWindow.visible) {
this.$refs.dialogWindow.close();
}
},
skipToSecond(second) {
let was_paused = this.video.paused;
this.video.pause();
this.video.currentTime = second;
if (!was_paused) {
this.video.play();
}
},
closing() { closing() {
window.clearInterval(this.intervalState);
this.pushState();
this.video = undefined; this.video = undefined;
this.$store.dispatch("videos/resetSelectedVideo"); this.$store.dispatch("videos/resetSelectedVideo");
}, },
@@ -172,9 +196,7 @@ export default {
if (newVal._id) { if (newVal._id) {
this.playVideo(newVal); this.playVideo(newVal);
} else { } else {
if (this.$refs.dialogWindow.visible) { this.reset();
this.$refs.dialogWindow.close();
}
} }
}, },
}, },

View File

@@ -4,6 +4,7 @@ import App from './App.vue'
import { library } from '@fortawesome/fontawesome-svg-core' import { library } from '@fortawesome/fontawesome-svg-core'
import { fas } from '@fortawesome/free-solid-svg-icons' import { fas } from '@fortawesome/free-solid-svg-icons'
import { far } from '@fortawesome/free-regular-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import DialogBase from "./components/base-components/Dialog"; import DialogBase from "./components/base-components/Dialog";
@@ -15,6 +16,7 @@ import ArtistItem from "./components/Artist"
import BoxItem from "./components/Box" import BoxItem from "./components/Box"
library.add(fas) library.add(fas)
library.add(far)
import store from "./store/index"; import store from "./store/index";
import router from './router' import router from './router'

View File

@@ -32,12 +32,15 @@ export default {
}, },
loadAlbums(context, force) { loadAlbums(context, force) {
return new Promise((resolve) => {
if ((!context.state.eos || force) && !context.state.loading) { if ((!context.state.eos || force) && !context.state.loading) {
context.state.loading = true; context.state.loading = true;
axios.get(context.rootGetters.server + "/api/albums/page/" + context.state.page++, context.rootGetters.headers).then((res) => { axios.get(context.rootGetters.server + "/api/albums/page/" + context.state.page++, context.rootGetters.headers).then((res) => {
context.commit("setAlbums", res.data); context.commit("setAlbums", res.data);
resolve(res.data);
}); });
} }
});
}, },
loadFavourites(context) { loadFavourites(context) {
axios.get(context.rootGetters.server + "/api/albums/favourites", context.rootGetters.headers).then(res => { axios.get(context.rootGetters.server + "/api/albums/favourites", context.rootGetters.headers).then(res => {
@@ -165,7 +168,7 @@ export default {
axios.post(context.rootGetters.server + "/api/albums/" + album._id + "/share", {}, context.rootGetters.headers).then(res => { axios.post(context.rootGetters.server + "/api/albums/" + album._id + "/share", {}, context.rootGetters.headers).then(res => {
album.share = res.data; album.share = res.data;
resolve(); resolve();
context.dispatch("addPoUp", { title: "Share successful", message: "Url was copied into your clipboard", type: "success", icon:"share" }, { root: true }); context.dispatch("addPoUp", { title: "Share successful", message: "Url was copied into your clipboard", type: "success", icon: "share" }, { root: true });
}); });
}); });
}, },
@@ -176,5 +179,10 @@ export default {
resolve(); resolve();
}); });
}); });
},
loadRandomCovers(context, count) {
axios.get(context.rootGetters.server + "/api/albums/random/" + count, context.rootGetters.headers).then((res) => {
context.commit("setRandomCovers", res.data);
});
} }
} }

View File

@@ -32,5 +32,8 @@ export default {
}, },
newest(state) { newest(state) {
return state.newest; return state.newest;
},
randomCovers(state) {
return state.randomCovers;
} }
} }

View File

@@ -76,5 +76,8 @@ export default {
} }
}); });
state.newest = albums; state.newest = albums;
},
setRandomCovers(state, covers) {
state.randomCovers = covers;
} }
} }

View File

@@ -2,6 +2,7 @@ export default {
collection: [], collection: [],
newest: [], newest: [],
selectedAlbum: { tracks: [], covers: {}, share: {} }, selectedAlbum: { tracks: [], covers: {}, share: {} },
randomCovers: [],
page: 1, page: 1,
loading: false, loading: false,
eos: false eos: false

View File

@@ -13,12 +13,15 @@ export default {
}) })
}, },
loadArtists(context, force) { loadArtists(context, force) {
return new Promise((resolve) => {
if ((!context.state.eos || force) && !context.state.loading) { if ((!context.state.eos || force) && !context.state.loading) {
context.state.loading = true; context.state.loading = true;
axios.get(context.rootGetters.server + "/api/artists/page/" + context.state.page++, context.rootGetters.headers).then((res) => { axios.get(context.rootGetters.server + "/api/artists/page/" + context.state.page++, context.rootGetters.headers).then((res) => {
context.commit("setArtists", res.data); context.commit("setArtists", res.data);
resolve(res.data);
}); });
} }
});
}, },
loadArtist(context, id) { loadArtist(context, id) {
context.state.loading = true; context.state.loading = true;

View File

@@ -13,12 +13,15 @@ export default {
}) })
}, },
loadBoxes(context, force) { loadBoxes(context, force) {
return new Promise((resolve) => {
if ((!context.state.eos || force) && !context.state.loading) { if ((!context.state.eos || force) && !context.state.loading) {
context.state.loading = true; context.state.loading = true;
axios.get(context.rootGetters.server + "/api/boxes/page/" + context.state.page++, context.rootGetters.headers).then((res) => { axios.get(context.rootGetters.server + "/api/boxes/page/" + context.state.page++, context.rootGetters.headers).then((res) => {
context.commit("setBoxes", res.data); context.commit("setBoxes", res.data);
resolve(res.data);
}); });
} }
});
}, },
loadFavourites(context) { loadFavourites(context) {
axios.get(context.rootGetters.server + "/api/boxes/favourites", context.rootGetters.headers).then(res => { axios.get(context.rootGetters.server + "/api/boxes/favourites", context.rootGetters.headers).then(res => {

View File

@@ -44,9 +44,7 @@ export default {
let h = context.rootGetters.headers; let h = context.rootGetters.headers;
h.headers["content-type"] = "multipart/form-data"; h.headers["content-type"] = "multipart/form-data";
axios.put(context.rootGetters.server + "/api/radios/" + radio._id + "/cover", formData, h).then((res) => { axios.put(context.rootGetters.server + "/api/radios/" + radio._id + "/cover", formData, h).then((res) => {
radio.cover32 = res.data.cover32; radio.covers = res.data.covers;
radio.cover64 = res.data.cover64;
radio.cover128 = res.data.cover128;
context.dispatch("loadRadios", true); context.dispatch("loadRadios", true);
}); });
} }

View File

@@ -1,4 +1,4 @@
export default { export default {
collection: [], collection: [],
selectedRadio: {}, selectedRadio: { covers: {} },
} }

View File

@@ -88,14 +88,17 @@ export default {
.post(context.rootGetters.server + "/api/user/progress", item, context.rootGetters.headers); .post(context.rootGetters.server + "/api/user/progress", item, context.rootGetters.headers);
}, },
getProgress(context, parent) { getProgress(context, parent) {
return new Promise((resolve) => {
if (context.state._id == -1) { if (context.state._id == -1) {
return; resolve();
} } else {
axios axios
.get(context.rootGetters.server + "/api/user/progress/" + parent._id, context.rootGetters.headers) .get(context.rootGetters.server + "/api/user/progress/" + parent._id, context.rootGetters.headers)
.then((res) => { .then((res) => {
parent.progress = res.data; parent.progress = res.data;
resolve();
});
}
}); });
}, },
resetProgress(context, parentId) { resetProgress(context, parentId) {

View File

@@ -16,6 +16,8 @@ export default {
let currentIndex = video.parent.videos.indexOf(video); let currentIndex = video.parent.videos.indexOf(video);
if (currentIndex < video.parent.videos.length - 1) { if (currentIndex < video.parent.videos.length - 1) {
context.dispatch("play", video.parent.videos[currentIndex + 1]); context.dispatch("play", video.parent.videos[currentIndex + 1]);
} else {
this.dispatch("user/resetProgress", video.parent._id);
} }
}, },
convertNextTo(context, payload) { convertNextTo(context, payload) {

View File

@@ -6,7 +6,7 @@ export default {
if (!state.selectedVideo._id) { if (!state.selectedVideo._id) {
return; return;
} }
state.selectedVideo = { tracks: [] }; state.selectedVideo = { tracks: [], parent: { title: "", covers: {} } };
}, },
setMostViewed(state, tracks) { setMostViewed(state, tracks) {
state.mostViewed = tracks; state.mostViewed = tracks;

View File

@@ -1,4 +1,4 @@
export default { export default {
selectedVideo: { tracks: [] }, selectedVideo: { tracks: [], parent: { title: "", covers: {} } },
mostViewed: [] mostViewed: []
} }

View File

@@ -2,30 +2,21 @@
<div id="welcome" ref="welcome" @scroll="loadNextPage"> <div id="welcome" ref="welcome" @scroll="loadNextPage">
<div id="welcomeLeft" class="flex-column grow"> <div id="welcomeLeft" class="flex-column grow">
<div id="banner" class="center flex-column shadow"> <div id="banner" class="center flex-column shadow">
<h1>WebPlay</h1> <div id="collage">
<p> <svg width="100%" height="100%" viewBox="20 40 600 100">
<b>{{ serverInfo.stats.tracks.toLocaleString("de-DE") }}</b> Tracks <g>
and <animateTransform id="animY1" attributeName="transform" type="translate" begin="0s; animY2.end" from="0 -140" to="-20 -60" dur="30s" />
<b>{{ serverInfo.stats.videos.toLocaleString("de-DE") }}</b> Videos | <animateTransform id="animY2" attributeName="transform" type="translate" begin="animY1.end" from="-20 -60" to="0 -140" dur="30s" />
Users: <image :xlink:href="item.covers.cover64" :x="Math.floor(i / 6) * 64" :y="i % 6 * 64" width="64" height="64" v-for="(item, i) in randomCovers" :key="item" />
<b>{{ serverInfo.stats.users }}</b> </g>
</p> </svg>
</div> </div>
<MessageScreen <div class="flex-column" style="z-index: 1;">
title="First Run?" <h1>WebPlay</h1>
subtitle="You still don't have any Music or Video content on your instance" </div>
icon="sync" </div>
:commands="messageCommands" <MessageScreen title="First Run?" subtitle="You still don't have any Music or Video content on your instance" icon="sync" :commands="messageCommands" @commandClicked="messageCommand" :showCommands="$store.getters['user/isAdministrator']" v-if="serverInfo.stats.tracks == 0 && serverInfo.stats.videos == 0" />
@commandClicked="messageCommand" <MessageScreen v-else-if="mostListened.length == 0 && mostViewed.length == 0" title="Still no history or trends" subtitle="Still no history or trends on this instance" icon="info" />
:showCommands="$store.getters['user/isAdministrator']"
v-if="serverInfo.stats.tracks == 0 && serverInfo.stats.videos == 0"
/>
<MessageScreen
v-else-if="mostListened.length == 0 && mostViewed.length == 0"
title="Still no history or trends"
subtitle="Still no history or trends on this instance"
icon="info"
/>
<template v-else> <template v-else>
<h2 class="ma-left ma-top pa-top ma4-bottom" v-if="history.length > 0"> <h2 class="ma-left ma-top pa-top ma4-bottom" v-if="history.length > 0">
Last played Last played
@@ -33,90 +24,43 @@
<template v-if="history.length > 0"> <template v-if="history.length > 0">
<div id="history" :class="{ more: historyAll == true }"> <div id="history" :class="{ more: historyAll == true }">
<template v-for="item in history"> <template v-for="item in history">
<AlbumItem <AlbumItem class="ma8" v-if="item.type == 'album'" :item="item" :key="item._id" />
class="ma8" <ArtistItem class="ma8" v-if="item.type == 'artist'" :item="item" :key="item._id" />
v-if="item.type == 'album'" <BoxItem class="ma8" v-if="item.type == 'box'" :item="item" :key="item._id" />
:item="item" <RadioItem class="ma8" v-if="item.type == 'radio'" :item="item" :key="item._id" />
:key="item._id"
/>
<ArtistItem
class="ma8"
v-if="item.type == 'artist'"
:item="item"
:key="item._id"
/>
<BoxItem
class="ma8"
v-if="item.type == 'box'"
:item="item"
:key="item._id"
/>
<RadioItem
class="ma8"
v-if="item.type == 'radio'"
:item="item"
:key="item._id"
/>
</template> </template>
</div> </div>
<span class="pa-top pa-right right" @click="toggleHistory"> <span class="pa-top pa-right right" @click="toggleHistory">
<awesome-icon <awesome-icon :icon="historyAll ? 'arrow-up' : 'arrow-down'" class="pa8-right" />{{ historyToggleText }}</span>
:icon="historyAll ? 'arrow-up' : 'arrow-down'"
class="pa8-right"
/>{{ historyToggleText }}</span
>
</template> </template>
<div id="mostUsed" class="flex-row ma"> <div id="mostUsed" class="flex-row ma">
<div id="mostListened" class="grow" v-if="mostListened.length > 0"> <div id="mostListened" class="grow" v-if="mostListened.length > 0">
<h2 class="ma-top pa-top ma4-bottom">Most listened</h2> <h2 class="ma-top pa-top ma4-bottom">Most listened</h2>
<div class="flex-column"> <div class="flex-column">
<TrackItem <TrackItem v-for="(item, i) in mostListened" :track="item" :key="i" />
v-for="(item, i) in mostListened"
:track="item"
:key="i"
/>
</div> </div>
</div> </div>
<div id="mostViewed" class="grow" v-if="mostViewed.length > 0"> <div id="mostViewed" class="grow" v-if="mostViewed.length > 0">
<h2 class="ma-top pa-top ma4-bottom">Most viewed</h2> <h2 class="ma-top pa-top ma4-bottom">Most viewed</h2>
<div id="mostViewedVideos" class="flex-row"> <div id="mostViewedVideos" class="flex-row">
<VideoItem <VideoItem v-for="(item, i) in mostViewed" :video="item" :key="i" />
v-for="(item, i) in mostViewed"
:video="item"
:key="i"
/>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
</div> </div>
<div <div v-if="newestAlbums.length > 0 || newestBoxes.length > 0" id="newest" class="pa-left pa-right">
v-if="newestAlbums.length > 0 || newestBoxes.length > 0"
id="newest"
class="pa-left pa-right"
>
<template v-if="newestAlbums.length > 0"> <template v-if="newestAlbums.length > 0">
<h3>Newest Music</h3> <h3>Newest Music</h3>
<div id="newestMusic" class="flex-column pa-bottom"> <div id="newestMusic" class="flex-column pa-bottom">
<AlbumItem <AlbumItem class="ma8" v-for="item in newestAlbums" type="line" :item="item" :key="item._id" />
class="ma8"
v-for="item in newestAlbums"
type="line"
:item="item"
:key="item._id"
/>
</div> </div>
</template> </template>
<template v-if="newestBoxes.length > 0"> <template v-if="newestBoxes.length > 0">
<h3>Newest Videos</h3> <h3>Newest Videos</h3>
<div id="newestVideos" class="flex-row"> <div id="newestVideos" class="flex-row">
<BoxItem <BoxItem class="ma8 small" v-for="item in newestBoxes" :item="item" :key="item._id" />
class="ma8 small"
v-for="item in newestBoxes"
:item="item"
:key="item._id"
/>
</div> </div>
</template> </template>
</div> </div>
@@ -137,13 +81,13 @@ export default {
messageCommands: [ messageCommands: [
{ {
title: "Scan for Music files", title: "Scan for Music files",
subtitle: "Scann your server for music files…", subtitle: "Scan your server for music files…",
icon: "music", icon: "music",
command: "scanMusic", command: "scanMusic",
}, },
{ {
title: "Scan for Video files", title: "Scan for Video files",
subtitle: "Scann your server for video files…", subtitle: "Scan your server for video files…",
icon: "video", icon: "video",
command: "scanVideos", command: "scanVideos",
}, },
@@ -160,6 +104,14 @@ export default {
this.$store.dispatch("boxes/loadNewest"); this.$store.dispatch("boxes/loadNewest");
this.$store.dispatch("tracks/loadMostListened"); this.$store.dispatch("tracks/loadMostListened");
this.$store.dispatch("videos/loadMostViewed"); this.$store.dispatch("videos/loadMostViewed");
if (this.randomCovers.length == 0) {
this.$store.dispatch("albums/loadRandomCovers", 60);
this.$store.dispatch("albums/loadAlbums", true).then(() => {
this.$store.dispatch("artists/loadArtists", true).then(() => {
this.$store.dispatch("boxes/loadBoxes", true);
});
});
}
}, },
loadNextPage() { loadNextPage() {
this.scrollPosition = this.$refs.welcome.scrollTop; this.scrollPosition = this.$refs.welcome.scrollTop;
@@ -194,6 +146,7 @@ export default {
serverInfo: "serverInfo", serverInfo: "serverInfo",
mostListened: "tracks/mostListened", mostListened: "tracks/mostListened",
mostViewed: "videos/mostViewed", mostViewed: "videos/mostViewed",
randomCovers: ["albums/randomCovers"],
}), }),
historyToggleText() { historyToggleText() {
return this.historyAll ? "less..." : "more..."; return this.historyAll ? "less..." : "more...";
@@ -221,4 +174,17 @@ export default {
#history.more { #history.more {
max-height: initial; max-height: initial;
} }
#banner {
position: relative;
}
#collage {
bottom: 0;
top: 0;
left: 0;
right: 0;
opacity: 0.2;
position: absolute;
}
</style> </style>