pulsejet / memories

Fast, modern and advanced photo management suite. Runs as a Nextcloud app.
https://memories.gallery
GNU Affero General Public License v3.0
2.82k stars 76 forks source link

Add copy and "move and organise" features #1143

Open AiroPi opened 4 weeks ago

AiroPi commented 4 weeks ago

This implements features #595 and #1111. It's my first time working with TypeScript, PHP, and Vue, so this is still a draft. I'm aware there are many things that need refactoring.

This adds two new buttons to the "move" modal called “Move and Organize” and "Copy".

To implement these features, I needed to make a few changes:

Another approach could have been to keep a memories-defined type enum, and have button implementations defined based on the type passed. However, determining which button was pressed would be trickier with multiple buttons. The current approach however needs more work in order to have different buttons than "Choose".

I didn't implement the "Move to x" when a folder is selected, since with 3 buttons this can add a lot of text.

Initially, I considered a more general movePhotosToDestinations function that takes a Map<Path, IPhotos[]>, but this would require additional calls to create all the directories, check if they exist, and then create them. However, this approach could also allow for user-defined structures.

By the way, the new copyPhotos and movePhotos functions are very similar and could be merged.

AiroPi commented 4 weeks ago

By the way, here is how it looks like:

image
pulsejet commented 2 weeks ago

I intended to get to this before the 7.3 release but a hotfix came up that'll need an immediate release. Moving this ahead but 7.4 can come earlier.