Skip to content

Commit

Permalink
Fix MAL check
Browse files Browse the repository at this point in the history
  • Loading branch information
remixz committed Apr 17, 2017
1 parent 3a3f4b0 commit 5fda000
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pages/Media.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,14 @@
},
playerPlay () {
this.internalSeek = 0
if (this.malItem.id && process.env.NODE_ENV === 'production') {
const shouldUpdateMal = (
this.isMalAuthed &&
this.malItem.id &&
this.timeout === 0 &&
!this.malSynced &&
process.env.NODE_ENV === 'production'
)
if (shouldUpdateMal) {
this.timeout = setTimeout(async () => {
try {
const episode = this.collectionMedia.indexOf(this.media.media_id.toString()) + 1
Expand Down Expand Up @@ -187,6 +194,7 @@
this.nextEpisode = false
this.malSynced = false
clearTimeout(this.timeout)
this.timeout = 0
this.getMediaInfo()
if (this.room !== '') {
this.$socket.emit('change', this.$route.path)
Expand Down Expand Up @@ -214,6 +222,7 @@
},
beforeDestroy () {
clearTimeout(this.timeout)
this.timeout = 0
this.$store.commit('UPDATE_LIGHTS', false)
}
}
Expand Down

0 comments on commit 5fda000

Please sign in to comment.