Bouton ✕ sur les films notés 10/10 pour supprimer la note via DELETE /api/rate/:id. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
10
trakt.py
10
trakt.py
@@ -23,6 +23,16 @@ class TraktClient:
|
||||
ratings_r.raise_for_status()
|
||||
return watched_r.json(), ratings_r.json()
|
||||
|
||||
async def remove_rating(self, trakt_id: int):
|
||||
async with httpx.AsyncClient(timeout=30) as client:
|
||||
r = await client.post(
|
||||
f"{self.BASE_URL}/sync/ratings/remove",
|
||||
headers=self.headers,
|
||||
json={"movies": [{"ids": {"trakt": trakt_id}}]},
|
||||
)
|
||||
r.raise_for_status()
|
||||
return r.json()
|
||||
|
||||
async def rate_movie(self, trakt_id: int, rating: int):
|
||||
async with httpx.AsyncClient(timeout=30) as client:
|
||||
r = await client.post(
|
||||
|
||||
Reference in New Issue
Block a user