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

fix: Add overrides for Sonarr quality profile commands #104

Merged
merged 1 commit into from
May 9, 2022
Merged
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
46 changes: 46 additions & 0 deletions pyarr/sonarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,52 @@ def get_wanted(
}
return self.request_get(path, self.ver_uri, params=params)

# PROFILES

# GET /profile/{id}
def get_quality_profile(self, id_=None):
"""Gets all quality profiles or specific one with id_

Args:
id_ (int): quality profile id from database

Returns:
JSON: Array
"""
path = f"profile/{id_}" if id_ else "profile"
return self.request_get(path, self.ver_uri)

# PUT /profile/{id}
def upd_quality_profile(self, id_, data):
"""Update the quality profile data.

Note:
To be used in conjunction with get_quality_profile()

Args:
id_ (int): Profile ID to Update
data (dict): All parameters to update

Returns:
JSON: Array
"""
path = f"profile/{id_}"
return self.request_put(path, self.ver_uri, data=data)

# DELETE /profile
def del_quality_profile(self, id_):
"""Removes a specific quality profile from the blocklist

Args:
id_ (int): quality profile id from database

Returns:
JSON: Array
"""
params = {"id": id_}
path = "profile"
return self.request_del(path, self.ver_uri, params=params)

## QUEUE

# GET /queue
Expand Down