Add remove rating feature
All checks were successful
Docker / docker (push) Successful in 1m51s

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:
dev
2026-03-04 13:54:28 +00:00
parent 2aa2634e6d
commit 9c70834bcb
4 changed files with 64 additions and 2 deletions

View File

@@ -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(