Skip to content
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

Bugfix/offset or ignore #902

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

grasdk
Copy link
Contributor

@grasdk grasdk commented May 11, 2024

New boolean option "Ignore timstamp offsets", default value true.

When enabled, searching, sorting, grouping and filtering uses the picture metadata's local time instead of the global time.

So two pictures taken at e.g. 11.00.00 AM 12 hours apart on opposite sides of the globe, will show up, when searching for dates that include this time.

Should solve: #871 and #892

@grasdk
Copy link
Contributor Author

grasdk commented May 11, 2024

@bpatrik, @mcdamo

Added a Config setting "ignore timezone offset". When set, timestamps are handled as if they are local when searching and sorting. I also changed the handling in filtering, but did not see any effect on the drop-down filter, but I thought the code change was for the better anyway. New issue about the filter should probably be created, unless it's just me who don't understand how to use it ;)

When changing the setting, once has to hard-reload (CTRL-F5) to get the effect when coming back from settings to the gallery.

I still think that it might be nice/fun to switch this setting at the search/filter/sort controls instead of in the admin panel, but it's not crucial for the usability.

Also I managed not to touch the metadata. I wouldn't like to "lie" about the metadata, by putting in false data. Now it's all available and the UI controls how it's used ;)

@grasdk grasdk closed this May 11, 2024
@grasdk grasdk deleted the bugfix/offset-or-ignore branch May 11, 2024 23:09
@grasdk grasdk restored the bugfix/offset-or-ignore branch May 11, 2024 23:13
@grasdk grasdk reopened this May 11, 2024
@grasdk grasdk force-pushed the bugfix/offset-or-ignore branch 2 times, most recently from cf1e491 to 8120997 Compare May 11, 2024 23:42
@grasdk
Copy link
Contributor Author

grasdk commented May 23, 2024

@bpatrik Commenting on our talk. The changes here basically amount to

  • Adding a config parameter (src/common/config/public/ClientConfig.ts)
  • Adding an if-sentence to all database queries, in order to adjust the where clause (src/backend/model/database)/SearchManager.ts
  • Changing direct use of metadata.creationDate to a function call that adjusts whether or not to incorporate timestamp (all other files using metadata.creationDate)
    • including src/frontend/app/ui/gallery/filter/filter.service.ts, where I don't get the expected effect on my demo-setup.

@bpatrik
Copy link
Owner

bpatrik commented May 23, 2024

@bpatrik Commenting on our talk. The changes here basically amount to

* Adding a config parameter (`src/common/config/public/ClientConfig.ts`)

* Adding an if-sentence to all database queries, in order to adjust the where clause (`src/backend/model/database)/SearchManager.ts`

* Changing direct use of metadata.creationDate to a function call that adjusts whether or not to incorporate timestamp (all other files using `metadata.creationDate`)

* * including `src/frontend/app/ui/gallery/filter/filter.service.ts`, where I don't get the expected effect on my demo-setup.

Can you describe what do you expect and what do you get? Do you maybe have a screenshot?

update: You will probably need to update the UI too (html file) to properly handle the timezone. As now the filter timezone number changes based on the config value.

@grasdk
Copy link
Contributor Author

grasdk commented May 25, 2024

Can you describe what do you expect and what do you get? Do you maybe have a screenshot?

With the "Ignore" enabled:
When the demo folder 4MinsAroundTheWorld is opened, I would expect the filter to have min date the 13th and max date the 14th. Sliding the slider would remove pictures according to their local date.

With the "ignore" disabled:
Same functionality but with 13th being both max and min date (but the slider still works for hours and minutes).
...
When wanting to provide screenshots, I did a total rebuild, and now the filter also works! :) So you can ignore my "bug" report og missing fix for this PR. :) All seems to work as expected.

With the "ignore" setting enabled:
image
image

And with the "ignore" setting disabled:
image

PS: Slider is unresponsive in latest Firefox (115.11.0esr (64-bit)). Got a few addons installed, but they should not interfere, but I'll investigate further. Nevertheless it has nothing to do with this PR :) All works in Chrome.

update: You will probably need to update the UI too (html file) to properly handle the timezone. As now the filter timezone number changes based on the config value.

I didn't have any issue here, except having to force a reload after switching the config toggle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants