ShokoAnime / ShokoServer

Repository for Shoko Server.
http://shokoanime.com/shoko-server/
MIT License
386 stars 75 forks source link

Refactor episode updates #1036

Closed revam closed 1 year ago

revam commented 1 year ago

This refactor is mainly to prevent episodes moving between different series from throwing errors. I changed it so the code tracks when an episode was last updated at the remote (or in the entry stored in the cache), and made it so it conditionally updates the episode record and/or updates the episode title records accordingly.

Also, for the best compatibility with updating existing episode entries did I add a database migration to reset the last updated timestamp on all existing anidb episode records. This won't affect anything other than it will force the episode records to be updated on the first anime refresh/update — be it from the cache or online — after this PR has been merged.

revam commented 1 year ago

I'll get to it... when I have time and energy to do it. 'It' being "updating the database migration."