reactively update the library + exif data #792
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
thank you to all the contibutors/authors for maintaining the repo in a clean and easy to understand, organized way.
note: I am not even sure if this PR is the right way to contribute or begin. I just wanted to address a issue where photoview scan is resource intensive (cant find it rn) and fsnotify is a way to reactively sync photoview .
of course, only fsnotify is not going to ensure it remains in sync. periodic scan is needed to ensure missed events are reprocessed. For the same, I propose comparing
media.updated_at
db timefield with mediafile'smodtime
field and reprocess media if latter is updated.Detail
The server subscribes to fsnotify events for all the albums in the albums table. for each event, it ll sync photoview db + media_cache, as follows:
if the media file modtime is later than what exists in the db (media.updated_at time), then ideally the corresponding photoview data should be refreshed.
Current status of the PR: it worked on my manual testcase
I ll continue to work on it, test and ask for comments once its done. meanwhile, all advice, knowledge is welcome. golang is not my programming lang of expertise.
note: The PR is in a pretty bad condition currently. ll update it once I feel the code is production grade + testcases are there sufficiently.