finisch sharing functionality
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Artem Anufrij
2023-02-16 23:59:01 +01:00
parent efef863e66
commit 4d4fb4b4e9
13 changed files with 567 additions and 110 deletions

View File

@@ -181,6 +181,13 @@ export default {
this.audio.pause();
this.audio.src = url;
this.pushHistoryItem();
},
pushHistoryItem() {
if (!this.currentUser._id) {
return;
}
let item = {
id: this.currentTrackParent._id,
type: this.currentTrackParentType,
@@ -258,15 +265,17 @@ export default {
}
},
gotoContainer() {
switch (this.selectedTrack.parentType) {
case "album":
this.$router.push("/albums?id=" + this.selectedTrack.parent._id);
break;
case "artist":
this.$router.push(
"/artists?id=" + this.selectedTrack.parent.parent._id
);
break;
if (this.currentUser._id) {
switch (this.selectedTrack.parentType) {
case "album":
this.$router.push("/albums?id=" + this.selectedTrack.parent._id);
break;
case "artist":
this.$router.push(
"/artists?id=" + this.selectedTrack.parent.parent._id
);
break;
}
}
},
switchShuffle() {
@@ -275,9 +284,15 @@ export default {
},
switchRepeatType() {
this.$store.dispatch("player/switchPlayerRepeatMode");
if (!this.currentUser._id) {
return;
}
this.saveUserSettings();
},
saveUserSettings() {
if (!this.currentUser._id) {
return;
}
this.$store.dispatch("user/savePlayerSettings");
},
timeUpdate(event) {
@@ -314,6 +329,9 @@ export default {
}
return type;
},
currentUser() {
return this.$store.getters["user/user"];
},
formatedD() {
let m = Math.floor(this.duration / 60);
let s = Math.floor(this.duration - m * 60);