From 539e86f46eb210895807544059425c89352f5136 Mon Sep 17 00:00:00 2001 From: kw6423 <211177151+kw6423@users.noreply.github.com> Date: Thu, 19 Jun 2025 09:12:03 +0200 Subject: [PATCH] Fixed --- shared/arr.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/shared/arr.py b/shared/arr.py index a63418e..ebb94ea 100644 --- a/shared/arr.py +++ b/shared/arr.py @@ -287,15 +287,9 @@ def getAll(self): def put(self, media: Media): retryRequest(lambda: requests.put(f"{self.host}/api/v3/{self.endpoint}/{media.id}?apiKey={self.apiKey}&moveFiles=true", json=media.json)) - def getFiles(self, media: Media, childId: int=None): + def getFiles(self, media: Media, childId: int = None): response = retryRequest(lambda: requests.get(f"{self.host}/api/v3/{self.fileEndpoint}?apiKey={self.apiKey}&{self.endpoint}Id={media.id}")) - - files = map(self.fileConstructor, response.json()) - - if childId != None and childId != media.id: - files = filter(lambda file: file.parentId == childId, files) - - return files + return map(self.fileConstructor, response.json()) def deleteFiles(self, files: List[MediaFile]): fileIds = [file.id for file in files] @@ -349,6 +343,12 @@ def __init__(self) -> None: def _automaticSearchJson(self, media: Media, childId: int): return {"name": f"{self.childName}Search", f"{self.endpoint}Id": media.id, self.childIdName: childId} + + def getFiles(self, media: Media, childId: int = None): + files = super().getFiles(media) + if childId is not None: + files = filter(lambda file: file.parentId == childId, files) + return files class Radarr(Arr): host = radarr['host']