If there's one thing that I seem to be particularly good at, it's investing time on the wrong things. Today is a perfect example of this, as I was not at all happy with NextCloud's display of 10-year old photos as being less than two weeks of age. The actual source of the issue is irrelevant here, as it's my solution that would seem like overkill to anyone who is not me.
A complete description of the problem would be this:
Over 30,000 photos and videos captured since the mid-2000s from multiple sources with multiple different file naming conventions exist on my NextCloud server. All of these show a modification date as being no earlier than December 12, 2018, when the system was set up and several hundred gigabytes of images were imported. While this is technically accurate, I want to see the actual last modification date for these photos, most of which have never been modified since their creation.
NextCloud apparently has a function that will do this for you called ExifTool, but I've been unable to get this to work. Since I am not one to walk away from situations like this, I did what I typically do when confronted with a suboptimal situation: I wrote some code to do this for me.
For most photos and videos taken after December 2006 and before August 2008, the files contain the date and time in the metadata in GMT -8. For just about every photo and video taken after August 2008 — except for my wedding photos — the metadata has the proper time in the metadata in GMT +9. The wedding photos are GMT +0 and anything with a date of before the year 2000 is considered inaccurate. However, for files that are in 000 MMDDYY.jpg format, the date can be reversed out based on the name, and the time will be set to noon GMT +0, which is likely to be more or less accurate within a 12-hour window. Impreceice, but better than appearing as though it was a recent file captured on an "ancient" 3.2MP Fujifilm point-and-shoot camera.
To make this work, every file would be opened and checked for metadata. If a valid date value existed, it would be converted to the proper GMT +0 timestamp and data in the NextCloud database would be updated accordingly. If no valid date value existed or the file did not contain Exif data, then the file name would be checked to see if it contained a date format or the 000 MMDDYY naming convention I used to employ, and data in the NextCloud database would be updated accordingly. If the file was still unable to have its creation date recorded, then it would be added to a list for me to manually examine later. Easy, right?
45 minutes of coding went into building the tool and the system ran for a short while to process all the data. 29,813 of the 30,711 files have been properly updated, leaving fewer than 1000 that I need to look at and decide if I care enough to fix. Of course, if any patterns can be found that would allow a date to be reversed out, then I'll update the program and run it again. Only non-processed records would be hit with subsequent runs of the procedure, of course.
It's at this point I wonder if I'm just creating work for myself when there are clearly better things that I could be doing with my time. I could learn opera, or plant a tree, or read the newspaper on the front porch while a cup of coffee quickly freezes beside me. But no. Instead I decide to invest my time into fixing dates and times that nobody will likely ever see just to appease my own sense of temporal linearity.
Do other programmers do this? Do "normal people" ever think about doing this? I can't be the only person in the world who insists that data be as accurate as possible lest it be deemed untrustworthy or — heaven forbid — utterly useless. However, when I have conversations with people involving informational completeness, otherwise known as "data management", I get stares as though I'm unnecessarily obtuse.
Questions aside, when I look at the state of modern technology and the things people are actively creating it's clear that very few of us are working on real issues that adversely affect the lives of others. Instead a lot of us are building solutions to imaginary problems that can be categorised as a "mild frustration" or a "first-world problem". Some may be disappointed with this reality, but not me. The fact that we can invest so much of our time into the things that we perceive to be a problem is a wonderful thing. We are living in truly interesting times.