-
{{ bookmarks.length ? 'bookmark' : 'bookmark_border' }}
+
{{ bookmarks.length ? 'bookmark' : 'bookmark_border' }}
bookmark
@@ -126,7 +126,8 @@ export default {
default: () => []
},
sleepTimerRunning: Boolean,
- sleepTimeRemaining: Number
+ sleepTimeRemaining: Number,
+ isServerItem: Boolean
},
data() {
return {
@@ -324,6 +325,9 @@ export default {
} else {
return secondsRemaining + 's'
}
+ },
+ networkConnected() {
+ return this.$store.state.networkConnected
}
},
methods: {
diff --git a/components/app/AudioPlayerContainer.vue b/components/app/AudioPlayerContainer.vue
index 5a9cdce3..c96ab6b8 100644
--- a/components/app/AudioPlayerContainer.vue
+++ b/components/app/AudioPlayerContainer.vue
@@ -1,6 +1,6 @@
-
(currentTime = t)" @showSleepTimer="showSleepTimer" @showBookmarks="showBookmarks" />
+ (currentTime = t)" @showSleepTimer="showSleepTimer" @showBookmarks="showBookmarks" />
@@ -38,21 +38,10 @@ export default {
serverEpisodeId: null
}
},
- watch: {
- socketConnected(newVal) {
- if (newVal) {
- console.log('Socket Connected set listeners')
- this.setListeners()
- }
- }
- },
computed: {
bookmarks() {
if (!this.serverLibraryItemId) return []
return this.$store.getters['user/getUserBookmarksForItem'](this.serverLibraryItemId)
- },
- socketConnected() {
- return this.$store.state.socketConnected
}
},
methods: {
@@ -62,7 +51,7 @@ export default {
selectBookmark(bookmark) {
this.showBookmarksModal = false
if (!bookmark || isNaN(bookmark.time)) return
- var bookmarkTime = Number(bookmark.time)
+ const bookmarkTime = Number(bookmark.time)
if (this.$refs.audioPlayer) {
this.$refs.audioPlayer.seek(bookmarkTime)
}
@@ -71,8 +60,6 @@ export default {
this.isSleepTimerRunning = false
if (currentPosition) {
console.log('Sleep Timer Ended Current Position: ' + currentPosition)
- var currentTime = Math.floor(currentPosition / 1000)
- // TODO: Was syncing to the server here before
}
},
onSleepTimerSet({ value: sleepTimeRemaining }) {
@@ -160,17 +147,6 @@ export default {
this.notifyOnReady()
}
},
- setListeners() {
- // if (!this.$server.socket) {
- // console.error('Invalid server socket not set')
- // return
- // }
- // this.$server.socket.on('stream_open', this.streamOpen)
- // this.$server.socket.on('stream_closed', this.streamClosed)
- // this.$server.socket.on('stream_progress', this.streamProgress)
- // this.$server.socket.on('stream_ready', this.streamReady)
- // this.$server.socket.on('stream_reset', this.streamReset)
- },
closeStreamOnly() {
// If user logs out or disconnects from server and not playing local
if (this.$refs.audioPlayer && !this.$refs.audioPlayer.isLocalPlayMethod) {
@@ -206,13 +182,13 @@ export default {
})
},
async playLibraryItem(payload) {
- var libraryItemId = payload.libraryItemId
- var episodeId = payload.episodeId
+ const libraryItemId = payload.libraryItemId
+ const episodeId = payload.episodeId
// When playing local library item and can also play this item from the server
// then store the server library item id so it can be used if a cast is made
- var serverLibraryItemId = payload.serverLibraryItemId || null
- var serverEpisodeId = payload.serverEpisodeId || null
+ const serverLibraryItemId = payload.serverLibraryItemId || null
+ const serverEpisodeId = payload.serverEpisodeId || null
if (libraryItemId.startsWith('local') && this.$store.state.isCasting) {
const { value } = await Dialog.confirm({
@@ -227,7 +203,7 @@ export default {
this.serverLibraryItemId = null
this.serverEpisodeId = null
- var playbackRate = 1
+ let playbackRate = 1
if (this.$refs.audioPlayer) {
playbackRate = this.$refs.audioPlayer.currentPlaybackRate || 1
}
@@ -278,7 +254,7 @@ export default {
notifyOnReady() {
// If settings aren't loaded yet, native player will receive incorrect settings
console.log('Notify on ready... settingsLoaded:', this.settingsLoaded, 'isReady:', this.isReady)
- if ( this.settingsLoaded && this.isReady ) {
+ if (this.settingsLoaded && this.isReady) {
AbsAudioPlayer.onReady()
}
}
@@ -292,7 +268,6 @@ export default {
this.playbackSpeed = this.$store.getters['user/getUserSetting']('playbackRate')
console.log(`[AudioPlayerContainer] Init Playback Speed: ${this.playbackSpeed}`)
- this.setListeners()
this.$eventBus.$on('abs-ui-ready', this.onReady)
this.$eventBus.$on('play-item', this.playLibraryItem)
this.$eventBus.$on('pause-item', this.pauseItem)
@@ -306,13 +281,6 @@ export default {
if (this.onSleepTimerSetListener) this.onSleepTimerSetListener.remove()
if (this.onMediaPlayerChangedListener) this.onMediaPlayerChangedListener.remove()
- // if (this.$server.socket) {
- // this.$server.socket.off('stream_open', this.streamOpen)
- // this.$server.socket.off('stream_closed', this.streamClosed)
- // this.$server.socket.off('stream_progress', this.streamProgress)
- // this.$server.socket.off('stream_ready', this.streamReady)
- // this.$server.socket.off('stream_reset', this.streamReset)
- // }
this.$eventBus.$off('abs-ui-ready', this.onReady)
this.$eventBus.$off('play-item', this.playLibraryItem)
this.$eventBus.$off('pause-item', this.pauseItem)