Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

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 à :
tomleb 2017-05-06 12:41:28 -04:00
Parent 5db874a2fa
révision cb2702630c
4 fichiers modifiés avec 6 ajouts et 7 suppressions

1
.gitignore externe
Voir le fichier

@ -1,5 +1,6 @@
*.sqlite
*.db
*.sql
main
nyaa
nyaa.exe

Voir le fichier

@ -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),

Voir le fichier

@ -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"))

Voir le fichier

@ -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"