-
+
mdi-skip-previous
@@ -73,10 +73,10 @@
-
- mdi-repeat
- mdi-repeat
- mdi-repeat-once
+
+ mdi-repeat
+ mdi-repeat
+ mdi-repeat-once
mdi-shuffle
@@ -261,10 +261,10 @@ export default {
data() {
return {
//Position used in seconds, because of CPU usage
- position: this.$root.position / 1000,
+ position: this.$root.position() / 1000,
seeking: false,
tab: null,
- inLibrary: this.$root.track.library ? true:false,
+ inLibrary: this.$root.track.library ? true : false,
playlistPopup: false,
downloadDialog: false,
//For reloading queue
@@ -313,14 +313,6 @@ export default {
updateVolume(v) {
this.$root.volume = v;
},
- //Repeat button click
- repeatClick() {
- if (this.$root.repeat == 2) {
- this.$root.repeat = 0;
- return;
- }
- this.$root.repeat += 1;
- },
//Copy link
share() {
let copyElem = document.createElement('input');
@@ -368,10 +360,8 @@ export default {
'$root.track'() {
this.inLibrary = this.$root.libraryTracks.includes(this.$root.track.id);
},
- '$root.position'() {
- if (!this.seeking) {
- this.position = this.$root.position / 1000;
- }
+ '$root.positionVal'() {
+ this.position = this.$root.position() / 1000;
},
//Force update queue
'$root.shuffled'() {
diff --git a/app/client/src/views/Library.vue b/app/client/src/views/Library.vue
index a5dc267..9dda0d5 100644
--- a/app/client/src/views/Library.vue
+++ b/app/client/src/views/Library.vue
@@ -88,8 +88,8 @@ export default {
source: 'playlist',
data: 0
};
- this.$root.replaceQueue(res.data);
- this.$root.playIndex(0);
+ await this.$root.replaceQueue(res.data);
+ await this.$root.playIndex(0);
}
}
},
diff --git a/app/client/src/views/PlaylistPage.vue b/app/client/src/views/PlaylistPage.vue
index f211033..4762521 100644
--- a/app/client/src/views/PlaylistPage.vue
+++ b/app/client/src/views/PlaylistPage.vue
@@ -159,13 +159,13 @@ export default {
source: 'playlist',
data: this.playlist.id
};
- this.$root.replaceQueue(this.playlist.tracks);
- this.$root.playIndex(index);
+ await this.$root.replaceQueue(this.playlist.tracks);
+ await this.$root.playIndex(index);
//Load rest of tracks on background
if (this.playlist.tracks.length < this.playlist.trackCount) {
- this.loadAllTracks().then(() => {
- this.$root.replaceQueue(this.playlist.tracks);
+ this.loadAllTracks().then(async () => {
+ await this.$root.replaceQueue(this.playlist.tracks);
});
}
},
diff --git a/app/client/src/views/Search.vue b/app/client/src/views/Search.vue
index ecc67c3..e7579bc 100644
--- a/app/client/src/views/Search.vue
+++ b/app/client/src/views/Search.vue
@@ -128,14 +128,14 @@ export default {
});
},
//On click for track tile
- playTrack(i) {
+ async playTrack(i) {
this.$root.queue.source = {
text: this.$t("Search"),
source: "search",
data: this.query
};
- this.$root.replaceQueue(this.data.tracks);
- this.$root.playIndex(i);
+ await this.$root.replaceQueue(this.data.tracks);
+ await this.$root.playIndex(i);
}
},
watch: {
diff --git a/app/src/integrations.js b/app/src/integrations.js
index 5276176..93c1da4 100644
--- a/app/src/integrations.js
+++ b/app/src/integrations.js
@@ -104,7 +104,7 @@ class Integrations extends EventEmitter {
//Called when playback state changed
async updateState(data) {
if (this.discordReady) {
- if (data.state == 2){
+ if (data.playing){
let richPresence = {
state: data.track.artistString,
details: data.track.title,
@@ -112,7 +112,7 @@ class Integrations extends EventEmitter {
instance: true,
}
//Show timestamp only if playing
- if (data.state == 2) {
+ if (data.playing) {
Object.assign(richPresence, {
startTimestamp: Date.now() - data.position,
endTimestamp: (Date.now() - data.position) + data.duration,