You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Support for Blacklisting AniDB Tags in the Agent Options
also added:
- a switch from tuple to set in the title_case function and ambiguous title check for a minor performance gain
- backwards compatibility for 'rescan-recent import' on older versions of the v3 API
- a check for empty values in the agent language prefs
tag_blacklist= {t.strip().lower() fortin (Prefs['tagBlacklist'] or'').split(',') ift.strip()} # Prepare a set comprised of any blacklisted tags (lowercase)
146
+
tag_c_ratings= {'kodomo', 'mina', 'shoujo', 'shounen', 'josei', 'seinen', 'borderline porn', '18 restricted'} # Prepare a set comprised of tags required for content ratings (lowercase)
145
147
fortagin [tfortinseries_tagsift['Source'] !='User']: # Exclude custom user tags from any tag operations
146
-
if (tag['Weight'] ==0ortag['Weight'] >=int(Prefs['minimumTagWeight'])): tags.append(title_case(tag['Name'])) # Convert tags to title case and add them to the list
if (weight==0orweight>=int(Prefs['minimumTagWeight'])) andindicatornotintag_blacklist: tags.append(title_case(tag['Name'])) # Add title case tags to a list if they meet the minimum weight and aren't in the blacklist
147
150
## Prep weight based content ratings (if enabled) using the content indicators described here: https://wiki.anidb.net/Categories:Content_Indicators
ifindicatorintag_c_ratings: c_tags.add(indicator) # If a tag is present that is required for content ratings add it to a set to avoid the tag blacklist interfering
150
153
ifindicator=='nudity'orindicator=='violence': # Raise ratings for the "Nudity" and "Violence" tags to TV-14 and then TV-MA if the weight exceeds 400 and 500 respectively
151
154
ifindicator=='nudity': descriptor_s='S'# Apply the "Sexual Situations" descriptor for the "Nudity" tag
152
155
ifindicator=='violence': descriptor_v='V'# Apply the "Violence" descriptor for the "Violence" tag
ifnotep_title: ep_title, lang=ep_titles['shoko'], 'shoko (fallback)'# If not found, fallback to Shoko's preferred episode title
277
280
ifPrefs['tmdbEpGroupNames'] andtmdb_ep_group>1andtmdb_ep_title: ep_title, lang=tmdb_ep_title, 'shoko (TMDB Ep Group)'# If TMDB episode group names are enabled and a group is present override the title
278
281
279
282
# Replace ambiguous single entry titles with the series title
iflang!='shoko': ep_title=try_get(series_titles, lang, ep_title) # Exclude "shoko" as it will return the preferred language for series and not episodes
285
288
ifep_title!=original_title: break
286
289
ifep_title==original_titleandtmdb_ep_title: ep_title_mod, ep_title='(TMDB) [LANG]: ', tmdb_ep_title# Fallback to the TMDB title if there is a TMDB Episodes match
# Words to force lowercase in tags to follow AniDB capitalisation rules: https://wiki.anidb.net/Capitalisation (some romaji tag endings and separator words are also included)
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,7 @@ Enable the following options in Shoko to ensure that Plex has at least one sourc
61
61
- Will move common series title prefixes like "Gekijouban", "Eiga" etc. to the end of the title
62
62
- Removes the original tag hiding options and replaces them with a tag weight system similar to what [HAMA](https://github.com/ZeroQI/Hama.bundle) uses
63
63
-**Note:** Automatically ignores all tags from Shoko's [TagBlacklistAniDBHelpers](https://github.com/ShokoAnime/ShokoServer/blob/9c0ae9208479420dea3b766156435d364794e809/Shoko.Server/Utilities/TagFilter.cs#L37) list
64
+
- Supports manually excluding any unwanted AniDB tags
64
65
- Series and movies will list the Studio as Animation Work (アニメーション制作) or Work (制作)
65
66
- Support for:
66
67
- Files which contain more than one episode or episodes which span multiple files
0 commit comments