bpatrik / pigallery2

A fast directory-first photo gallery website, with rich UI, optimized for running on low resource servers (especially on raspberry pi)
http://bpatrik.github.io/pigallery2/
MIT License
1.7k stars 193 forks source link

Collections - Ad hoc shareable albums #815

Open ericnotthered opened 5 months ago

ericnotthered commented 5 months ago

Problem:

I see a number of requests related to albums and sharing, including:

Solution Summary:

I propose a PG2 managed folder at the top level of the Gallery (Images folder) called "Collections". PG2 would create sub-folders for media collections within this. Media would be added to these Collections using file hard-links to the original file in the gallery.

Benefits:

MVP:

Core updates:

  1. Create a "Collections" folder inside the root "Images folder". This is writable by PG2.

Create/Add Photos to Collections:

  1. Add "Save to Collection" button on the search screen. This button opens a dialog which allows the user to select an existing Collection or create a new one. If required, it then creates a folder with that name in the Collections folder. It then and adds hard links in that folder to all files in the search.
    • If the user enters a name that matches an existing Collection, they are prompted to select that Collection.
    • If any of the added files already exist in the Collection, skip them.

Delete Photos from Collections:

Delete Collections:

NOTES:

Backlog Features:

In (arguably) descending priority:

  1. Select individual photo from the Gallery or a Search and add to a Collection (could be a menu option or button on the full screen view that brings up the "Save to Collection" dialog.
  2. Remove individual photos from a Collection (i.e., a Garbage Can icon on the tiles in the Collection).
  3. Delete Collection: Add ability to delete Collections using the "Garbage can" icon on each Collection tile. Deletes folder and all hard links in it.
  4. Multi-select photos from the Gallery or Search result and add to Collection.
  5. Multi-select photos from the album and remove them from the Collection.
  6. Clean-up Collections Background Task: A regularly scheduled task to remove hard-linked photos in Collections if the original/source file in the Gallery is deleted (otherwise the link(s) in the Collection folder(s) will retain the file).
  7. Logic to create hard-links to thumbnails, converted photos/videos, etc for file instances in Collections, rather than creating duplicates.
  8. Move "Collections" folder outside the Images folder directory structure and create a new "Collections" item in the top task bar. This would open a separate Gallery-style view at the Collection folder root.

Summary:

This appears to be an approach that at first glance offers a lot of flexibility while exploiting existing capabilities. Of course, I don't know the code, so there may be obstacles that aren't apparent to me.

Note that you can implement Collections directly through the file system by manually creating the "Collections" directory tree and adding hard-links.. However, it would be much more convenient to have this integrated into BG2.

bpatrik commented 4 months ago

Thank you for your FR.

If the app should support #301, it should do it properly. Implementing that would take a long time and not part of my current main focus.

I'm currently working on creating extension support with the app. The solution described above, should be a possibility with my extension support that i'm planning.