Skip to content

Conversation

@SilentNightx
Copy link

@SilentNightx SilentNightx commented Dec 17, 2025

Related Issues

Summary

  1. Now it doesn't prioritize specific fields, it instead prioritizes the oldest date found in the candidate fields. This should provide much more accurate dates and also fix the problem where if we prioritize tags commonly used for iPhone videos then Android videos have the wrong sort order and vice versa. If the oldest datetime is shared between fields it chooses the most precise one between no seconds, seconds, and subseconds.
    PERFORMANCE IMPACT: Very minimal and necessary for proper sort order.

  2. Uses two calls to exiftool per media item. One with -n for GPS coordinates and one without -n for anything else. I found using -n causes issues with how exiftool reports date strings with subseconds and timezones. This change allows us to support subseconds and makes it so most dates come out of exiftool with a proper timezone already attached. The only time the parser manually handles timezones now is when the oldest candidate date found lacks timezone info.
    PERFORMANCE IMPACT: Very minimal. If we really want to we could reduce this to one call again if we manually parse the GPS info from the first exiftool call. Not sure which is faster.

  3. Now handles more datetime EXIF fields and formats.
    PERFORMANCE IMPACT: Basically none.

  4. Now uses a fallback method to get timezone information from GPS coordinates if it can't be gathered from the planet database. It uses Python timezonefinder so Python 3.9+ must be installed on the server and most of the time it is by default on modern distros. This allows us to still get timezone information for Android videos (important for sorting) on SQLite instances or if the planet dataset isn't installed. The timezonefinder library and dataset is in the python directory and can be updated with pip install --upgrade timezonefinder --target /var/www/html/nextcloud/apps/memories/python. This is where the scary number of "files changed" comes from.
    PERFORMANCE IMPACT: Large, but this code pretty much only runs on single-user instances, since large instances will likely be using PostgreSQL, MySQL, or MariaDB and the planet dataset. And on single-user instances without the planet dataset this code still only runs when it needs to for proper timezone gathering.

  5. Now media is categorized into days based on the day they were taken in the media item timezone so they don't show on the wrong day when they are past midnight UTC.
    PERFORMANCE IMPACT: Basically none.

  6. Changed some UI elements to show dates based on the media item timezone.
    PERFORMANCE IMPACT: Basically none.

IMPORTANT NOTE: Will need to clear/force reindex files and clear browser cache to have photos show correctly with these changes.

If you have media that had dates previously converted to UTC from another timezone and saved back into the file EXIF dates, and didn't have its old timezone offset removed from the dedicated EXIF offset fields in the process, then reindexing it will move it off from where it should be by your timezone offset. I don't have time to look into it but somebody should double check that Memories doesn't do this when editing metadata, because that would be bad whether or not my PR is merged.

The way Date/Time metadata is edited in Memories should also eventually get some work done to bring it in line with my changes. I suggest showing the Date/Time in the media item timezone instead of UTC and adding an edit box for the timezone offset.

The way the Android app sorts local photos should also get brought in line with these changes at some point.

First contribution to a repo that isn't my own ever so go easy on me please 🙏.

Solved various issues with day grouping, sort order, and timezone gathering.
difanta added a commit to difanta/memories that referenced this pull request Jan 17, 2026
Put the mobile app in line with the changes of pulsejet#1588.
Add null checks to solve problems for certain buckets not synchronizing.
difanta added a commit to difanta/memories that referenced this pull request Jan 17, 2026
Put the mobile app in line with the changes of pulsejet#1588.
Add null checks to solve problems for certain buckets not synchronizing.
difanta added a commit to difanta/memories that referenced this pull request Jan 17, 2026
Put the mobile app in line with the changes of pulsejet#1588.
Add null checks to solve problems for certain buckets not synchronizing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant