Skip to content

Commit

Permalink
Merge pull request #5710 from owncloud/fix-mediaviewer-dav-properties
Browse files Browse the repository at this point in the history
[full-ci] fix(media-viewer): fix davProperties
  • Loading branch information
kulmann authored Aug 20, 2021
2 parents 443bd72 + d08f33a commit 504ccd8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ We've fixed the loading of a folder in the Media viewer extension.
If a user reloads the Media viewer now, it load all the medias both in private and public context.

https://github.com/owncloud/web/issues/5427
https://github.com/owncloud/web/pull/5585
https://github.com/owncloud/web/pull/5585
https://github.com/owncloud/web/pull/5710
18 changes: 8 additions & 10 deletions packages/web-app-media-viewer/src/mixins/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { mapGetters, mapMutations } from 'vuex'
import queryString from 'query-string'
import { basename, dirname } from 'path'
import { buildResource } from '../../../web-app-files/src/helpers/resources' // TODO: place the helper in more global space not to create dep on files app
import { DavProperties } from 'web-pkg/src/constants'

// TODO: this file is a first attempt to separate file/folder loading logic out of the mediaviewer
// Discussion how to progress from here can be found in this issue:
// https://github.com/owncloud/web/issues/3301

export default {
computed: {
...mapGetters('Files', ['publicLinkPassword', 'davProperties']),
...mapGetters('Files', ['publicLinkPassword']),
...mapGetters(['configuration']),
$_loader_publicContext() {
return this.$route.params.contextRouteName === 'files-public-list'
Expand Down Expand Up @@ -39,17 +40,14 @@ export default {
this.CLEAR_CURRENT_FILES_LIST()

try {
const properties = this.davProperties.concat([
this.$client.publicFiles.PUBLIC_LINK_ITEM_TYPE,
this.$client.publicFiles.PUBLIC_LINK_PERMISSION,
this.$client.publicFiles.PUBLIC_LINK_EXPIRATION,
this.$client.publicFiles.PUBLIC_LINK_SHARE_DATETIME,
this.$client.publicFiles.PUBLIC_LINK_SHARE_OWNER
])
const absolutePath = filePath.substring(0, filePath.lastIndexOf('/'))
const promise = this.$_loader_publicContext
? this.$client.publicFiles.list(absolutePath, this.publicLinkPassword, properties)
: this.$client.files.list(absolutePath, 1, this.davProperties)
? this.$client.publicFiles.list(
absolutePath,
this.publicLinkPassword,
DavProperties.PublicLink
)
: this.$client.files.list(absolutePath, 1, DavProperties.Default)
let resources = await promise

resources = resources.map(buildResource)
Expand Down

0 comments on commit 504ccd8

Please sign in to comment.