diff options
author | Jelle van der Waa <jelle@archlinux.org> | 2020-07-03 21:11:18 +0200 |
---|---|---|
committer | Jelle van der Waa <jelle@archlinux.org> | 2020-07-09 21:52:26 +0200 |
commit | 6914af850db2ca8fb2319b47ac3e70c70d509c0a (patch) | |
tree | 6c056a1d0e71a07c49df3cd2d19f141601f2e69c | |
parent | dae2e6adf39b6a0e70cef76864850f22492d8275 (diff) | |
download | archweb-6914af850db2ca8fb2319b47ac3e70c70d509c0a.tar.gz archweb-6914af850db2ca8fb2319b47ac3e70c70d509c0a.zip |
Use Release models torrent data for feeds
When a new Release is done, the iso and torrent file might not be
rsync'd yet to the archweb server, which makes torrent clients which
watch the feed unable to retrieve the torrent file and give up. As this
behaviour is unwanted use the Release model torrent data which is always
availabe.
-rw-r--r-- | feeds.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -7,6 +7,7 @@ from django.contrib.sites.models import Site from django.contrib.syndication.views import Feed from django.db import connection from django.db.models import Q +from django.urls import reverse from django.utils.feedgenerator import Rss201rev2Feed from django.views.decorators.http import condition @@ -378,7 +379,9 @@ class ReleaseFeed(Feed): def item_enclosure_url(self, item): domain = Site.objects.get_current().domain proto = 'https' - return "%s://%s/%s.torrent" % (proto, domain, item.iso_url()) + # Use archweb internal link, as the rsync job might not have been + # running and RSS torrent clients do not retry failed urls often. + return "%s://%s/%s" % (proto, domain, reverse('releng-release-torrent', args=[item.version])) def item_enclosure_length(self, item): if item.torrent_data: |