Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding support for does the dog die warning labels operation #1913

Draft
wants to merge 5 commits into
base: nightly
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/config/doesthedogdie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# DoesTheDogDie Attributes

Configuring [DoesTheDogDie](https://doesthedogdie.com/) is optional but is required for MyAnimeList based operations to function.

A `doesthedogdie` mapping is in the root of the config file.

Below is a `doesthedogdie` mapping example and the full set of attributes:

```yaml
doesthedogdie:
apikey: ################################
```

| Attribute | Allowed Values | Required |
|:----------------|:--------------------------------------|:------------------------------------------:|
| `apikey` | DoesTheDogDie API Key | :fontawesome-solid-circle-check:{ .green } |

All other attributes will be filled in by Plex Meta Manager.

To connect to DoesTheDogDie.com you must create an account and retrieve your API Key:

1. [Create an account](https://www.doesthedogdie.com/signup) or [Log-in to your existing account](https://www.doesthedogdie.com/login)
2. Navigate to [Your Profile](https://www.doesthedogdie.com/profile)
3. Select REVEAL next to API Key to obtain your API Key
30 changes: 30 additions & 0 deletions docs/config/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,36 @@ You can create individual blocks of operations by using a list under `operations
mass_imdb_parental_labels: severe
```

??? blank "`mass_does_the_dog_labels` - Adds Does The Dog Die warning labels to every item in the library.<a class="headerlink" href="#mass-does-the-dog-labels" title="Permanent link">¶</a>"

<div id="mass-does-the-dog-labels" />Updates every item's labels in the library to match Does The Dog Die warnings.

???+ warning

Does The Dog Die does not match on ID, only on title and year. Please reference the `strict_search` property to configure this behavior.

<hr style="margin: 0px;">

**Attribute:** `mass_does_the_dog_labels`

**Accepted Values:**

<table class="clearTable">
<tr><td>`label_mode`</td><td>Mode for labeling. Simply `dog`, `all` for every category the site offers, `remove` to remove existing labels or comma separated list of categories</td></tr>
<tr><td>`strict_search`</td><td>If no exact match by year, setting this to True controls if we should discard results or if False take the top result. Defaults to False.</td></tr>
</table>

???+ example "Example"

```yaml
libraries:
Movies:
operations:
mass_does_the_dog_labels:
strict_search: false
label_mode: Animal,Abuse,Sexism,Addiction,Children
```

??? blank "`mass_collection_mode` - Updates the Collection Mode of every item in the library.<a class="headerlink" href="#mass-collection-mode" title="Permanent link">¶</a>"

<div id="mass-collection-mode" />Updates every Collection in your library to the specified Collection Mode.
Expand Down
42 changes: 42 additions & 0 deletions json-schema/config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,48 @@
"type": "string",
"enum": ["none","mild","moderate","severe"]
},
"mass_does_the_dog_labels": {
"type": "string",
"enum": [
"all",
"dog",
"Animal",
"Abandonment",
"Abuse",
"Addiction",
"Assault",
"Bodily Harm",
"Children",
"Creepy Crawly",
"Death",
"Disability",
"Drugs/Alcohol",
"Family",
"Fear",
"Gross",
"Large-scale Violence",
"Law Enforcement",
"LGBTQ+",
"Loss",
"Medical",
"Mental Health",
"Noxious",
"Paranoia",
"Pregnancy",
"Prejudice",
"Race",
"Relationships",
"Religious",
"Sex",
"Sexism",
"Sickness",
"Social",
"Spoiler",
"Vehicular",
"Violence",
"remove"
]
},
"mass_collection_mode": {
"type": "string",
"enum": ["default","hide","hide_items","show_items"]
Expand Down
19 changes: 18 additions & 1 deletion modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from modules.ergast import Ergast
from modules.icheckmovies import ICheckMovies
from modules.imdb import IMDb
from modules.doesthedogdie import DogDieChecker
from modules.github import GitHub
from modules.letterboxd import Letterboxd
from modules.mal import MyAnimeList
Expand Down Expand Up @@ -48,6 +49,11 @@
"moderate": "Add IMDb Parental Labels for Moderate or Severe",
"severe": "Add IMDb Parental Labels for Severe"
}
dtdd_label_options = {
"dog": "Does the dog die",
"default": "Default trigger warnings",
"all": "Label all triggers (almost 200)"
}
mass_genre_options = {
"lock": "Lock Genre", "unlock": "Unlock Genre", "remove": "Remove and Lock Genre", "reset": "Remove and Unlock Genre",
"tmdb": "Use TMDb Genres", "imdb": "Use IMDb Genres", "omdb": "Use IMDb Genres through OMDb", "tvdb": "Use TVDb Genres",
Expand Down Expand Up @@ -118,7 +124,7 @@
"mass_critic_rating_update": mass_rating_options, "mass_episode_critic_rating_update": mass_episode_rating_options,
"mass_user_rating_update": mass_rating_options, "mass_episode_user_rating_update": mass_episode_rating_options,
"mass_original_title_update": mass_original_title_options, "mass_originally_available_update": mass_available_options,
"mass_imdb_parental_labels": imdb_label_options,
"mass_imdb_parental_labels": imdb_label_options, "mass_does_the_dog_labels": "dict",
"mass_collection_mode": "mass_collection_mode", "mass_poster_update": "dict", "mass_background_update": "dict",
"metadata_backup": "dict", "delete_collections": "dict", "genre_mapper": "dict", "content_rating_mapper": "dict",
}
Expand Down Expand Up @@ -722,8 +728,14 @@ def check_for_attribute(data, attribute, parent=None, test_list=None, default=No
logger.info("")
logger.separator(f"Skipping {e} Playlist File")

self.general["doesthedogdie"] = {
"apikey": check_for_attribute(self.data, "apikey", parent="doesthedogdie", default_is_none=True)
}

self.TVDb = TVDb(self, self.general["tvdb_language"], self.general["cache_expiration"])
self.IMDb = IMDb(self)
if self.general["doesthedogdie"]["apikey"]:
self.DogDieChecker = DogDieChecker(self, self.general["doesthedogdie"]["apikey"])
self.Convert = Convert(self)
self.AniList = AniList(self)
self.ICheckMovies = ICheckMovies(self)
Expand Down Expand Up @@ -945,6 +957,11 @@ def check_for_attribute(data, attribute, parent=None, test_list=None, default=No
"configured": check_for_attribute(input_dict, "configured", var_type="bool", default_is_none=True, save=False),
"less": check_for_attribute(input_dict, "less", var_type="int", default_is_none=True, save=False, int_min=1),
}
if op == "mass_does_the_dog_labels":
section_final[op] = {
"label_mode": check_for_attribute(input_dict, "label_mode", default="dog", save=False),
"strict_search": check_for_attribute(input_dict, "strict_search", var_type="bool", default=False, save=False),
}
else:
section_final[op] = check_for_attribute(config_op, op, var_type=data_type, default=False, save=False)

Expand Down
Loading