I believe there is a problem with the formatting of the Moviebase backup files that could prevent their working properly if we needed to do a restore. All the sections look correct to me except for one. The “watched” section for TV Show episodes looks wrong. My backups show that I have watched over 31,000 episodes. Some of those episode items (fewer than 1,000) seem to be formatted properly with each item’s entry starting with a mediaID. Most of the watched episode item entries (over 30,000), however, do not start properly with a mediaID. I believe this would prevent their being matched properly with the detail episode entries at the end of the backup json file. I am attaching some screenshots below to demonstrate the problem.
Most of the watched episode items look something like this. Note that the mediaID is not present for these items:
I have been investigating this further. It appears that episodes that are added to the history now will properly have their mediaID included with their metadata so it will be available in the Moviebase backups. If I remove episodes from the history and re-add them, then the backups will properly show their mediaID in the episode watch history. Obviously, for someone like me who has over 30,000 episode history entries, it is not practical to manually remove and re-add all of them.
Since it seems that for a long time the mediaID was not properly included in the episode history item metadata, perhaps you could write something that would scan the database and automatically add the mediaID to those episode history entries that do not have them. I don’t know exactly how your restore process works, of course, but I would be surprised if a restore would properly recreate these episode history entries that do not contain a mediaID in the backup json.
Good research. Some episodes don’t have a mediaId (TMDB ID) when the data from TMDB hasn’t been fetched. This can happen when loading from trakt, for example.
Episodes without a mediaId will be added to the progress but might be not shown in the watched page until the data has been fetched.