Skip to content

Commit fa68ee9

Browse files
EstrellaXDclaudehappy-otter
committed
fix(renamer): only log rename operations that actually succeed
Previously, the rename log message was printed before checking if the qBittorrent API call succeeded. This caused log spam when rename operations failed (e.g., due to 409 conflicts or network errors) since the same file would be attempted again on the next cycle. Now the log message is only printed after confirming the rename succeeded, reducing noise in the logs. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
1 parent 24f1f72 commit fa68ee9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

backend/src/module/downloader/download_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,12 @@ async def get_torrent_files(self, torrent_hash: str):
121121
return await self.client.torrents_files(torrent_hash=torrent_hash)
122122

123123
async def rename_torrent_file(self, _hash, old_path, new_path) -> bool:
124-
logger.info(f"{old_path} >> {new_path}")
125-
return await self.client.torrents_rename_file(
124+
result = await self.client.torrents_rename_file(
126125
torrent_hash=_hash, old_path=old_path, new_path=new_path
127126
)
127+
if result:
128+
logger.info(f"{old_path} >> {new_path}")
129+
return result
128130

129131
async def delete_torrent(self, hashes, delete_files: bool = True):
130132
await self.client.torrents_delete(hashes, delete_files=delete_files)

0 commit comments

Comments
 (0)