mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2025-01-27 17:02:59 +00:00
Our main tracker first, then user trackers, then trackers.txt
This commit is contained in:
parent
799e9dea87
commit
7e25e6d9b8
|
@ -36,12 +36,21 @@ def default_trackers():
|
||||||
|
|
||||||
|
|
||||||
def get_trackers(torrent):
|
def get_trackers(torrent):
|
||||||
trackers = default_trackers()
|
trackers = OrderedSet()
|
||||||
torrent_trackers = torrent.trackers
|
|
||||||
|
|
||||||
|
# Our main one first
|
||||||
|
main_announce_url = app.config.get('MAIN_ANNOUNCE_URL')
|
||||||
|
if main_announce_url:
|
||||||
|
trackers.add(main_announce_url)
|
||||||
|
|
||||||
|
# then the user ones
|
||||||
|
torrent_trackers = torrent.trackers
|
||||||
for torrent_tracker in torrent_trackers:
|
for torrent_tracker in torrent_trackers:
|
||||||
trackers.add(torrent_tracker.tracker.uri)
|
trackers.add(torrent_tracker.tracker.uri)
|
||||||
|
|
||||||
|
# and finally our tracker list
|
||||||
|
trackers.update(default_trackers())
|
||||||
|
|
||||||
return list(trackers)
|
return list(trackers)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue