Skip to content

Commit

Permalink
Merge pull request #104 from wthueb/fix_103
Browse files Browse the repository at this point in the history
Add overrides for Sonarr quality profile commands
  • Loading branch information
marksie1988 authored May 9, 2022
2 parents 5377128 + 98179da commit 8188ff4
Showing 1 changed file with 46 additions and 0 deletions.
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

0 comments on commit 8188ff4

Please sign in to comment.