Merge branch 'master' of https://github.com/ewhal/nyaa
Cette révision appartient à :
révision
ff4c3cfd92
1 fichiers modifiés avec 6 ajouts et 5 suppressions
11
models.go
11
models.go
|
@ -7,6 +7,7 @@ import (
|
||||||
"html/template"
|
"html/template"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Feed struct {
|
type Feed struct {
|
||||||
|
@ -44,7 +45,7 @@ type Torrents struct {
|
||||||
Sub_category_id int `gorm:"column:sub_category_id"`
|
Sub_category_id int `gorm:"column:sub_category_id"`
|
||||||
Status int `gorm:"column:status_id"`
|
Status int `gorm:"column:status_id"`
|
||||||
Hash string `gorm:"column:torrent_hash"`
|
Hash string `gorm:"column:torrent_hash"`
|
||||||
Date int `gorm:"column:date"`
|
Date int64 `gorm:"column:date"`
|
||||||
Downloads int `gorm:"column:downloads"`
|
Downloads int `gorm:"column:downloads"`
|
||||||
Filesize string `gorm:"column:filesize"`
|
Filesize string `gorm:"column:filesize"`
|
||||||
Description []byte `gorm:"column:description"`
|
Description []byte `gorm:"column:description"`
|
||||||
|
@ -77,9 +78,9 @@ type TorrentsJson struct {
|
||||||
Name string `json: "name"`
|
Name string `json: "name"`
|
||||||
Status int `json: "status"`
|
Status int `json: "status"`
|
||||||
Hash string `json: "hash"`
|
Hash string `json: "hash"`
|
||||||
Date int `json: "date"`
|
Date string `json: "date"`
|
||||||
Filesize string `json: "filesize"`
|
Filesize string `json: "filesize"`
|
||||||
Description string `json: "description"`
|
Description template.HTML `json: "description"`
|
||||||
Sub_Category SubCategoryJson `json: "sub_category"`
|
Sub_Category SubCategoryJson `json: "sub_category"`
|
||||||
Category CategoryJson `json: "category"`
|
Category CategoryJson `json: "category"`
|
||||||
Magnet template.URL `json: "magnet"`
|
Magnet template.URL `json: "magnet"`
|
||||||
|
@ -212,9 +213,9 @@ func (t *Torrents) toJson() TorrentsJson {
|
||||||
Name: html.UnescapeString(t.Name),
|
Name: html.UnescapeString(t.Name),
|
||||||
Status: t.Status,
|
Status: t.Status,
|
||||||
Hash: t.Hash,
|
Hash: t.Hash,
|
||||||
Date: t.Date,
|
Date: time.Unix(t.Date, 0).Format(time.RFC3339),
|
||||||
Filesize: t.Filesize,
|
Filesize: t.Filesize,
|
||||||
Description: unZlib(t.Description),
|
Description: template.HTML(unZlib(t.Description)),
|
||||||
Sub_Category: t.Sub_Categories.toJson(),
|
Sub_Category: t.Sub_Categories.toJson(),
|
||||||
Category: t.Categories.toJson(),
|
Category: t.Categories.toJson(),
|
||||||
Magnet: safe(magnet)}
|
Magnet: safe(magnet)}
|
||||||
|
|
Référencer dans un nouveau ticket