diff --git a/indexer.py b/indexer.py index 71f050c..7225310 100644 --- a/indexer.py +++ b/indexer.py @@ -170,6 +170,7 @@ class Metadata(): self.announce_url = self.bcoded.get(b'info', dict()).get(b'', "") self.source = self.bcoded.get(b'info', dict()).get(b'source', b"") self.torrentsize = ((len(self.bcoded.get(b'info', dict()).get(b'pieces', "")) / 20) * self.bcoded.get(b'info', dict()).get(b'piece length')) + self.torrentsize_human = size(self.torrentsize) self.name = self.bcoded.get(b'info', dict()).get(b'name', b"") self.private = self.bcoded.get(b'info', dict()).get(b'private', b"") @@ -228,6 +229,7 @@ class TorrentFile(): self.description = (base64.b64decode(res["description"])).decode() self.audioquality_description = (base64.b64decode(res["audioquality_description"])).decode() self.videoquality_description = (base64.b64decode(res["videoquality_description"])).decode() + self.metadata = Metadata(self.fileid) @babel.localeselector def get_locale(): diff --git a/static/css/details.css b/static/css/details.css index e87a037..81fa7b4 100644 --- a/static/css/details.css +++ b/static/css/details.css @@ -1,3 +1,11 @@ +#torrent a { + text-decoration: underline; +} + +#torrent a:hover { + text-decoration: none; +} + h4 { display: flex; justify-content: center; @@ -13,14 +21,14 @@ h4 { display: inline; } -.detailrow :first-child { +.detailrow > :first-child { width: 30%; font-size: 1.2em; font-weight: bold; float: left; } -.detailrow :last-child { +.detailrow > :last-child { display: flex; justify-content: right; width: 70%; diff --git a/templates/details.html b/templates/details.html index 335215a..1efcb6a 100644 --- a/templates/details.html +++ b/templates/details.html @@ -8,23 +8,28 @@ vim: ts=2 noexpandtab
-

{{ torrent.name }}

+

{{ torrent.category }} » {{ torrent.subcategory}} » {{ torrent.name }}

-
Info Hash:
-
{{ torrent.fileid }}
+
.torrent-file:
+
+ + {{ torrent.fileid }} + + +
Name: {{ torrent.name }}
- Category: - {{ torrent.category }} + Size: + {{ torrent.metadata.torrentsize_human }}
- Subcategory: - {{ torrent.subcategory }} + Date: + {{ torrent.metadata.creation_date }}
Description: diff --git a/templates/result.html b/templates/result.html index a39e37a..4e2df37 100644 --- a/templates/result.html +++ b/templates/result.html @@ -17,7 +17,7 @@ vim: ts=2 noexpandtab {% for result in results %} - {{ result[1] }} + {{ result[1] }} {{ result[2] }} {{ _("N/A") }} {{ _("N/A") }}