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

Add import list exclusion support #175

Open
2 tasks done
mah-thingies opened this issue Jul 4, 2024 · 0 comments
Open
2 tasks done

Add import list exclusion support #175

mah-thingies opened this issue Jul 4, 2024 · 0 comments
Labels
type/feature New feature or request

Comments

@mah-thingies
Copy link

mah-thingies commented Jul 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Expected feature

That you can set if you want to add something to the import exclusion list when deleting an item

Possible Solutions

addImportListExclusion seems to be the parameter to control this setting with the delete query
GET /api/v3/importlistexclusion retrieves the import list exclusion list
DEL /api/v3/importlistexclusion/3927
3927 being the id which you get from the GET request

def del_series(
    self, id_: int, delete_files: bool = False, add_list_exclusion: bool = False
) -> Union[Response, JsonObject, dict[Any, Any]]:
    """Delete the series with the given ID

    Args:
        id_ (int): Database ID for series
        delete_files (bool, optional): If true series folder and files will be deleted. Defaults to False.
        add_list_exclusion (bool, optional): If true tvdb id will bne added to the import exclusion list. Defaults to False.

    Returns:
        dict: Blank dictionary
    """
    # File deletion does not work
    params = {"deleteFiles": delete_files, "addImportListExclusion": add_list_exclusion}
    return self._delete(f"series/{id_}", self.ver_uri, params=params)

def del_import_list_exclusion(
    self, id_: int
) -> Union[Response, JsonObject, dict[Any, Any]]:
    """Delete the import list exclusion with the given ID

    Args:
        id_ (int): Database ID for import list exclusion

    Returns:
        dict: Blank dictionary
    """
    return self._delete(f"importlistexclusion/{id_}", self.ver_uri)

def get_import_list_exclusions(
    self
) -> Union[JsonArray, JsonObject]:
    """Returns all items on the import list exclusions.

    Returns:
        Union[JsonArray, JsonObject]: List of dictionaries with items, or a
        dictionary with single item
    """
    path = f"importlistexclusion"
    return self._get(path, self.ver_uri)

Context / Reason

So that if something is deleted it stays deleted and does not get imported again

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant