feat(files): refresh preview on etag change

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
pull/45417/head
skjnldsv 6 months ago committed by nextcloud-command
parent 474cbda59a
commit 3ca3c65b0d
  1. 7
      apps/files/src/components/FileEntry/FileEntryPreview.vue
  2. 3
      apps/files/src/views/Sidebar.vue
  3. 6
      dist/6364-6364.js
  4. 2
      dist/6364-6364.js.map
  5. 6
      dist/files-main.js
  6. 2
      dist/files-main.js.map
  7. 6
      dist/files-sidebar.js
  8. 2
      dist/files-sidebar.js.map
  9. 6
      dist/files_sharing-files_sharing_tab.js
  10. 2
      dist/files_sharing-files_sharing_tab.js.map

@ -76,10 +76,11 @@ import NetworkIcon from 'vue-material-design-icons/Network.vue'
import TagIcon from 'vue-material-design-icons/Tag.vue'
import PlayCircleIcon from 'vue-material-design-icons/PlayCircle.vue'
import { useUserConfigStore } from '../../store/userconfig.ts'
import CollectivesIcon from './CollectivesIcon.vue'
import FavoriteIcon from './FavoriteIcon.vue'
import { isLivePhoto } from '../../services/LivePhotos'
import { useUserConfigStore } from '../../store/userconfig.ts'
export default Vue.extend({
name: 'FileEntryPreview',
@ -162,6 +163,10 @@ export default Vue.extend({
url.searchParams.set('y', this.gridMode ? '128' : '32')
url.searchParams.set('mimeFallback', 'true')
// Etag to force refresh preview on change
const etag = this.source?.attributes?.etag || ''
url.searchParams.set('v', etag.slice(0, 6))
// Handle cropping
url.searchParams.set('a', this.cropPreviews === true ? '0' : '1')
return url.href

@ -335,7 +335,8 @@ export default {
getPreviewIfAny(fileInfo) {
if (fileInfo?.hasPreview && !this.isFullScreen) {
return generateUrl(`/core/preview?fileId=${fileInfo.id}&x=${screen.width}&y=${screen.height}&a=true`)
const etag = fileInfo?.etag || ''
return generateUrl(`/core/preview?fileId=${fileInfo.id}&x=${screen.width}&y=${screen.height}&a=true&v=${etag.slice(0, 6)}`)
}
return this.getIconUrl(fileInfo)
},

6
dist/6364-6364.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save