Merge pull request #1360 from ISO-B/fix_remove_internet_connection_check

iOS devices have always networkConnected status true
This commit is contained in:
advplyr 2024-11-03 15:17:28 -06:00 committed by GitHub
commit ea6417dbb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 4 deletions

View file

@ -50,7 +50,7 @@
<div id="playerContent" class="playerContainer w-full z-20 absolute bottom-0 left-0 right-0 p-2 pointer-events-auto transition-all" :style="{ backgroundColor: showFullscreen ? '' : coverRgb }" @click="clickContainer">
<div v-if="showFullscreen" class="absolute bottom-4 left-0 right-0 w-full pb-4 pt-2 mx-auto px-6" style="max-width: 414px">
<div class="flex items-center justify-between pointer-events-auto">
<span v-if="!isPodcast && serverLibraryItemId && networkConnected" class="material-icons text-3xl text-fg-muted cursor-pointer" @click="$emit('showBookmarks')">{{ bookmarks.length ? 'bookmark' : 'bookmark_border' }}</span>
<span v-if="!isPodcast && serverLibraryItemId && socketConnected" class="material-icons text-3xl text-fg-muted cursor-pointer" @click="$emit('showBookmarks')">{{ bookmarks.length ? 'bookmark' : 'bookmark_border' }}</span>
<!-- hidden for podcasts but still using this as a placeholder -->
<span v-else class="material-icons text-3xl text-white text-opacity-0">bookmark</span>
@ -375,8 +375,8 @@ export default {
return secondsRemaining + 's'
}
},
networkConnected() {
return this.$store.state.networkConnected
socketConnected() {
return this.$store.state.socketConnected
},
mediaId() {
if (this.isPodcast || !this.playbackSession) return null

View file

@ -188,7 +188,7 @@ export default {
if (libraryItem?.libraryItemId?.startsWith('li_')) {
// Detect old library item id
console.error('Local library item has old server library item id', libraryItem.libraryItemId)
} else if (query.noredirect !== '1' && libraryItem?.libraryItemId && libraryItem?.serverAddress === store.getters['user/getServerAddress'] && store.state.networkConnected) {
} else if (query.noredirect !== '1' && libraryItem?.libraryItemId && libraryItem?.serverAddress === store.getters['user/getServerAddress'] && store.state.socketConnected) {
const queryParams = new URLSearchParams()
queryParams.set('localLibraryItemId', libraryItemId)
if (libraryItem.mediaType === 'podcast') {

View file

@ -170,6 +170,11 @@ export const mutations = {
} else {
state.networkConnected = false
}
if (this.$platform === 'ios') {
// Capacitor Network plugin only shows ios device connected if internet access is available.
// This fix allows iOS users to use local servers without internet access.
state.networkConnected = true
}
state.networkConnectionType = val.connectionType
},
setIsNetworkUnmetered(state, val) {