Remove categories and subcategories queries
This commit removes usage of Categories queries in order to support postgres. The Categories in postgres is an enum instead of a table and we don't need to use the table in sqlite because the value are hardcoded in the html and are unlikely to ever change. This commit breaks the thumbnails in the index. Other functionality needs to be tested before merging.
Cette révision appartient à :
Parent
5db874a2fa
révision
cb2702630c
4 fichiers modifiés avec 6 ajouts et 7 suppressions
1
.gitignore
externe
1
.gitignore
externe
|
@ -1,5 +1,6 @@
|
|||
*.sqlite
|
||||
*.db
|
||||
*.sql
|
||||
main
|
||||
nyaa
|
||||
nyaa.exe
|
||||
|
|
|
@ -83,7 +83,7 @@ func (t *Torrents) ToJson() TorrentsJson {
|
|||
Hash: t.Hash,
|
||||
Date: time.Unix(t.Date, 0).Format(time.RFC3339),
|
||||
Filesize: util.FormatFilesize(t.Filesize),
|
||||
Description: template.HTML(util.UnZlib(t.Description)),
|
||||
Description: template.HTML(t.Description),
|
||||
Comments: b,
|
||||
Sub_Category: strconv.Itoa(t.Sub_Category),
|
||||
Category: strconv.Itoa(t.Category),
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
package router
|
||||
|
||||
import (
|
||||
"html"
|
||||
"html/template"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/ewhal/nyaa/model"
|
||||
"github.com/ewhal/nyaa/service/torrent"
|
||||
"github.com/ewhal/nyaa/templates"
|
||||
"github.com/gorilla/mux"
|
||||
"html"
|
||||
"html/template"
|
||||
"net/http"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
var homeTemplate = template.Must(template.New("home").Funcs(FuncMap).ParseFiles("templates/index.html", "templates/home.html"))
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
"html/template"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/ewhal/nyaa/model"
|
||||
"github.com/ewhal/nyaa/templates"
|
||||
"github.com/ewhal/nyaa/util/search"
|
||||
|
|
Référencer dans un nouveau ticket