From d0069b62496fc23ef5b61a1d8fa52993efaa6af7 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Tue, 9 May 2017 14:49:59 +1000 Subject: [PATCH] Add website links --- model/torrent.go | 6 ++++++ templates/view.html | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/model/torrent.go b/model/torrent.go index eaa47292..25fdeb20 100644 --- a/model/torrent.go +++ b/model/torrent.go @@ -64,6 +64,9 @@ type TorrentsJson struct { Comments []CommentsJson `json:"comments"` Sub_Category string `json:"sub_category"` Category string `json:"category"` + Downloads int `json:"downloads"` + UploaderId uint `json:"uploader_id"` + WebsiteLink template.URL `json:"website_link"` Magnet template.URL `json:"magnet"` } @@ -89,6 +92,9 @@ func (t *Torrents) ToJson() TorrentsJson { Comments: commentsJson, Sub_Category: strconv.Itoa(t.Sub_Category), Category: strconv.Itoa(t.Category), + Downloads: t.Downloads, + UploaderId: t.UploaderId, + WebsiteLink: util.Safe(t.WebsiteLink), Magnet: util.Safe(magnet)} return res diff --git a/templates/view.html b/templates/view.html index 9f229574..71f773c0 100644 --- a/templates/view.html +++ b/templates/view.html @@ -26,6 +26,10 @@ {{T "size"}} {{.Filesize}} + + {{T "Link"}} + {{.WebsiteLink}} + {{T "links"}} @@ -33,7 +37,7 @@ Download! - + Torrent file