Skip to content

Conversation

@icewind1991
Copy link
Member

@icewind1991 icewind1991 commented Aug 2, 2022

Allow creating and managing folders trough dav

  • create albums with mkcol
    curl -u admin:admin -X MKCOL http://172.19.0.2/remote.php/dav/photos/admin/albums/test
  • add photos using COPY
    curl -u admin:admin -H 'Destination: http://172.19.0.2/remote.php/dav/photos/admin/albums/test2/2.png' -X COPY http://172.19.0.2/remote.php/dav/files/admin/background.png'
    note that the destination name is ignored
  • rename albums using MOVE
    curl -u admin:admin -H 'Destination: http://172.19.0.2/remote.php/dav/photos/admin/albums/test' -X MOVE 'http://172.19.0.2/remote.php/dav/photos/admin/albums/test2'
  • list albums or albums contents with PROPFIND (you can use depth: 2 to list all albums with content included)
  • file names in albums are prefixed by fileid to avoid collisions, you can request the {http://nextcloud.org/ns}file-name property to get the original filename
  • full file can be downloaded from the album dav endpoint, thumbnails can be retrieved from the normal preview api by fileid

Copy link
Collaborator

@artonge artonge left a comment

Choose a reason for hiding this comment

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

I don't see any way to store the album location. Also, there is nothing about the sharing state (collaborators).

Will it come in future work ?

@icewind1991
Copy link
Member Author

I don't see any way to store the album location

How do we want to store location? coordinates or freeform string?

@artonge
Copy link
Collaborator

artonge commented Aug 8, 2022

How do we want to store location? coordinates or freeform string?

Freeform string

@artonge
Copy link
Collaborator

artonge commented Aug 8, 2022

Also, could there be a way to have the creation date, the number of items, and a cover picture ? I can be the latest added picture for now. The last two information could be retrieved from fetching the file list, but it won't scale with a lot of albums.

@artonge
Copy link
Collaborator

artonge commented Aug 10, 2022

Additional work done here: #1142

@icewind1991
Copy link
Member Author

icewind1991 commented Aug 12, 2022

Added location and last-photo to albums at {http://nextcloud.org/ns}location and '{http://nextcloud.org/ns}last-photo. The location can be set through PROPPATCH, last-photo is the fileid so you can get a thumbnail for it trough the normal api.

Note that this change re-uses the same migration which will not run automatically if you've already run a previous version of it. You can manually trigger the new changes by deleting the photos_albums and photos_albums_files tables and running occ migrations:execute photos 20000Date20220727125801

@matiasdelellis
Copy link

First of all, excuse the boldness.
I understand that it is intended for user albums, but can it also be extended as virtual albums filled by applications?.

In principle, perhaps it would only need a flag to indicate that it cannot be edited by the user [1], perhaps change 'location' to 'context' [2], and an 'icon' would be interesting to help the context.

[1]: Ideally, it would be necessary to make an extensive api (Registration of applications, dynamic responses, hooks/events for removal/add photos, similar to searches), but I understand that it would already be beyond the intention of this proposal, and indicating that it cannot be edited and that it is generated automatically may be enough.

[2]: Just a name change, since in an album you don't always organize by places, and it can be used to comment who generates the album. 🤔

[3]: If it's not by location, it may be by the content of the image (recognize, facerecognition, maps apps), and a simple icon would be fine.

Regards,
Matias

@marcelklehr
Copy link
Member

@matiasdelellis Thank you for your input! We're iterating on this, currently, this is the scope we're working on. It may be that virtual albums will appear in the future as a refactoring or similar. Right now we're being pragmatic :)

@artonge artonge closed this Aug 23, 2022
@skjnldsv skjnldsv deleted the album-api branch January 7, 2025 08:53
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.

6 participants