refactor: standardize empty list checks and default assignments for torrent sources from aiostreams

This commit is contained in:
g0ldyy
2025-12-21 20:36:37 +01:00
parent a2e6752b94
commit 10a9a516e1
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -466,7 +466,7 @@ async def stream(
if torrent["fileIndex"] is not None:
the_stream["fileIdx"] = torrent["fileIndex"]
if len(torrent["sources"]) == 0:
if not torrent["sources"]:
the_stream["sources"] = trackers
else:
the_stream["sources"] = torrent["sources"]
+1 -1
View File
@@ -48,7 +48,7 @@ class AiostreamsScraper(BaseScraper):
"seeders": torrent.get("seeders", None),
"size": torrent["size"],
"tracker": tracker,
"sources": torrent.get("sources", []),
"sources": torrent.get("sources") or [],
}
)
except Exception as e: