Closed revam closed 1 year ago
Ok, after those two changes, looks good
Also updated the tests and added back some of the custom behavior that I broke.
Fixed the tests (again) and ensured we always have lower case letters
Is this ready for merge now? @da3dsoul
Do we want lowercase tag names?
I made it so it ensures the tag name is always lower case because the tag filter expects the values to be lower case (as indicated by the hash sets. Alternatively I can change it so it changes it to lower case the value right before it's used in the tag filter. Actually, I'll do that instead. I'll also tweak the tests to test that it does not matter if the input tags names are upper cased, lower cased or a mix of the two.
I'll review it again later. I had adjusted the case stuff intentionally to improve the speed. I'll also add unit tests to take casing into account
Ok, looks good
This commit/PR changes some of the data we store about tags, update how we handle tag renaming and exposes some new data in the api. I've tested that it works with a SQLite database, but have not tried for MySQL or SQL Server.
Changes in this PR
Updated the Anidb_Tag and Anidb_Anime_Tag tables to better align with the data present in the anime http xml dumps. This is mostly for adding some missing-but-useful information like the verified status of the tag, parent tag id for parsing the tag hierarchy, the last updated timestamp for comparing if we want to update the tag details and to prevent older tag details from overwriting newer details. These changes also involve converting int booleans to booleans in code, moving the local spoiler boolean from the tag to the anime↔tag cross-reference where it belongs, and removes some old and now unused fields from both tables.
Added a name override for some anidb tags, mainly "original work" → "source material" and "new" → "original work" for now. These overrides are used both internally and externally to be backwards compatible with v1 and v2, but are stored separately in the database so we can still use the source name when updating the tags.
Tweaked (and simplified) the tag filter. Removed the logic to replace and rename tags, but kept the logic for adding the "original work" tag if no source material tag is set.
Database migrations and a database fix to fix up the tags after the migration.
Updated the v1 and v2 api so they only display verified tags, since unverified tags are still pending approval by a moderator on anidb. If a tag later becomes verified then it will be reflected in the apis once we've downloaded an anime http xml dump containing the updated tags.
Updated the v3 api to only show verified tags by default, but have the ability to also show unverified tags. Also updated the v3 api model to display the new data for the anidb tags.
Upated the tests for the tag filter.