Skip to content

Conversation

@AiroPi
Copy link
Contributor

@AiroPi AiroPi commented Apr 16, 2024

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:

  • To accommodate adding multiple buttons, I refactored the chooseNcFolder function slightly. It now takes a buttonFactory instead of type as the third argument. setTypewas deprecated anyway in getFilePickerBuilder. The default value still behaves the same (providing the "Choose" option) so it doesn't break anything. Other types need to be defined manually.

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.

  • To optimize the movement of files to different folders, I also created a movePhotosByDate function for dav. This function first creates the required directories, then moves the files.

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 added 10 commits April 11, 2024 18:51
"type" is deprecated, and using "buttonFactory" allow to add more than one button the the modal.

Signed-off-by: Pıεяяε <47398145+AiroPi@users.noreply.github.com>
Signed-off-by: Pıεяяε <47398145+AiroPi@users.noreply.github.com>
Signed-off-by: airo.pi_ <47398145+AiroPi@users.noreply.github.com>
Signed-off-by: airo.pi_ <47398145+AiroPi@users.noreply.github.com>
Signed-off-by: airo.pi_ <47398145+AiroPi@users.noreply.github.com>
Signed-off-by: airo.pi_ <47398145+AiroPi@users.noreply.github.com>
Signed-off-by: airo.pi_ <47398145+AiroPi@users.noreply.github.com>
Signed-off-by: airo.pi_ <47398145+AiroPi@users.noreply.github.com>
@AiroPi
Copy link
Contributor Author

AiroPi commented Apr 16, 2024

By the way, here is how it looks like:
image

@pulsejet
Copy link
Owner

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.

@pulsejet pulsejet marked this pull request as ready for review January 4, 2025 15:35
@pulsejet pulsejet merged commit c65ed06 into pulsejet:master Jan 4, 2025
@pulsejet
Copy link
Owner

pulsejet commented Jan 4, 2025

Happy new year 😄

@shalak
Copy link

shalak commented May 8, 2025

I'm trying to find some documentation, but with no luck. What does exactly "Move and organize" do? How does it differ from "Move"?

@AiroPi
Copy link
Contributor Author

AiroPi commented May 8, 2025

I'm trying to find some documentation, but with no luck. What does exactly "Move and organize" do? How does it differ from "Move"?

Some documentation could be welcomed but I don't really know where it could be present. There is a little website for the documentation, maybe here.

To respond to your question, this feature is the implementation of #1111 which will not only move the photos, but also create a directory tree, sorting photos by year / months.
So in the memories perspective you won't notice the difference, but when you explore in folder view you will view the structure created.

@shalak
Copy link

shalak commented May 8, 2025

Some documentation could be welcomed but I don't really know where it could be present

A tooltip on hover for the "Move and organise" button might be the most intuitive option. I'm not familiar with the codebase, but if the button factory supports a title field, that might be the simplest solution.

image

To respond to your question, this feature is the implementation of #1111 which will not only move the photos, but also create a directory tree, sorting photos by year / months.

Thanks — makes sense. Just to clarify: is the timestamp taken purely from EXIF metadata, or does it fall back to file modification times or other sources?

@AiroPi
Copy link
Contributor Author

AiroPi commented May 9, 2025

Thanks — makes sense. Just to clarify: is the timestamp taken purely from EXIF metadata, or does it fall back to file modification times or other sources?

It will respect the same rules than Memories use to sort the timeline, so yes, it fall back to file modification times etc...

@Chikamatsu
Copy link

Chikamatsu commented Sep 27, 2025

@AiroPi Thank you for this feature!

I am currently migrating my photo collection to Nextcloud and therefore have many photos that need to be properly organized. I upload the photos to an upload folder, select them all, and then apply Move and Organize to move them. Normally, I select and move about 200 to 300 photos at once.

But then, sometimes pictures are being moved to incorrect folders. For example, a picture from 2005 is moved to a folder for 2006, and with the months, there is, for instance, a folder 01 (January) that contains pictures from various months.

When i select the wrong pictures (only about 10) an use Move and Organise on this pictures again it seems to work correct.

Did anyone else notice this behavior?

edit: Now i can reproduce the behaviour and can open a issue: #1544

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.

4 participants