I notice that this update didn’t fixup all pre-existing mismatches between year
and originally_available_at
. I was surprised by weird year
values for a large number of TV episodes - things I haven’t updated recently.
It appears that Refresh Metadata
doesn’t forcibly update all mismatches either. (It does when Originally Available At is modified.)
So I’m considering running this:
UPDATE metadata_items
SET year = STRFTIME('%Y',originally_available_at,'unixepoch')
WHERE
(
originally_available_at IS NOT NULL
AND
(
year IS NULL
OR year <> STRFTIME('%Y',originally_available_at,'unixepoch')
)
);
Edit: I made a backup and did it. I’ll let you know if anything explodes.
Edit a month later: Nothing explodes. I’ve used it again to fix more bad dates from the agents.