mirror of
https://github.com/ProjectSynthoria/SynthoriaArchive.git
synced 2025-03-12 15:26:56 +02:00
Our main tracker first, then user trackers, then trackers.txt
This commit is contained in:
parent
799e9dea87
commit
7e25e6d9b8
1 changed files with 11 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue