mirror of
https://github.com/nextcloud/server.git
synced 2026-02-15 16:59:47 -05:00
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>
This commit is contained in:
parent
474cbda59a
commit
3ca3c65b0d
10 changed files with 24 additions and 18 deletions
|
|
@ -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
6
dist/6364-6364.js
vendored
File diff suppressed because one or more lines are too long
2
dist/6364-6364.js.map
vendored
2
dist/6364-6364.js.map
vendored
File diff suppressed because one or more lines are too long
6
dist/files-main.js
vendored
6
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
6
dist/files-sidebar.js
vendored
6
dist/files-sidebar.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-sidebar.js.map
vendored
2
dist/files-sidebar.js.map
vendored
File diff suppressed because one or more lines are too long
6
dist/files_sharing-files_sharing_tab.js
vendored
6
dist/files_sharing-files_sharing_tab.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_sharing-files_sharing_tab.js.map
vendored
2
dist/files_sharing-files_sharing_tab.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue