Gallery Watcher - Feature building #1006
Replies: 22 comments 44 replies
-
Symlink in my opinion should not be used, |
Beta Was this translation helpful? Give feedback.
-
We should differentiate between UPLOAD_LOCATION, WATCH_LOCATION and another folder e.g. THUMB_LOCATION |
Beta Was this translation helpful? Give feedback.
-
In regards to this:
Does that mean that the files must remain in the watched folder structure? Based on my understanding, I thought Immich would make a full copy of all the images and effectively import the images at original quality - negating the need for the original files to stay in the watched folder. I understand why people might want to keep the files in the watched folder, but for me personally, when Immich is ready I am moving all my images underneath it - I won't want to bother with traditional file structures anymore. It would be awesome if there was an option to instead use the watched folder as a sort of queue for importing into Immich and once an image is imported it would be deleted from the watched folder (indicating it has been imported). Or if that is too scary, at least allow one to delete the images manually from the watched folder to prevent too much space being used up. Otherwise, this sounds like an awesome feature. Looking forward to it! |
Beta Was this translation helpful? Give feedback.
-
Here are some of my thoughts about this, in no particular order: First of all, I noticed that the main thing users expect from #7 is a way to drop files into a folder and have them automatically uploaded to immich as their user. I see that there are two main ways to approach this.
(1) A filesystem viewI would personally advise against permanent asset storage in the user-directory as described in (1). I can see that this will become a very complex part of immich and may create a whole myriad of problems in the future. Here are some thoughs about that:
(2) A consume-only directoryAll of these problems can be avoided by instead opting for a simpler approach that still solves #7: A consume directory (2). The user can dump all files that should be added to immich into a specific directory, and they will be processed by immich automatically.
A popular self-hosted document management system called Their idea is to allow configuring a separate storage path for each user (and maybe each album), that defines where immich will place the stored assets. But this directory is read-only to the user, and modifying the content is not allowed. This guarantees that immich doesn't need to implement the complex scanning and database resynchronization methods, while still allowing users to view their assets via e.g. SMB. This would require only minimal changes to what immich does today, because the database can stay the same. Just the filesystem path for uploaded files would have to be set dynamically. NOTE: To allow user's to have good browsing experience outside of immich, I would advise to not store images with their uuid as the name, but instead with a generated name that is naturally sortable like Multi-user supportInstead of forcing a specific file-structure, I would apply the same "storage paths" principle introduced before. There is a global storage
By using the "consume" approach, the images folder would then look like the following:
3. Handling of symlinksI would not handle symlinks encountered in consume directories in any special way. They should never occur. If you instead opt for the view-approach, symlink handling must be supported and could become more complex (detect original? what if original isn't in immich's view folder?). When providing configure asset storage paths, symlinks could be managed by immich to provide up-to-date views into albums even on file-system level. These are just my opinions and initial thoughts about the matter. I hope they will be useful in your decision process, but as always: Just do your thing. I'm always happy to provide feedback. |
Beta Was this translation helpful? Give feedback.
-
In my opinion, anything that can't handle a read-only volume with an arbitrary folder structure is out. There should never be any need for the application to write to the folders of the original images. Also, forcing a user to adhere to a specific folder-structure is an absolute no-go. |
Beta Was this translation helpful? Give feedback.
-
I was one of the guys that was waiting for having the ability to import existing photos. However, I was hoping to be able to import my existing photos without a second copy and maintaining my current structure of files (or making same adaptations, but without compromising my ability to stop using immich and going back to samba ahahah). The reason is simple, no one wants to be locked to a software. So my opinion will be directed to my use case of course. (1) A filesystem view (2) Consume-only directory with files deleted after import Therefore, I think these are two distinct features. The only thing they have in common is the need for monitoring the filesystem. |
Beta Was this translation helpful? Give feedback.
-
While I love the idea of a pristine source directory - which probably works best with docker - I'm looking forward to a non-container installation. So while I can't comment on the given workflow, this is a feature I'm also interested in. I'd also accept a processing folder which does copy files in and potentially duplicates them in an out-folder, because I'm hoping for a facility that recreates the pic with a few embedded thumbs, updated data and a new filename (based on templatable form) to enforce a standard -- and it has to be geriatric-friendly for the users I'm thinking, so a copy-here workflow works best there. So I have big hopes, but the current workflow isn't included. ;-) Good luck! |
Beta Was this translation helpful? Give feedback.
-
It would be amazing if immich allowed multiple read only photo libraries. I have multiple locations with different types of photos. I have my own photos, family photos, internet photos as well as professional photos. I tried making multiple accounts to manage this but that doubles the storage requirements and there is no easy way to switch accounts. I think the way Plex manages this would fit immich perfectly. It allows you to create multiple libraries of photos with different folder locations and you can choose to individually share libraries with other users. Some thoughts... For the frontend
For the backend
|
Beta Was this translation helpful? Give feedback.
-
I potentially would use this feature for my existing photos, and non-mobile photos (e.g. taken on DSLR). How is the "moved" detection meant to work (i.e. what uniquely identifies a particular photo)? It sounds like the filename would be what is used, but for my camera it often reuses filenames/numbering (e.g. after formatting the memory card; or every 1000 photos it starts a new folder and the numbering starts again). |
Beta Was this translation helpful? Give feedback.
-
Would use hash probably |
Beta Was this translation helpful? Give feedback.
-
I have my photos stored with a cloud service provider currently. Being able to consume read-only directories would enable me to migrate to immich with a higher "family acceptance" factor by allowing them to use it without messing with our old system. Further it would allow parties to keep their own photos seperate if they wanted to remove their photos in the future. It's a large ask but I'd like to see the ability to "hot-swap" sources with the following use case:
Ideally when scanning the new directory the system would recognize that an image has been seen before, has existing metadata (albums, tags etc.) and apply those even though the image is at a new location (new location could be either R/O or R/W) |
Beta Was this translation helpful? Give feedback.
-
I wrote this based on the great input and ideas in this discussion (especially thanks to @oddlama for the in-depth descriptions!) "Feature Wishlist" sorted from easy to more difficult: 1. Import existing library (duplicate file & double storage requirements are ok)This is possible right now: Simply import the library with the CLI. Re-run once new assets are added to external library. Already imported assets are not added twice because immich does not important duplicates. Although this is certainly not an optimal from an efficiency point-of-view, a nightly cron-based batch import of the external library should be good enough. Biggest downside is already mentioned in the headline: This approach creates duplicates and thus uses twice the storage unless the user's filesystem does deduplication. Another issue is that changes to files are not nicely reflected in immich: If the user changes an asset (edit an image, store as new file, remove old) and it is re-imported, immich now shows two images (old and edited). related to #7 2. Consume-only directoryAutomatically add new assets found in the specified dir to immich. This allows users to e.g. automatically import DSLR images stored on their server to immich. Downsides if the files are copied into the consume dir (the user has a second copy in another folder): Similar to 1. Files are stored twice and edited versions produce near-duplicates. Downsides if the files are moved into the consume dir (user has no second copy): User has no control what is done to the consume files. They might just be deleted due to a bug in immich and gone forever (unless the user has proper, functional backups in place). Even if the worst case does not happen, the user has no nice way to get the images out of immich should it die at some point :-( related to #7 3. User defined storageLet the user control how immich stores the assets backed up via app/web, so that there is no vendor lock-in and users can use other software to have a meaningful read-only access the assets stored by immich. An example of another selfhosted project that provides this feature is paperless-ngx (awesome document management for a single user): All documents added to paperless are stored in a configurable folder structure so that you can meaningfully browse the files that are managed by paperless. If the configured path changes, all files are moved/renamed by paperless. Caveat: It's a read-only access - you must not modify or move any document files! Limitations: The user / other software is not allowed to modify files under immich's control! 4. Take control of existing libraryThis basically combines 2. and 3, thus immich provides the single source of truth, i.e. has control over all assets. All existing assets are placed in immich's consume dir and re-structured into the user defined folder structure. Depending on the manually created structure (e.g. year/month/filename), this could actually produce an identical folder layout. If folders were used as albums in the manually created library, producing the same result after the import becomes really tricky since immich supports an asset to be in multiple albums. For more info and possible implementation steps, see the post and comment by @oddlama #1006 (comment) Another selfhosted project that provides this feature is paperless-ngx (see 3. for more info, advantages and limitations). This approach solves some downsides of 2. If the user lets immich consume an existing library without keeping additional copies, the user can import an existing library without taking twice the storage space - yet, the user still retains read access to the all the assets in a meaningful way. Downsides: User must trust immich to not accidentally delete/destroy assets or have a reliable backup. 5. Use existing library together with other services/programsThis is more or less the approach @alextran1502 has described in his initial post. Immich scans an existing folder structure and adds all assets to its database. No duplicates are made, immich only needs read access to the files. In theory, it does not even need watching for changes: Similar to 1. run a nightly cron job to re-index the external library. Delete all assets marked as external that are no longer found, add all that are not yet contained in the DB. Of course, filewatching as an "online scan" is a very valuable addition. But it could be done as a separate feature after the "offline scan" is implemented. Granted, this approach is more difficult than 4., but it is possible to get it right: See e.g. Lightroom, Jellyfin, Kodi, ... For potential issues, see again the post by @oddlama #1006 (comment)
It's more like several APIs: A HTTP API and a filesystem API. However, the filesystem is both API and storage at the same time.
It's not mandatory to reflect changes immediately (but of course, the sooner, the better): From database terminology: We do not need ACID guarantees, eventually consistent works well enough, i.e. it is okay if changes are only visible with some delay.
If a file watcher is used, all the operations are queued and executed in order within immich.
Yes, on server start a full re-indexing is required. Renames can be detected via hashing (first doing all add operations, then delete all assets from DB no longer found on the filesystem)
Agreed. Luckily, the immich server already has a good structure where HTTP Controller and FileWatcher could use the same underlying services (e.g. AssetService, AlbumService etc.)
Use a separate user configurable folder for storing all thumbs (both from internal assets and external assets)
Deleting the DB entry and be done. The user will need to restore that photo from trash (or backup). This is how it always has been before throwing immich into the mix :-) This approach resolves the limitations of 4. Downsides: Implementation complexity. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Would it also be possible to automatically move favorited images to a subfolder, as this might be quite useful for users who want to at first sort out images, and then only share these fotos with other people. I have another good idea for human readable folders. It would be nice, if a Reverse Geolocation Information could be added automatically to the automatically generated folder structure. Like: Also I agree, that users should be able to change the directories. |
Beta Was this translation helpful? Give feedback.
-
Awesome thread with a lot of great ideas. Also really excited if this can get implemented. I would like to give kudos for the current implementation, i think that the primary benefit of Immich is that it is at very good backup tool and that it can put files in a directory as expected with templates. An issue for me however is owning a "proper" camera, which creates very large files (Raw 45~ MB) compared to my phone. I usually use my camera for family gatherings, travel etc. While im happy with how my phone is backed up, for me it is essential to have my camera photos in separate folders, like an "album" for easy uploading and maintaining huge files which are grouped together. I would not like this to be simply "consumed". This has another benefit, which is that i can separate my personal photos with the ones i would like to share with my family. I think (if possible), that a good solution would be to give the admin user the possibility to have "shared" directories with other users. Like sharing an album which is actually just its own directory folder. This would also make it easier to do external backups, and again separating personal with shared files. |
Beta Was this translation helpful? Give feedback.
-
Heyya... @alextran1502 I was wondering if there's any chance this feature is going to get implemented sometime soon or if you can share your current thoughts on timeline? |
Beta Was this translation helpful? Give feedback.
-
Is there any way to sponsor especially this Feature ? |
Beta Was this translation helpful? Give feedback.
-
did I understand it correctly that when this feature is implemented I can use the pictures in \volume1\pictures as main path for the albums, e.g. \volume1\pictures\2023 Bodensee, \volume1\pictures\2023 Frankreich? For me it's important that I did not have to upload the pictures again in Immich (having all the files double). Then a periodic scan for new files in that directory whould be good (e.g. at 4 am in the night). Another important thing is that I can deactive the deleting of pictures in Immich, so only via stystem it is possible to delete pictures (that I did not delete pictures when I did not want to delete ones). |
Beta Was this translation helpful? Give feedback.
-
Another thing that should be mentioned and I wasn't able to find in the issue or in this discussion is the following: Currently I organize my photos (DSLR and mobile) in the following way:
When the read only mode of Immich is implemented it would be nice to add a ignore file (for example like git) to ignore certain subdirectories or even file types from importing. In my special use case I would only import my edited photos to Immich but not the original RAW files. Great project and thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
Hey, it's the most requested feature, are there any plans or roadmap for implementing this feature? |
Beta Was this translation helpful? Give feedback.
-
For those who want to track my progress in implementing this awesome feature, see this PR: #3124 |
Beta Was this translation helpful? Give feedback.
-
Fixed in #3124 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This discussion thread discusses implementing the most-wanted and missing feature of Immich #7 .
Gallery watcher
Below are some of my initial thoughts.
There will be an additional
WATCH_LOCATION
in the.env
file, pointing it to the gallery folder.The user can opt-in to use this feature or leave it commented out not to trigger the watch functionality of the server.
User story
What
How
WATCH_LOCATION
MVP
1. Initial scan
2. Subsequent start-up and scan
isWatchedFolderAsset
for ease of querying in the database to distinguished the uploaded asset vs the gallery's asset.3. Handling of symlinks
unsure
4. Actions when new files are added
5. Actions when existing files are removed
6. Actions when existing files are moved
7. Multi-user support based on their email address in the watched folder
Technology
server
andmicroservice
containerBeta Was this translation helpful? Give feedback.
All reactions