Skip to content

Commit 8188ff4

Browse files
authored
Merge pull request #104 from wthueb/fix_103
Add overrides for Sonarr quality profile commands
2 parents 5377128 + 98179da commit 8188ff4

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

pyarr/sonarr.py

+46
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,52 @@ def get_wanted(
239239
}
240240
return self.request_get(path, self.ver_uri, params=params)
241241

242+
# PROFILES
243+
244+
# GET /profile/{id}
245+
def get_quality_profile(self, id_=None):
246+
"""Gets all quality profiles or specific one with id_
247+
248+
Args:
249+
id_ (int): quality profile id from database
250+
251+
Returns:
252+
JSON: Array
253+
"""
254+
path = f"profile/{id_}" if id_ else "profile"
255+
return self.request_get(path, self.ver_uri)
256+
257+
# PUT /profile/{id}
258+
def upd_quality_profile(self, id_, data):
259+
"""Update the quality profile data.
260+
261+
Note:
262+
To be used in conjunction with get_quality_profile()
263+
264+
Args:
265+
id_ (int): Profile ID to Update
266+
data (dict): All parameters to update
267+
268+
Returns:
269+
JSON: Array
270+
"""
271+
path = f"profile/{id_}"
272+
return self.request_put(path, self.ver_uri, data=data)
273+
274+
# DELETE /profile
275+
def del_quality_profile(self, id_):
276+
"""Removes a specific quality profile from the blocklist
277+
278+
Args:
279+
id_ (int): quality profile id from database
280+
281+
Returns:
282+
JSON: Array
283+
"""
284+
params = {"id": id_}
285+
path = "profile"
286+
return self.request_del(path, self.ver_uri, params=params)
287+
242288
## QUEUE
243289

244290
# GET /queue

0 commit comments

Comments
 (0)