mirror of
https://github.com/g0ldyy/comet.git
synced 2026-01-12 01:16:12 +01:00
refactor: standardize empty list checks and default assignments for torrent sources from aiostreams
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user