Skip to content

Commit

Permalink
Merge pull request #633 from nextcloud/backport/632/stable-2.6
Browse files Browse the repository at this point in the history
[stable-2.6] Media query enhancement
  • Loading branch information
AndyScherzinger authored May 27, 2021
2 parents 1a3c037 + 4537efe commit 95f21d7
Showing 1 changed file with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,25 @@ private Document createQuery(String searchQuery) {
Element remoteIdElement = query.createElementNS(NAMESPACE_OC, "oc:id");
Element sizeElement = query.createElementNS(NAMESPACE_OC, "oc:size");
Element favoriteElement = query.createElementNS(NAMESPACE_OC, "oc:favorite");
Element previewElement = query.createElementNS(NAMESPACE_OC, "nc:has-preview");

selectPropsElement.appendChild(displayNameElement);
if (searchType != SearchRemoteOperation.SearchType.GALLERY_SEARCH) {
selectPropsElement.appendChild(displayNameElement);
selectPropsElement.appendChild(creationDate);
selectPropsElement.appendChild(quotaUsedElement);
selectPropsElement.appendChild(quotaAvailableElement);
selectPropsElement.appendChild(permissionsElement);
selectPropsElement.appendChild(sizeElement);
}
if (searchType == SearchRemoteOperation.SearchType.GALLERY_SEARCH) {
selectPropsElement.appendChild(previewElement);
}
selectPropsElement.appendChild(contentTypeElement);
selectPropsElement.appendChild(resourceTypeElement);
selectPropsElement.appendChild(contentLengthElement);
selectPropsElement.appendChild(lastModifiedElement);
selectPropsElement.appendChild(creationDate);
selectPropsElement.appendChild(etagElement);
selectPropsElement.appendChild(quotaUsedElement);
selectPropsElement.appendChild(quotaAvailableElement);
selectPropsElement.appendChild(permissionsElement);
selectPropsElement.appendChild(remoteIdElement);
selectPropsElement.appendChild(sizeElement);
selectPropsElement.appendChild(favoriteElement);

Element fromElement = query.createElementNS(DAV_NAMESPACE, "d:from");
Expand Down Expand Up @@ -230,7 +236,9 @@ private Document createQuery(String searchQuery) {

Element orderByElement = query.createElementNS(DAV_NAMESPACE, "d:orderby");

if (searchType == SearchRemoteOperation.SearchType.PHOTO_SEARCH || searchType == SearchRemoteOperation.SearchType.RECENTLY_MODIFIED_SEARCH) {
if (searchType == SearchRemoteOperation.SearchType.PHOTO_SEARCH ||
searchType == SearchRemoteOperation.SearchType.RECENTLY_MODIFIED_SEARCH ||
searchType == SearchRemoteOperation.SearchType.GALLERY_SEARCH) {
Element orderElement = query.createElementNS(DAV_NAMESPACE, "d:order");
orderByElement.appendChild(orderElement);
Element orderPropElement = query.createElementNS(DAV_NAMESPACE, "d:prop");
Expand Down

0 comments on commit 95f21d7

Please sign in to comment.