fix: get_torrent_tags fails to properly retrieve the existing tags

This commit is contained in:
wumode
2025-05-12 21:05:30 +08:00
parent 0e302d7959
commit 48120b9406

5
app/modules/transmission/transmission.py Normal file → Executable file
View File

@@ -163,8 +163,9 @@ class Transmission:
if not self.trc:
return []
try:
torrent = self.trc.get_torrents(ids=ids, arguments=self._trarg)
if torrent:
torrents = self.trc.get_torrents(ids=ids, arguments=self._trarg)
if len(torrents):
torrent = torrents[0]
labels = [str(tag).strip()
for tag in torrent.labels] if hasattr(torrent, "labels") else []
return labels