diff --git a/components/cards/LazyBookCard.vue b/components/cards/LazyBookCard.vue index e27452c8..b1d10c4b 100644 --- a/components/cards/LazyBookCard.vue +++ b/components/cards/LazyBookCard.vue @@ -63,7 +63,7 @@
- {{ isLocalOnly ? 'task' : 'download_done' }} + {{ 'download_done' }}
@@ -153,10 +153,6 @@ export default { isLocal() { return !!this._libraryItem.isLocal }, - isLocalOnly() { - // Local item with no server match - return this.isLocal && !this._libraryItem.libraryItemId - }, media() { return this._libraryItem.media || {} }, diff --git a/components/cards/LazyListBookCard.vue b/components/cards/LazyListBookCard.vue index aa38dbb0..fd670910 100644 --- a/components/cards/LazyListBookCard.vue +++ b/components/cards/LazyListBookCard.vue @@ -31,7 +31,7 @@
- {{ isLocalOnly ? 'task' : 'download_done' }} + {{ 'download_done' }}
@@ -93,10 +93,6 @@ export default { isLocal() { return !!this._libraryItem.isLocal }, - isLocalOnly() { - // Local item with no server match - return this.isLocal && !this._libraryItem.libraryItemId - }, media() { return this._libraryItem.media || {} }, @@ -363,4 +359,4 @@ export default { min-width: var(--list-card-cover-width); max-width: var(--list-card-cover-width); } - \ No newline at end of file + diff --git a/pages/item/_id/index.vue b/pages/item/_id/index.vue index 51c0a7a0..b6d76e10 100644 --- a/pages/item/_id/index.vue +++ b/pages/item/_id/index.vue @@ -36,10 +36,7 @@
-
-

{{ $strings.MessageMediaNotLinkedToServer }}

-
-
+

{{ $getString('MessageMediaLinkedToADifferentServer', [localLibraryItem.serverAddress]) }}

@@ -240,10 +237,6 @@ export default { isLocal() { return this.libraryItem.isLocal }, - isLocalOnly() { - // TODO: Remove the possibility to have local only on android - return this.isLocal && !this.libraryItem.libraryItemId - }, hasLocal() { // Server library item has matching local library item return this.isLocal || this.libraryItem.localLibraryItem @@ -282,21 +275,21 @@ export default { * User is currently connected to a server and this local library item has the same server address */ isLocalMatchingServerAddress() { - if (this.isLocalOnly || !this.localLibraryItem || !this.currentServerAddress) return false + if (!this.localLibraryItem || !this.currentServerAddress) return false return this.localLibraryItem.serverAddress === this.currentServerAddress }, /** * User is currently connected to a server and this local library item has the same user id */ isLocalMatchingUser() { - if (this.isLocalOnly || !this.localLibraryItem || !this.user) return false + if (!this.localLibraryItem || !this.user) return false return this.localLibraryItem.serverUserId === this.user.id || this.localLibraryItem.serverUserId === this.user.oldUserId }, /** * User is currently connected to a server and this local library item has the same connection config id */ isLocalMatchingConnectionConfig() { - if (this.isLocalOnly || !this.localLibraryItemServerConnectionConfigId || !this.currentServerConnectionConfigId) return false + if (!this.localLibraryItemServerConnectionConfigId || !this.currentServerConnectionConfigId) return false return this.localLibraryItemServerConnectionConfigId === this.currentServerConnectionConfigId }, bookCoverAspectRatio() { diff --git a/pages/media/_id/history.vue b/pages/media/_id/history.vue index ae1e7f4c..fb38c67a 100644 --- a/pages/media/_id/history.vue +++ b/pages/media/_id/history.vue @@ -51,9 +51,6 @@ export default { if (!this.mediaItemHistory) return [] return (this.mediaItemHistory.events || []).sort((a, b) => b.timestamp - a.timestamp) }, - mediaItemIsLocal() { - return this.mediaItemHistory && this.mediaItemHistory.isLocal - }, mediaItemLibraryItemId() { if (!this.mediaItemHistory) return null return this.mediaItemHistory.libraryItemId @@ -91,7 +88,7 @@ export default { // Collapse saves if (evt.name === 'Save') { - let saveName = evt.name + "-" + evt.serverSyncAttempted + "-" + evt.serverSyncSuccess + let saveName = evt.name + '-' + evt.serverSyncAttempted + '-' + evt.serverSyncSuccess if (lastSaveName === saveName && numSaves > 0 && !keyUpdated) { include = false const totalInGroup = groups[key].length @@ -140,19 +137,14 @@ export default { }, playAtTime(startTime) { this.$store.commit('setPlayerIsStartingPlayback', this.mediaItemEpisodeId || this.mediaItemLibraryItemId) - if (this.mediaItemIsLocal) { - // Local only - this.$eventBus.$emit('play-item', { libraryItemId: this.mediaItemLibraryItemId, episodeId: this.mediaItemEpisodeId, startTime }) + // Server may have local + const localProg = this.$store.getters['globals/getLocalMediaProgressByServerItemId'](this.mediaItemLibraryItemId, this.mediaItemEpisodeId) + if (localProg) { + // Has local copy so prefer + this.$eventBus.$emit('play-item', { libraryItemId: localProg.localLibraryItemId, episodeId: localProg.localEpisodeId, serverLibraryItemId: this.mediaItemLibraryItemId, serverEpisodeId: this.mediaItemEpisodeId, startTime }) } else { - // Server may have local - const localProg = this.$store.getters['globals/getLocalMediaProgressByServerItemId'](this.mediaItemLibraryItemId, this.mediaItemEpisodeId) - if (localProg) { - // Has local copy so prefer - this.$eventBus.$emit('play-item', { libraryItemId: localProg.localLibraryItemId, episodeId: localProg.localEpisodeId, serverLibraryItemId: this.mediaItemLibraryItemId, serverEpisodeId: this.mediaItemEpisodeId, startTime }) - } else { - // Only on server - this.$eventBus.$emit('play-item', { libraryItemId: this.mediaItemLibraryItemId, episodeId: this.mediaItemEpisodeId, startTime }) - } + // Only on server + this.$eventBus.$emit('play-item', { libraryItemId: this.mediaItemLibraryItemId, episodeId: this.mediaItemEpisodeId, startTime }) } }, getEventIcon(name) { @@ -211,4 +203,4 @@ export default { if (this.onMediaItemHistoryUpdatedListener) this.onMediaItemHistoryUpdatedListener.remove() } } - \ No newline at end of file +