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"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Feed struct {
|
||||
|
@ -44,7 +45,7 @@ type Torrents struct {
|
|||
Sub_category_id int `gorm:"column:sub_category_id"`
|
||||
Status int `gorm:"column:status_id"`
|
||||
Hash string `gorm:"column:torrent_hash"`
|
||||
Date int `gorm:"column:date"`
|
||||
Date int64 `gorm:"column:date"`
|
||||
Downloads int `gorm:"column:downloads"`
|
||||
Filesize string `gorm:"column:filesize"`
|
||||
Description []byte `gorm:"column:description"`
|
||||
|
@ -77,9 +78,9 @@ type TorrentsJson struct {
|
|||
Name string `json: "name"`
|
||||
Status int `json: "status"`
|
||||
Hash string `json: "hash"`
|
||||
Date int `json: "date"`
|
||||
Date string `json: "date"`
|
||||
Filesize string `json: "filesize"`
|
||||
Description string `json: "description"`
|
||||
Description template.HTML `json: "description"`
|
||||
Sub_Category SubCategoryJson `json: "sub_category"`
|
||||
Category CategoryJson `json: "category"`
|
||||
Magnet template.URL `json: "magnet"`
|
||||
|
@ -212,9 +213,9 @@ func (t *Torrents) toJson() TorrentsJson {
|
|||
Name: html.UnescapeString(t.Name),
|
||||
Status: t.Status,
|
||||
Hash: t.Hash,
|
||||
Date: t.Date,
|
||||
Date: time.Unix(t.Date, 0).Format(time.RFC3339),
|
||||
Filesize: t.Filesize,
|
||||
Description: unZlib(t.Description),
|
||||
Description: template.HTML(unZlib(t.Description)),
|
||||
Sub_Category: t.Sub_Categories.toJson(),
|
||||
Category: t.Categories.toJson(),
|
||||
Magnet: safe(magnet)}
|
||||
|
|
Référencer dans un nouveau ticket