-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: overhaul tag internals + add content ratings
- Overhauled the internals for how we processed tags. We now use the tag hierarchy to filter it locally instead of the flat lists used on the Shoko Server side, which allows us to avoid magical numbers and also gives us more control when searching for tags in the hierarchy. - Custom tag support have also been overhauled to support a _fake_ hierarchy by using `/` (forward slash) as a separator between levels in the tag name. All top level custom tags without "child" tags are added to the list if custom tags have been enabled, while all tags in the second level or below are treated as if they are of the AniDB hierarchy and will follow the other enabled/disabled tag sources, e.g. if you enable "elements" tags then it will also affect any custom tags starting with "elements/". This overhauled support for custom tags also allows us to better support the next item on the list. - Added _assumed_ content ratings based on the AniDB tag hierarchy. This will use the `content indicators` tags and `elements` tags in the hierarchy to make an assumption of the content rating for the AniDB anime using the following content indicators; - TV-G - TV-Y - TV-Y7 (optionally with the FV indicator applied) - TV-PG (optionally with D, L, S, and/or V indicators applied) - TV-14 (optionally with D, L, S, and/or V indicators applied) - TV-MA (optionally with L, S, and/or V indicators applied) - XXX (only for H) We also support custom overrides through custom tags in the form of the regular expressions (regex); ```txt /^\/?target audience\/(?:TV)?[_\-]?(?:G|Y|Y7|PG|14|MA|XXX)[_\-]?(FV|D|S|L|V){1,5}$/i ``` A few examples that all resolve to the `TV-PG` rating if you can't read regex; - `target audience/TV-PG` → `TV-PG` - `Target Audience/TV-PG-DV` → `TV-PG` + `D` & `V` indicators applied - `Target Audience/TV_PG_ld` → `TV-PG` + `D` & `L` indicators applied - `/target audience/pgV` → `TV-PG` + `V` indicator applied - `/TARGET AUDIENCE/tvPGsl` → `TV-PG` + `L` & `S` indicators applied Where you will override the content rating for the series if the custom tag is applied in Shoko Server/Shoko Desktop. - Added production locations based on the AniDB tag hierarchy. This is much simpler, as it's a 1:N mapping for the relevant AniDB tags to production locations. - Overhauled the settings page to accommodate the new settings added in this commit under the Metadata section while also removing the old Tags section. In case it wasn't obvious, **THIS IS A BREAKING CHANGE**. 🙂 **Note**: TMDB content ratings and production locations will be usable when when the data is available in Shoko Server.
- Loading branch information
Showing
17 changed files
with
1,951 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.