mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 18:20:01 +00:00
RSS: Add elements & refactor
description, size, seeders, leechers, downloads
This commit is contained in:
parent
00c768c722
commit
3b87337c71
|
@ -5,33 +5,31 @@
|
||||||
<link>{{ url_for('home', _external=True) }}</link>
|
<link>{{ url_for('home', _external=True) }}</link>
|
||||||
<atom:link href="{{ url_for('home', page='rss', _external=True) }}" rel="self" type="application/rss+xml" />
|
<atom:link href="{{ url_for('home', page='rss', _external=True) }}" rel="self" type="application/rss+xml" />
|
||||||
{% for torrent in torrent_query %}
|
{% for torrent in torrent_query %}
|
||||||
|
<item>
|
||||||
|
<title>{{ torrent.display_name }}</title>
|
||||||
|
<description>{{ torrent.description }}</description>
|
||||||
|
{% if use_elastic %}
|
||||||
{% if torrent.has_torrent %}
|
{% if torrent.has_torrent %}
|
||||||
<item>
|
|
||||||
<title>{{ torrent.display_name }}</title>
|
|
||||||
{% if use_elastic %}
|
|
||||||
<link>{{ url_for('download_torrent', torrent_id=torrent.meta.id, _external=True) }}</link>
|
<link>{{ url_for('download_torrent', torrent_id=torrent.meta.id, _external=True) }}</link>
|
||||||
<guid isPermaLink="true">{{ url_for('view_torrent', torrent_id=torrent.meta.id, _external=True) }}</guid>
|
|
||||||
<pubDate>{{ torrent.created_time|rfc822_es }}</pubDate>
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<link>{{ url_for('download_torrent', torrent_id=torrent.id, _external=True) }}</link>
|
|
||||||
<guid isPermaLink="true">{{ url_for('view_torrent', torrent_id=torrent.id, _external=True) }}</guid>
|
|
||||||
<pubDate>{{ torrent.created_time|rfc822 }}</pubDate>
|
|
||||||
{% endif %}
|
|
||||||
</item>
|
|
||||||
{% else %}
|
|
||||||
<item>
|
|
||||||
<title>{{ torrent.display_name }}</title>
|
|
||||||
{% if use_elastic %}
|
|
||||||
<link>{{ create_magnet_from_info(torrent.display_name, torrent.info_hash) }}</link>
|
<link>{{ create_magnet_from_info(torrent.display_name, torrent.info_hash) }}</link>
|
||||||
|
{% endif %}
|
||||||
<guid isPermaLink="true">{{ url_for('view_torrent', torrent_id=torrent.meta.id, _external=True) }}</guid>
|
<guid isPermaLink="true">{{ url_for('view_torrent', torrent_id=torrent.meta.id, _external=True) }}</guid>
|
||||||
<pubDate>{{ torrent.created_time|rfc822_es }}</pubDate>
|
<pubDate>{{ torrent.created_time|rfc822_es }}</pubDate>
|
||||||
|
{% else %}
|
||||||
|
{% if torrent.has_torrent %}
|
||||||
|
<link>{{ url_for('download_torrent', torrent_id=torrent.id, _external=True) }}</link>
|
||||||
{% else %}
|
{% else %}
|
||||||
<link>{{ torrent.magnet_uri }}</link>
|
<link>{{ torrent.magnet_uri }}</link>
|
||||||
|
{% endif %}
|
||||||
<guid isPermaLink="true">{{ url_for('view_torrent', torrent_id=torrent.id, _external=True) }}</guid>
|
<guid isPermaLink="true">{{ url_for('view_torrent', torrent_id=torrent.id, _external=True) }}</guid>
|
||||||
<pubDate>{{ torrent.created_time|rfc822 }}</pubDate>
|
<pubDate>{{ torrent.created_time|rfc822 }}</pubDate>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<size>{{ torrent.filesize }}</size>
|
||||||
|
<seeders>{{ torrent.stats.seed_count }}</seeders>
|
||||||
|
<leechers>{{ torrent.stats.leech_count }}</leechers>
|
||||||
|
<downloads>{{ torrent.stats.download_count }}</downloads>
|
||||||
</item>
|
</item>
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>
|
||||||
|
|
Loading…
Reference in a new issue