-
-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Gallery folders support #518
Conversation
A few notes about the limitations of this implementation: |
When a file is created, deleted or changed, the modify and change timestamp of the directory is updated too. Can we use this to detect changed galleries and automatically remove associated cache entries while library scan is running? |
The modified folder date could work if it's the same across every os but it doesn't change the fact that the folder is now different. So it would need a new checksum also. The rename, clean , scan makes sure that cache and checksum is valid. The modification date also needs DB schema changes as that date would need to be saved somewhere during scan and that's what I wanted to avoid from the start. |
Just wanted to chime in that whilst I usually love simple code when possible, this ain't it chief. This is UX-wise very convoluted, unintuitive and to be frank, you're out-dancing the "good" (hated by every user) old Plex dance here, since latter is used to fix specific issues. Just adding files to a gallery as a reason to redo the gallery... I don't know about that. Maybe "re-scan all galleries" could be a nice addition? So any known galleries get re-scanned, avoiding going through the entire recursive structure of the library, including all videos? Somewhere in here we're far off what can be expected by the average user here and quite frankly, even those who "RTFM"ed. I still appreciate the work done here and that some folks are even this passionate about a medium that is usually seen as disposable. |
I think you are missing the point here. |
Does this support the WebP image format? I'm finding more and more images using this format. |
It supports everything that is already supported inside zip files , so it should, yes. |
That reply really cleared it up for me, thanks so much! :) |
@WithoutPants The main issue left for this PR to work properly was how to make sure that the cache is valid and how to update/recreate when the gallery is changed. I thought of adding 3 more fields in the gallery model , When scanning a gallery the mod_date of the zip file or the gallery folder should be saved in the database. If the db mod_date is different than the one found during the scan then we can have a look at the size. If the size (for gallery folders it could be the size of all images )is also different then the gallery must be updated/changed so the cache folder of the gallery should be deleted and recreated. Size calculation is relatively fast as it can be retrieved along with the mod_time when stating. ( i have a file/utils.go GetFileSizeTime function in the non working branch). A count galleries size could also be calculated from the db and added to the library total. |
I've spent a bit of time thinking about this, #24 and #290, and I think that this is the wrong approach that will end up tying us up. I think we should move towards Galleries being more of a grouping of Images - like playlist or collection for scenes - with the view toward having images as first-class objects. This will make Galleries more like Performers/Studios/Movies in that the user can add and remove galleries without worrying about the underlying files. We will need to maintain backwards-compatibility with existing zipped-style galleries. My concern with this approach is that once it is implemented, it will be very difficult to walk it back when we move towards the more dynamic paradigm. |
I have very few image galleries so i can't speak in general. The folders solution seemed good enough for me for 2 main reasons. 1.I wouldn't have to add every single image i had to the DB, just the folders containing them. This ofc has the limitations you mention so it was sort of a temporary solution and thats why i tried to keep things as compatible as possible to the zip galleries. If the migration to a better approach is easier if we skip this PR i don't mind. I would remove the 0.3 milestone though. |
Closing this. Switching to #24 instead |
Add support for gallery folders.
Directories that have a minimum number of images ( set as an option ) inside them (depth 1) are treated during scan as galleries.If a directory has subdirectories that have images inside then each subdirectory will be a gallery.
Auto association of folder galleries to scenes is available.
If
/path/to/media/scene.mp4
is a scene (where mp4 can be any of the supported video extensions)then if
/path/to/media/scene
folder exists and has images inside it will be autoassigned to the sceneFor checksum the XOR of the MD5s of every folder image is calculated. This has the advantage (over calculating MD5 of all images ) that order doesn't matter so renaming an image inside the folder (and thus changing the read order) doesn't change the checksum.