From 3b87337c71b6b5bfb02365190ad1276606ddae51 Mon Sep 17 00:00:00 2001 From: sharkykh Date: Sun, 14 May 2017 09:21:47 +0300 Subject: [PATCH] RSS: Add elements & refactor description, size, seeders, leechers, downloads --- nyaa/templates/rss.xml | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/nyaa/templates/rss.xml b/nyaa/templates/rss.xml index e1787d2..c6fdcdd 100644 --- a/nyaa/templates/rss.xml +++ b/nyaa/templates/rss.xml @@ -5,33 +5,31 @@ {{ url_for('home', _external=True) }} {% for torrent in torrent_query %} - {% if torrent.has_torrent %} {{ torrent.display_name }} + {{ torrent.description }} {% if use_elastic %} - {{ url_for('download_torrent', torrent_id=torrent.meta.id, _external=True) }} - {{ url_for('view_torrent', torrent_id=torrent.meta.id, _external=True) }} - {{ torrent.created_time|rfc822_es }} + {% if torrent.has_torrent %} + {{ url_for('download_torrent', torrent_id=torrent.meta.id, _external=True) }} + {% else %} + {{ create_magnet_from_info(torrent.display_name, torrent.info_hash) }} + {% endif %} + {{ url_for('view_torrent', torrent_id=torrent.meta.id, _external=True) }} + {{ torrent.created_time|rfc822_es }} {% else %} - {{ url_for('download_torrent', torrent_id=torrent.id, _external=True) }} - {{ url_for('view_torrent', torrent_id=torrent.id, _external=True) }} - {{ torrent.created_time|rfc822 }} - {% endif %} - - {% else %} - - {{ torrent.display_name }} - {% if use_elastic %} - {{ create_magnet_from_info(torrent.display_name, torrent.info_hash) }} - {{ url_for('view_torrent', torrent_id=torrent.meta.id, _external=True) }} - {{ torrent.created_time|rfc822_es }} - {% else %} - {{ torrent.magnet_uri }} - {{ url_for('view_torrent', torrent_id=torrent.id, _external=True) }} - {{ torrent.created_time|rfc822 }} + {% if torrent.has_torrent %} + {{ url_for('download_torrent', torrent_id=torrent.id, _external=True) }} + {% else %} + {{ torrent.magnet_uri }} + {% endif %} + {{ url_for('view_torrent', torrent_id=torrent.id, _external=True) }} + {{ torrent.created_time|rfc822 }} {% endif %} + {{ torrent.filesize }} + {{ torrent.stats.seed_count }} + {{ torrent.stats.leech_count }} + {{ torrent.stats.download_count }} - {% endif %} {% endfor %}