ShokoAnime / ShokoServer

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

Fix AniDB languages not being updated properly #1052

Closed Mik1ll closed 1 year ago

Mik1ll commented 1 year ago

Noticed this while testing my renamer, when a file has either no dub or no sub AniDB returns "none" in the UDP response for the track languages. This is being incorrectly saved to the DB and will return as "Unknown" in the renamer interface. Fixed by ignoring "none" and returning an empty list.

The languages pulled fron AniDB were not syncing with the DB correctly when using update file info. CreateLanguages in CommandRequest_GetFile.cs did not create a transaction and commit it. Observed duplicate language entries being created, and none deleted upon multiple updates.

The condition for updating the languages was if the returned count of languages from AniDB was > 0, changed to only check if the response was null, tracks can be deleted on AniDB and should be deleted in DB.

revam commented 1 year ago

I forgot to read the PR message, nvm me.