mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-11-04 03:17:00 -05:00 
			
		
		
		
	Update:Match tab show current cover and include resolutions #1605
This commit is contained in:
		
							parent
							
								
									60b4bc1a7e
								
							
						
					
					
						commit
						fc36e86db7
					
				@ -2,7 +2,7 @@
 | 
				
			|||||||
  <div class="w-full h-full overflow-hidden overflow-y-auto px-2 sm:px-4 py-6 relative">
 | 
					  <div class="w-full h-full overflow-hidden overflow-y-auto px-2 sm:px-4 py-6 relative">
 | 
				
			||||||
    <div class="flex flex-wrap">
 | 
					    <div class="flex flex-wrap">
 | 
				
			||||||
      <div class="relative">
 | 
					      <div class="relative">
 | 
				
			||||||
        <covers-preview-cover :src="$store.getters['globals/getLibraryItemCoverSrcById'](libraryItemId)" :width="120" :book-cover-aspect-ratio="bookCoverAspectRatio" />
 | 
					        <covers-preview-cover :src="$store.getters['globals/getLibraryItemCoverSrcById'](libraryItemId, null, true)" :width="120" :book-cover-aspect-ratio="bookCoverAspectRatio" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <!-- book cover overlay -->
 | 
					        <!-- book cover overlay -->
 | 
				
			||||||
        <div v-if="media.coverPath" class="absolute top-0 left-0 w-full h-full z-10 opacity-0 hover:opacity-100 transition-opacity duration-100">
 | 
					        <div v-if="media.coverPath" class="absolute top-0 left-0 w-full h-full z-10 opacity-0 hover:opacity-100 transition-opacity duration-100">
 | 
				
			||||||
 | 
				
			|||||||
@ -34,14 +34,26 @@
 | 
				
			|||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
      <ui-checkbox v-model="selectAll" checkbox-bg="bg" @input="selectAllToggled" />
 | 
					      <ui-checkbox v-model="selectAll" checkbox-bg="bg" @input="selectAllToggled" />
 | 
				
			||||||
      <form @submit.prevent="submitMatchUpdate">
 | 
					      <form @submit.prevent="submitMatchUpdate">
 | 
				
			||||||
        <div v-if="selectedMatchOrig.cover" class="flex items-center py-2">
 | 
					        <div v-if="selectedMatchOrig.cover" class="flex flex-wrap md:flex-nowrap items-center justify-center">
 | 
				
			||||||
 | 
					          <div class="flex flex-grow items-center py-2">
 | 
				
			||||||
            <ui-checkbox v-model="selectedMatchUsage.cover" checkbox-bg="bg" @input="checkboxToggled" />
 | 
					            <ui-checkbox v-model="selectedMatchUsage.cover" checkbox-bg="bg" @input="checkboxToggled" />
 | 
				
			||||||
            <ui-text-input-with-label v-model="selectedMatch.cover" :disabled="!selectedMatchUsage.cover" readonly :label="$strings.LabelCover" class="flex-grow mx-4" />
 | 
					            <ui-text-input-with-label v-model="selectedMatch.cover" :disabled="!selectedMatchUsage.cover" readonly :label="$strings.LabelCover" class="flex-grow mx-4" />
 | 
				
			||||||
          <div class="min-w-12 max-w-12 md:min-w-16 md:max-w-16">
 | 
					          </div>
 | 
				
			||||||
            <a :href="selectedMatch.cover" target="_blank" class="w-full bg-primary">
 | 
					
 | 
				
			||||||
              <img :src="selectedMatch.cover" class="h-full w-full object-contain" />
 | 
					          <div class="flex py-2">
 | 
				
			||||||
 | 
					            <div>
 | 
				
			||||||
 | 
					              <p class="text-center text-gray-200">New</p>
 | 
				
			||||||
 | 
					              <a :href="selectedMatch.cover" target="_blank" class="bg-primary">
 | 
				
			||||||
 | 
					                <covers-preview-cover :src="selectedMatch.cover" :width="100" :book-cover-aspect-ratio="bookCoverAspectRatio" />
 | 
				
			||||||
              </a>
 | 
					              </a>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
 | 
					            <div v-if="media.coverPath">
 | 
				
			||||||
 | 
					              <p class="text-center text-gray-200">Current</p>
 | 
				
			||||||
 | 
					              <a :href="$store.getters['globals/getLibraryItemCoverSrcById'](libraryItemId, null, true)" target="_blank" class="bg-primary">
 | 
				
			||||||
 | 
					                <covers-preview-cover :src="$store.getters['globals/getLibraryItemCoverSrcById'](libraryItemId, null, true)" :width="100" :book-cover-aspect-ratio="bookCoverAspectRatio" />
 | 
				
			||||||
 | 
					              </a>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div v-if="selectedMatchOrig.title" class="flex items-center py-2">
 | 
					        <div v-if="selectedMatchOrig.title" class="flex items-center py-2">
 | 
				
			||||||
          <ui-checkbox v-model="selectedMatchUsage.title" checkbox-bg="bg" @input="checkboxToggled" />
 | 
					          <ui-checkbox v-model="selectedMatchUsage.title" checkbox-bg="bg" @input="checkboxToggled" />
 | 
				
			||||||
 | 
				
			|||||||
@ -99,14 +99,14 @@ export const getters = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    return `${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}&ts=${lastUpdate}`
 | 
					    return `${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}&ts=${lastUpdate}`
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  getLibraryItemCoverSrcById: (state, getters, rootState, rootGetters) => (libraryItemId, placeholder = null) => {
 | 
					  getLibraryItemCoverSrcById: (state, getters, rootState, rootGetters) => (libraryItemId, placeholder = null, raw = false) => {
 | 
				
			||||||
    if (!placeholder) placeholder = `${rootState.routerBasePath}/book_placeholder.jpg`
 | 
					    if (!placeholder) placeholder = `${rootState.routerBasePath}/book_placeholder.jpg`
 | 
				
			||||||
    if (!libraryItemId) return placeholder
 | 
					    if (!libraryItemId) return placeholder
 | 
				
			||||||
    var userToken = rootGetters['user/getToken']
 | 
					    var userToken = rootGetters['user/getToken']
 | 
				
			||||||
    if (process.env.NODE_ENV !== 'production') { // Testing
 | 
					    if (process.env.NODE_ENV !== 'production') { // Testing
 | 
				
			||||||
      return `http://localhost:3333${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}`
 | 
					      return `http://localhost:3333${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}${raw ? '&raw=1' : ''}`
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return `${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}`
 | 
					    return `${rootState.routerBasePath}/api/items/${libraryItemId}/cover?token=${userToken}${raw ? '&raw=1' : ''}`
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  getIsBatchSelectingMediaItems: (state) => {
 | 
					  getIsBatchSelectingMediaItems: (state) => {
 | 
				
			||||||
    return state.selectedMediaItems.length
 | 
					    return state.selectedMediaItems.length
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user