Create album from folder

Before I figured out Albums I just used folders. Albums look better and Iā€™d like to migrate. Is there some shortcut to creating photo albums from folders? Anything that would save me a couple hundred mouse clicks on the command line, web browser console, WebDAV, whatever.

Looks like WebDAV is the way to go!

I automated converting folders to albums with a MKCOL request to create a new album, followed by COPY requests to add each photo or video to the new album. I used Python. The developer manual has good examples in Javascript and shell (using curl).

1 Like

Related: Duplicate photo album

1 Like

Does anyone know if there are plans to implement this ā€œfolder to albumā€ feature in the web interface? It is very surprising this was not the first feature available in the new gallery app, given that

  1. uploading a set of photos to a folder (which is logically a photo album) is a common activity,
  2. sharing that folder of photos via public link is a widely used feature,
  3. there is a clear desire to have a shared link open a view with a grid of thumbnails, which the current folder share link does not, and
  4. the new gallery app share links to photo albums does open a view with a grid of thumbnails!

In the ā€œAdd to albumā€ dialog, there should be an option to select folders in addition to the flat chronological list of photos.

1 Like

I donā€™t know about plans for the Photos app, but have you tried Memories? You can select a dayā€™s worth of photos at a time, then add those to an album. Thatā€™s handy for creating new albums from recent trips. Itā€™s less useful if the photos you want in an album are spread out across many days.

Re: converting a folderā€¦ when I hacked together some folder-to-album conversion Python code, I discovered exactly how inconsistent I had been in the past. Folders of photos and videos with subfolders, folder names with and without dates, folders with every single photo from an event (not just the good ones). I ended up having to curate half of my albums manually anyway.

1 Like

If you use Android, and like to do all these photo album management works, including folder to album, while on the go, you can try Les Pas

i want this too really confused why its not a feature in the first place

@meonkeys - could you share that script? Iā€™d like to convert my folders to albums too, but Iā€™ve got more than a hundred and it would be tedious to do one at a time.

Sure:

Thank you so much!

I will admit, I donā€™t use github much, but I feel like Iā€™m missing something obvious. Iā€™m on a Mac with python installed. I downloaded the files at your link by going to the green ā€œCodeā€ button and downloading the zip. I created the todo-photo-folders.txt as described and went to edit the main.py parameters ā€¦

But I ran into two speedbumps

  1. It asks where the nextcloud files are synced on the local machine. What if theyā€™re not? Does it still work?
  2. When I run ./convert-all.sh, itā€™s erroring out after trying to process the first directory: ā€œ./convert-all.sh: line 15: ./diralbum.py: No such file or directoryā€

Where do I get the diralbum.py (or anything else I need to be downloading)?

The issues you are running into are totally reasonable given this is very much a work-in-progress tool I tinker on in my free time.

whoops, yeah, that was a bug in main.py. I fixed that by removing some config lines that are unnecessary on the diralbum branch.

This version of main.py works directly against the server; you donā€™t need any files synced locally for it to work.

Thanks for that error message. Another bug on my end, sorry. Fixed: just needed to change diralbum.py to main.py.

Good to know. It should work for you now, butā€”fair warningā€”I donā€™t use macOS. Iā€™m guessing your Bash shell is compatible enough since you made it this far, and you already said you have Python. That needs to be Python 3, by the way.

Thanks again! Iā€™m not near the computer for a bit today but appreciate all youā€™ve done to help!

Thanks a lot for the work and the scripts. I was just about to write something similar and was really happy that you shared your work with us :blush:
I fixed a small bug and made a pull request :slight_smile:

1 Like

Merged to main, thank you.

In case itā€™s helpful, I wanted to do something similar. I found the webdav api to be more cumbersome than I wanted, so I created a couple of occ commands to make the process much easier. https://github.com/nextcloud/photos/pull/2172 was merged into the photo app and should make it into a future release.

2 Likes

Particularly if people are starting with Nextcloud, they are likely to want to import a lot of media that will probably be stored in different folders and sub-folders. After using Nextcloud to sync a folder of e.g. images, they would then need to be laboriously added one-by-one into an album.

Couldnā€™t the interface support selecting of multiple files for mass import into an album? Currently, you need to click on them one-by-one.

Couldnā€™t Nextcloud also support sub-albums? It is a natural way to organize things such as holiday photos. For example:

Holiday to Europe
France
Marseille
Paris

Germany
Berlin
Dresden

1 Like

Itā€™s such a deal-breaker, isnā€™t it?

But even if you started with zero photos (mega-hypothetically) the amount of photos accumulates so fast these days that any kind of multi-select is sort of mandatory in my book. I looked at tags, but the way search results are displayed donā€™t help at all, either. Plus I donā€™t want to have to tag every single file manually, either.

I started using nextcloud on version 17. Iā€™m at 27 now, and there is still no way to achieve these basic tasks. This is some pretty basic, every-day file management stuff that I feel is not being worked on at all.

1 Like