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

Conversation

cwar
Copy link
Contributor

@cwar cwar commented Mar 6, 2024

Description

Hi there! Here is my first attempt at adding support for https://www.doesthedogdie.com/ warning labels as a mass operation.

I have ideas for additional functionality I'd like to add but as this is my very first PR to this project and it's not exactly "small" I thought it'd be a good idea to go ahead and get the PR started. Currently the code is usable.

  • The user can add their API key to the PMM config like they can any other API key.
  • Users add labels to their plex movie libraries by configuring the mass_does_the_dog_labels operation to execute (based on the mass_imdb_parental_labels code)
  • The Operation runs and queries the DTDD API via the module added doesthedogdie.py
  • Configurable label sets are currently:
    • all or remove to get all or none
    • dog to get just the classic "does the dog die" label
    • individually specify categories of warning labels, for example "Animal" gives all related the animal labels.

Let me know what you think! And any guidelines around adding documentation and stuff. I could see the topic and category list being retrieved dynamically or being in a different file but I also see that convention seems to to usually be an external file in a github repo so not sure if that is something I should follow here. etc.

Issues Fixed or Closed

  • Fixes #(issue)

Type of Change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist

  • My code was submitted to the nightly branch of the repository.

@YozoraXCII
Copy link
Contributor

YozoraXCII commented Mar 7, 2024

Missing doc updates

additional I've tried running this locally:

libraries:
  Movies:
    operations:
      mass_does_the_dog_labels: dog
doesthedogdie:
  apikey: 1234567890

and I get this:

| Processing: 1/467 12 Mighty Orphans                                                                |
| Traceback (most recent call last):                                                                 |
|   File "D:\Repositories\Plex-Meta-Manager-DTDD\plex_meta_manager.py", line 703, in run_libraries   |
|     library_status[library.name]["Library Operations"] = library.Operations.run_operations()       |
|                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^       |
|   File "D:\Repositories\Plex-Meta-Manager-DTDD\modules\operations.py", line 148, in run_operations |
|     for category_name in self.library.mass_does_the_dog_labels.split(","):                         |
|                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                               |
| AttributeError: 'list' object has no attribute 'split'                                             |
|                                                                                                    |
| 'list' object has no attribute 'split'                                                             |

@cwar cwar marked this pull request as draft March 9, 2024 19:04
@cwar
Copy link
Contributor Author

cwar commented Mar 9, 2024

@YozoraXCII I definitely will get on adding some docs, thats next on my list! I converted this to draft for now to indicate this is still a WIP.

I have just pushed a change here, as PMM doesn't search for movies by title like doesthedogdie requires. We are able to match movies by title and year... but to add a level of customization here I added a strict_search option, so now it's configurable if we don't get an exact match by year and title if we should just take the top result (seems to be ranked by relevancy) or just discard all results.

I've also added a label_mode so now dog goes in label_mode (as does remove or all or categories).

Regarding the error that you've gotten, as I've converted the mass_does_the_dog_labels object from a string (or at least it was supposed to be a string I thought) to a dict, this hopefully should fix any issues with that line (which has actually been changed in the most recent commit). I'm sure including docs will help.

Here is what my config looks like for the most recent push:

libraries: 
  Movies:
    operations:
      mass_does_the_dog_labels:
        strict_search: false
        label_mode: dog
doesthedogdie:
  apikey: abc123

Optionally could also include categories of topics like so:

libraries: 
  Movies:
    operations:
      mass_does_the_dog_labels:
        strict_search: false
        label_mode: Animal,Abuse,Sexism,Addiction,Children
doesthedogdie:
  apikey: abc123

Thanks for taking a look!

@cwar
Copy link
Contributor Author

cwar commented Mar 10, 2024

Added docs... getting closer but still not sure if this is ready.. feel like label_mode could be broken out more but kinda hesitant to spend more time on this until I hear back

@YozoraXCII
Copy link
Contributor

Added docs... getting closer but still not sure if this is ready.. feel like label_mode could be broken out more but kinda hesitant to spend more time on this until I hear back

We are looking at this in-house, part of the problem is the scraping of the data from 25,000-ish items.

I'm not saying it won't happen, we're just trying to figure out the best way of dealing with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants