ShokoAnime / ShokoServer

Repository for Shoko Server.
https://shokoanime.com/
MIT License
412 stars 74 forks source link

fix: add DB migration & endpoint to download missing TMDB People #1203

Closed fearnlj01 closed 1 week ago

fearnlj01 commented 1 week ago

Optionally allows for the complete removal of the person/cast/crew entry if unable to update it.

This allows for a user-driven resolution to the problems that issue #1202 demonstrate.

fearnlj01 commented 1 week ago

This is only a workaround to the original issue... but I needed this to fix my own database so figured that a PR wouldn't hurt, even if it gets closed.

In my own testing, I encountered an NRE for a person ID which appears to no longer exist on TMDB, hence this being the only thing that's caught.

fearnlj01 commented 1 week ago

Confirming that this works fine™ in my SQLite setup.

I removed ~125 TMDB_Person records prior to launching the server, and after the migration occured, hitting the new endpoint resulted in no missing records being found.

fearnlj01 commented 1 week ago

Updated in line with feedback now.

One issue I can forsee... If a TMDB show has been updated in the last calendar hour when the migration runs, it may not update as expected in the event TMDB returns null for a person.

N.B. I've used PersonRecords in favour of People; This is with the intention of keeping it as close to the name for the underlying table as possible. (I will change accordingly if so desired)

revam commented 1 week ago

Updated in line with feedback now.

One issue I can forsee... If a TMDB show has been updated in the last calendar hour when the migration runs, it may not update as expected in the event TMDB returns null for a person.

Just run it with force refresh set to true.

N.B. I've used PersonRecords in favour of People; This is with the intention of keeping it as close to the name for the underlying table as possible. (I will change accordingly if so desired)

Personally, i would had just used peole.