Compare commits

..

16 Commits

Author SHA1 Message Date
Artem Anufrij
25be34d9c7 wip
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-04 11:20:39 +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
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
18 changed files with 212 additions and 179 deletions

View File

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

View File

@@ -1,6 +1,6 @@
<template>
<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 class="flex-row grow">
<img class="cover pointer" :src="cover" :title="selectedTrack.parent.title" @click="gotoContainer" />
@@ -9,6 +9,9 @@
from
<b>{{ selectedTrack.parent.title }}</b>
</div>
<div v-if="selectedRadio._id" class="flex-column">
<b>{{ selectedRadio.name }}</b>
</div>
</div>
<div id="playerControls" class="flex-row center">
<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'" />
</button>
</div>
<div class="flex-row ma-right hideOnMobilePortrait grow right" v-show="selectedTrack.title">
{{ formatedP }}&nbsp;|&nbsp;{{ formatedD }}
<div class="flex-row ma-right hideOnMobilePortrait grow right">
<span v-show="selectedTrack.title">{{ formatedP }}&nbsp;|&nbsp;{{ formatedD }}</span>
</div>
</div>
<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 = {
id: this.selectedRadio._id,
cover128: this.selectedRadio.cover128,
covers: { cover128: this.selectedRadio.covers.cover128 },
name: this.selectedRadio.name,
type: "radio",
};
@@ -153,7 +156,6 @@ export default {
}
// Try to fix SAFARI
this.audio.play();
},
pushHistoryItem() {
if (!this.currentUser._id) {
@@ -312,8 +314,8 @@ export default {
if (this.selectedRadio) {
let res = "/static/icons/dummy/radio.svg";
if (this.selectedRadio.cover64) {
res = this.selectedRadio.cover64;
if (this.selectedRadio.covers.cover64) {
res = this.selectedRadio.covers.cover64;
}
return res;
}

View File

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

View File

@@ -1,26 +1,14 @@
<template>
<DialogBase
ref="dialogWindow"
:title="selectedBox.title"
@canceled="closed"
:showFooter="false"
:closeOnEscape="selectedVideo._id == null"
:disableXscroll="true"
:disableYscroll="true"
>
<DialogBase 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="header" class="flex-column">
<div id="background" :style="coverBackground" />
<div class="grow z1 center flex-column">
<img class="glow ma24" :src="cover" @dblclick="dblclick" />
</div>
<awesome-icon
icon="star"
size="2x"
class="favourite ma4 z2"
:class="{ active: isFavourite }"
@click="toggleFavourite"
/>
<awesome-icon icon="star" size="2x" class="favourite ma4 z2" :class="{ active: isFavourite }" @click="toggleFavourite" />
<awesome-icon icon="play" size="2x" class="keepPlaying ma4 primary-text" @click="playProgress" v-if="selectedBox.progress" title="Keep playing" />
<div id="stats" class="flex-row z1">
<DropDown v-if="$store.getters['user/isAdministrator']">
<button class="flat center" :title="visibility_text">
@@ -28,11 +16,7 @@
</button>
<template v-slot:dropdown-content>
<div>
<button
v-for="(item, i) in $store.state.system.lists.visibility"
:key="i"
@click="setVisibility(item)"
>
<button v-for="(item, i) in $store.state.system.lists.visibility" :key="i" @click="setVisibility(item)">
<awesome-icon :icon="getVisibilityIcon(item)" />{{
getVisibilityText(item)
}}
@@ -41,10 +25,7 @@
<button v-if="!selectedBox.share._id" @click="shareEnable">
<awesome-icon icon="share" />Share this box
</button>
<button
v-if="selectedBox.share._id"
@click="addShareUrlToClipboard"
>
<button v-if="selectedBox.share._id" @click="addShareUrlToClipboard">
<awesome-icon icon="clipboard" />Copy url into clipboard
</button>
<button v-if="selectedBox.share._id" @click="shareDisable">
@@ -121,6 +102,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() {
this.$store.dispatch("boxes/gotoNextBox");
},
@@ -167,19 +156,19 @@ export default {
return visibility == "global"
? "globe"
: visibility == "instance"
? "server"
: visibility == "hidden"
? "eye-slash"
: "user";
? "server"
: visibility == "hidden"
? "eye-slash"
: "user";
},
getVisibilityText(visibility) {
return visibility == "global"
? "Global"
: visibility == "instance"
? "On this server"
: visibility == "hidden"
? "Hide this Box"
: "Only for me";
? "On this server"
: visibility == "hidden"
? "Hide this Box"
: "Only for me";
},
resetCover() {
this.$store.dispatch("boxes/resetCover", this.selectedBox);
@@ -192,6 +181,15 @@ export default {
shareDisable() {
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: {
...mapGetters({
@@ -227,19 +225,19 @@ export default {
return this.selectedBox.visibility == "global"
? "globe"
: this.selectedBox.visibility == "instance"
? "server"
: this.selectedBox.visibility == "hidden"
? "eye-slash"
: "user";
? "server"
: this.selectedBox.visibility == "hidden"
? "eye-slash"
: "user";
},
visibility_text() {
return this.selectedBox.visibility == "global"
? "Visible for the whole world"
: this.selectedBox.visibility == "instance"
? "Visible on this instance"
: this.selectedBox.visibility == "hidden"
? "Hidden for all users"
: "Visible only for me";
? "Visible on this instance"
: this.selectedBox.visibility == "hidden"
? "Hidden for all users"
: "Visible only for me";
},
},
watch: {
@@ -249,7 +247,7 @@ export default {
this.$refs.dialogWindow.open();
window.addEventListener("keydown", this.keydownListener);
}
this.gotoVideo();
this.loadUserProgress();
} else {
if (this.$refs.dialogWindow.visible) {
this.$refs.dialogWindow.close();
@@ -269,14 +267,17 @@ export default {
#boxViewer {
height: 462px;
}
#header {
position: relative;
background-color: black;
}
#header img {
align-self: center;
width: 256px;
}
#stats {
z-index: 2;
align-items: center;
@@ -287,19 +288,23 @@ export default {
border-top: 1px solid #ffffff20;
border-bottom: 1px solid #00000020;
}
.dropdown-activator button {
width: 32px;
height: 32px;
}
#stats p {
max-width: 192px;
align-self: center;
}
#videoList {
background-color: var(--white);
z-index: 1;
overflow: overlay;
}
.video {
width: 220px;
}
@@ -308,26 +313,32 @@ export default {
#boxViewer {
flex-direction: column;
}
#stats p {
max-width: initial;
}
}
@media (max-width: 480px), (max-height: 480px) {
@media (max-width: 480px),
(max-height: 480px) {
#boxViewer {
width: 100%;
height: 100%;
}
#header img {
width: 192px;
}
#videoList {
height: initial;
flex-grow: 1;
}
.video {
width: initial;
}
}
@media (max-height: 480px) {
}
@media (max-height: 480px) {}
</style>

View File

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

View File

@@ -1,37 +1,14 @@
<template>
<DialogBase
ref="dialogWindow"
@closing="closing"
:showFooter="false"
:showFullscreenButton="true"
>
<DialogBase ref="dialogWindow" @closing="closing" :showFooter="false" :showFullscreenButton="true">
<template v-slot:header-right>
<span v-if="selectedVideo.tracks && selectedVideo.tracks.length > 1"
>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"
>
<span v-if="selectedVideo.tracks && selectedVideo.tracks.length > 1">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">
{{ lang.lang.toUpperCase() }}
</option>
</select>
</template>
<video
@ended="nextVideo"
@timeupdate="timeUpdate"
controls
style="height: 100%; width: 100%; background: black"
ref="videoControl"
src
></video>
<video @ended="nextVideo" @timeupdate="timeUpdate" @playing="playing" @pause="pause" controls style="height: 100%; width: 100%; background: black" ref="videoControl" src></video>
</DialogBase>
</template>
<script>
@@ -42,6 +19,7 @@ export default {
languages: [],
selectedLang: {},
preConvert: false,
intervalState: 0,
};
},
methods: {
@@ -50,6 +28,30 @@ export default {
this.$store.getters["videos/getStreamUrl"] + this.langIndex;
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) {
this.$store.commit("radios/resetSelectedRadio");
this.$store.commit("tracks/resetSelectedTrack");
@@ -81,6 +83,13 @@ export default {
this.video.src =
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.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() {
window.clearInterval(this.intervalState);
this.pushState();
this.video = undefined;
this.$store.dispatch("videos/resetSelectedVideo");
},
@@ -172,9 +196,7 @@ export default {
if (newVal._id) {
this.playVideo(newVal);
} else {
if (this.$refs.dialogWindow.visible) {
this.$refs.dialogWindow.close();
}
this.reset();
}
},
},

View File

@@ -3,13 +3,19 @@ import axios from 'axios'
export default {
checkIfInstanceIsNew(context) {
return new Promise((resolve) => {
axios.get(context.rootGetters.server + "/api/system/setup").then((res) => {
if (res.status == 200) {
resolve(true);
} else {
resolve(false);
}
});
axios
.get(context.rootGetters.server + "/api/system/setup")
.then((res) => {
console.log(res.status);
if (res.status == 200) {
resolve(true);
} else {
resolve(false);
}
})
.catch(err => {
console.log(err);
});
});
},
loadClientConfigs(context) {

View File

@@ -176,5 +176,10 @@ export default {
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) {
return state.newest;
},
randomCovers(state) {
return state.randomCovers;
}
}

View File

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

View File

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

View File

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

View File

@@ -10,11 +10,13 @@ export default {
load(context) {
return new Promise((resolve, reject) => {
axios.get(context.rootGetters.server + "/api/user/login", context.rootGetters.headers).then((res) => {
console.log(res.data);
context.commit("load", res.data);
context.rootState["player"].shuffle = res.data.player.shuffle;
context.rootState["player"].repeatType = res.data.player.repeat;
resolve();
}).catch(err => {
console.log("error")
context.commit("resetToken");
reject(err);
});

View File

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

View File

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

View File

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

View File

@@ -2,30 +2,29 @@
<div id="welcome" ref="welcome" @scroll="loadNextPage">
<div id="welcomeLeft" class="flex-column grow">
<div id="banner" class="center flex-column shadow">
<h1>WebPlay</h1>
<p>
<b>{{ serverInfo.stats.tracks.toLocaleString("de-DE") }}</b> Tracks
and
<b>{{ serverInfo.stats.videos.toLocaleString("de-DE") }}</b> Videos |
Users:
<b>{{ serverInfo.stats.users }}</b>
</p>
<div id="collage">
<svg width="100%" height="100%" viewBox="20 40 600 100">
<g>
<animateTransform id="animY1" attributeName="transform" type="translate" begin="0s; animY2.end" from="0 -140" to="-20 -60" dur="30s" />
<animateTransform id="animY2" attributeName="transform" type="translate" begin="animY1.end" from="-20 -60" to="0 -140" dur="30s" />
<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" />
</g>
</svg>
</div>
<div class="flex-column" style="z-index: 1;">
<h1>WebPlay</h1>
<p>
<b>{{ serverInfo.stats.tracks.toLocaleString("de-DE") }}</b> Tracks
and
<b>{{ serverInfo.stats.videos.toLocaleString("de-DE") }}</b> Videos |
Users:
<b>{{ serverInfo.stats.users }}</b>
</p>
</div>
</div>
<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"
/>
<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"
/>
<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" />
<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>
<h2 class="ma-left ma-top pa-top ma4-bottom" v-if="history.length > 0">
Last played
@@ -33,90 +32,43 @@
<template v-if="history.length > 0">
<div id="history" :class="{ more: historyAll == true }">
<template v-for="item in history">
<AlbumItem
class="ma8"
v-if="item.type == 'album'"
:item="item"
: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"
/>
<AlbumItem class="ma8" v-if="item.type == 'album'" :item="item" :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>
</div>
<span class="pa-top pa-right right" @click="toggleHistory">
<awesome-icon
:icon="historyAll ? 'arrow-up' : 'arrow-down'"
class="pa8-right"
/>{{ historyToggleText }}</span
>
<awesome-icon :icon="historyAll ? 'arrow-up' : 'arrow-down'" class="pa8-right" />{{ historyToggleText }}</span>
</template>
<div id="mostUsed" class="flex-row ma">
<div id="mostListened" class="grow" v-if="mostListened.length > 0">
<h2 class="ma-top pa-top ma4-bottom">Most listened</h2>
<div class="flex-column">
<TrackItem
v-for="(item, i) in mostListened"
:track="item"
:key="i"
/>
<TrackItem v-for="(item, i) in mostListened" :track="item" :key="i" />
</div>
</div>
<div id="mostViewed" class="grow" v-if="mostViewed.length > 0">
<h2 class="ma-top pa-top ma4-bottom">Most viewed</h2>
<div id="mostViewedVideos" class="flex-row">
<VideoItem
v-for="(item, i) in mostViewed"
:video="item"
:key="i"
/>
<VideoItem v-for="(item, i) in mostViewed" :video="item" :key="i" />
</div>
</div>
</div>
</template>
</div>
<div
v-if="newestAlbums.length > 0 || newestBoxes.length > 0"
id="newest"
class="pa-left pa-right"
>
<div v-if="newestAlbums.length > 0 || newestBoxes.length > 0" id="newest" class="pa-left pa-right">
<template v-if="newestAlbums.length > 0">
<h3>Newest Music</h3>
<div id="newestMusic" class="flex-column pa-bottom">
<AlbumItem
class="ma8"
v-for="item in newestAlbums"
type="line"
:item="item"
:key="item._id"
/>
<AlbumItem class="ma8" v-for="item in newestAlbums" type="line" :item="item" :key="item._id" />
</div>
</template>
<template v-if="newestBoxes.length > 0">
<h3>Newest Videos</h3>
<div id="newestVideos" class="flex-row">
<BoxItem
class="ma8 small"
v-for="item in newestBoxes"
:item="item"
:key="item._id"
/>
<BoxItem class="ma8 small" v-for="item in newestBoxes" :item="item" :key="item._id" />
</div>
</template>
</div>
@@ -160,6 +112,11 @@ export default {
this.$store.dispatch("boxes/loadNewest");
this.$store.dispatch("tracks/loadMostListened");
this.$store.dispatch("videos/loadMostViewed");
if (this.randomCovers.length == 0) {
this.$store.dispatch("albums/loadRandomCovers", 60);
this.$store.dispatch("albums/loadAlbums", true);
this.$store.dispatch("artists/loadArtists", true);
}
},
loadNextPage() {
this.scrollPosition = this.$refs.welcome.scrollTop;
@@ -194,6 +151,7 @@ export default {
serverInfo: "serverInfo",
mostListened: "tracks/mostListened",
mostViewed: "videos/mostViewed",
randomCovers: ["albums/randomCovers"],
}),
historyToggleText() {
return this.historyAll ? "less..." : "more...";
@@ -221,4 +179,17 @@ export default {
#history.more {
max-height: initial;
}
#banner {
position: relative;
}
#collage {
bottom: 0;
top: 0;
left: 0;
right: 0;
opacity: 0.2;
position: absolute;
}
</style>

View File

@@ -123,13 +123,17 @@ export default {
checkTocken() {
let token = localStorage.getItem("token");
if (token) {
console.log("hello token")
this.$store.dispatch("user/setToken", token);
console.log("hello token; user/load")
this.$store
.dispatch("user/load")
.then(() => {
console.log("user loaded")
this.goto();
})
.catch((err) => {
console.log("user not loaded")
console.log(err);
this.checkIfNewBackend();
});
@@ -157,6 +161,7 @@ export default {
});
},
checkIfNewBackend() {
console.log("check new instance")
this.$store.dispatch("checkIfInstanceIsNew").then((res) => {
if (res) {
this.$router.replace("setup");