Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(propfind): add audio and location props #4389

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

dschmidt
Copy link

@dschmidt dschmidt commented Dec 6, 2023

Return oc:audio and oc:location props for allprops requests or when explicitly requested.
These are analogue to audio and location facets defined in LibreGraph API.

Camelcase seems off, should we lowercase or dasherize the prop names? For eg albumArtist

Audio data is already indexed in oCIS master, location data depends on owncloud/ocis#7886

<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/spaces/storage-users-1$some-admin-user-id-0000-000000000000/Foo/</d:href>
    <d:propstat>
      <d:prop>
        <oc:id>storage-users-1$some-admin-user-id-0000-000000000000!746e171b-7143-4461-b1c0-f119cb57a3d1</oc:id>
        <oc:fileid>storage-users-1$some-admin-user-id-0000-000000000000!746e171b-7143-4461-b1c0-f119cb57a3d1</oc:fileid>
        <oc:spaceid>some-admin-user-id-0000-000000000000</oc:spaceid>
        <oc:file-parent>storage-users-1$some-admin-user-id-0000-000000000000!some-admin-user-id-0000-000000000000</oc:file-parent>
        <oc:name>Foo</oc:name>
        <d:getetag>&quot;2c7f03b3e0a1efc87ad6da4717ffb9ba&quot;</d:getetag>
        <oc:permissions>RDNVCKZP</oc:permissions>
        <d:resourcetype>
          <d:collection/>
        </d:resourcetype>
        <oc:size>7196356</oc:size>
        <d:getlastmodified>Tue, 05 Dec 2023 16:54:00 GMT</d:getlastmodified>
        <oc:tags/>
        <oc:favorite>0</oc:favorite>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <oc:audio/>
        <oc:location/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/spaces/storage-users-1$some-admin-user-id-0000-000000000000/Foo/A_IMG_20231006_185428.jpg</d:href>
    <d:propstat>
      <d:prop>
        <oc:id>storage-users-1$some-admin-user-id-0000-000000000000!e3afec67-5e82-4c7b-884f-2f798029cee4</oc:id>
        <oc:fileid>storage-users-1$some-admin-user-id-0000-000000000000!e3afec67-5e82-4c7b-884f-2f798029cee4</oc:fileid>
        <oc:spaceid>some-admin-user-id-0000-000000000000</oc:spaceid>
        <oc:file-parent>storage-users-1$some-admin-user-id-0000-000000000000!746e171b-7143-4461-b1c0-f119cb57a3d1</oc:file-parent>
        <oc:name>A_IMG_20231006_185428.jpg</oc:name>
        <d:getetag>&quot;26c5b396fa752e90f271102690f61fd5&quot;</d:getetag>
        <oc:permissions>RDNVWZP</oc:permissions>
        <d:resourcetype/>
        <d:getcontentlength>1347813</d:getcontentlength>
        <d:getcontenttype>image/jpeg</d:getcontenttype>
        <d:getlastmodified>Tue, 05 Dec 2023 15:59:36 GMT</d:getlastmodified>
        <oc:checksums>
          <oc:checksum>SHA1:da95c8511b6e4bbc9f580457d8b36ca9599b1862 MD5:d365cb975fa598b49289a348d32247d5 ADLER32:c586519c</oc:checksum>
        </oc:checksums>
        <oc:tags/>
        <oc:location>
          <oc:latitude>49.801781</oc:latitude>
          <oc:longitude>9.932846</oc:longitude>
        </oc:location>
        <oc:favorite>0</oc:favorite>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <oc:audio/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/spaces/storage-users-1$some-admin-user-id-0000-000000000000/Foo/01%20-%20Sucker.mp3</d:href>
    <d:propstat>
      <d:prop>
        <oc:id>storage-users-1$some-admin-user-id-0000-000000000000!6f3f2980-6dd7-4b4a-b01c-722bf3d53ec0</oc:id>
        <oc:fileid>storage-users-1$some-admin-user-id-0000-000000000000!6f3f2980-6dd7-4b4a-b01c-722bf3d53ec0</oc:fileid>
        <oc:spaceid>some-admin-user-id-0000-000000000000</oc:spaceid>
        <oc:file-parent>storage-users-1$some-admin-user-id-0000-000000000000!746e171b-7143-4461-b1c0-f119cb57a3d1</oc:file-parent>
        <oc:name>01 - Sucker.mp3</oc:name>
        <d:getetag>&quot;5897769a2eaec9573c6f0919464e1796&quot;</d:getetag>
        <oc:permissions>RDNVWZP</oc:permissions>
        <d:resourcetype/>
        <d:getcontentlength>5848543</d:getcontentlength>
        <d:getcontenttype>audio/mpeg</d:getcontenttype>
        <d:getlastmodified>Fri, 13 Oct 2023 16:00:21 GMT</d:getlastmodified>
        <oc:checksums>
          <oc:checksum>SHA1:28b306e048d26df4c53e66263959a5c0dc267204 MD5:4aaad82c633c17db5f94fd38c1c89082 ADLER32:072717cd</oc:checksum>
        </oc:checksums>
        <oc:tags/>
        <oc:audio>
          <oc:album>Kiss Of Death</oc:album>
          <oc:albumArtist>Foobar</oc:albumArtist>
          <oc:artist>Motörhead</oc:artist>
          <oc:disc>4</oc:disc>
          <oc:genre/>
          <oc:title>Sucker</oc:title>
          <oc:year>2006</oc:year>
        </oc:audio>
        <oc:favorite>0</oc:favorite>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <oc:location/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

@dschmidt dschmidt requested review from labkode and a team as code owners December 6, 2023 01:08
Copy link

update-docs bot commented Dec 6, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Copy link
Contributor

@kobergj kobergj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 But let's go with all lower prop names, most of the existing follow that convention.

@dschmidt
Copy link
Author

dschmidt commented Dec 6, 2023

file-parent

file-parent has a dash - no idea and no strong feelings on what is better or "more consistent"

@kobergj
Copy link
Contributor

kobergj commented Dec 6, 2023

Yes. But I think file-parent is the only outlier

@dschmidt
Copy link
Author

dschmidt commented Dec 6, 2023

Updated

@dschmidt dschmidt force-pushed the feat-audio-and-location-props branch from 54a65a9 to 22b5f8a Compare December 6, 2023 13:54
Copy link
Contributor

@kobergj kobergj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool 🦅

@kobergj kobergj merged commit 7b47abd into cs3org:edge Dec 6, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants