Album dav api
Allow creating and managing folders trough dav
- create albums with
mkcolcurl -u admin:admin -X MKCOL http://172.19.0.2/remote.php/dav/photos/admin/albums/test - add photos using
COPYcurl -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
MOVEcurl -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: 2to 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-nameproperty 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
I don't see any way to store the album location
How do we want to store location? coordinates or freeform string?
How do we want to store location? coordinates or freeform string?
Freeform string
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.
Additional work done here: https://github.com/nextcloud/photos/pull/1142
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
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
@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 :)