update
This commit is contained in:
parent
8edcf4c678
commit
10ee6f451c
11
GoRacerr.go
11
GoRacerr.go
@ -10,6 +10,8 @@ func main() {
|
||||
|
||||
// Get app path
|
||||
pwd, _ := os.Getwd()
|
||||
|
||||
// Config
|
||||
cfg := NewConfig(pwd)
|
||||
|
||||
// Log
|
||||
@ -20,7 +22,14 @@ func main() {
|
||||
defer file.Close()
|
||||
log.Printf("Starting GoRacerr on %s", cfg.Host)
|
||||
|
||||
server := NewAPIServer(cfg)
|
||||
// Database
|
||||
db, err := NewSQLiteDatabase(cfg)
|
||||
if err != nil {
|
||||
log.Fatalln("Could not open database: ", err)
|
||||
}
|
||||
|
||||
// Server
|
||||
server := NewAPIServer(cfg, *db)
|
||||
server.Start()
|
||||
|
||||
}
|
||||
|
23
api.go
23
api.go
@ -11,6 +11,7 @@ import (
|
||||
type APIServer struct {
|
||||
Host string
|
||||
Port string
|
||||
Db SQLiteDatabase
|
||||
}
|
||||
|
||||
type APIError struct {
|
||||
@ -23,9 +24,10 @@ func WriteJSON(w http.ResponseWriter, status int, v any) error {
|
||||
return json.NewEncoder(w).Encode(v)
|
||||
}
|
||||
|
||||
func NewAPIServer(cfg Config) *APIServer {
|
||||
func NewAPIServer(cfg Config, database SQLiteDatabase) *APIServer {
|
||||
return &APIServer{
|
||||
Host: cfg.Host,
|
||||
Db: database,
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,8 +35,9 @@ func (s *APIServer) Start() {
|
||||
router := mux.NewRouter()
|
||||
router.HandleFunc("/prerace", s.handleCreatePreRace).Methods("POST")
|
||||
router.HandleFunc("/preraces", s.handleGetPreRaces).Methods("GET")
|
||||
router.HandleFunc("prerace", s.handleDeletePreRace).Methods("DELETE")
|
||||
router.HandleFunc("prerace", s.handleUpdatePreRace).Methods("PUT")
|
||||
router.HandleFunc("/prerace/{id}", s.handleDeletePreRace).Methods("DELETE")
|
||||
router.HandleFunc("/prerace/{id}", s.handleUpdatePreRace).Methods("PUT")
|
||||
router.HandleFunc("/prerace/{id}", s.handleGetPreRaceByID).Methods("GET")
|
||||
|
||||
log.Println("Listening for new Preraces / Races")
|
||||
|
||||
@ -43,7 +46,7 @@ func (s *APIServer) Start() {
|
||||
}
|
||||
|
||||
func (s *APIServer) handleGetPreRaceByID(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
WriteJSON(w, http.StatusOK, mux.Vars(r))
|
||||
}
|
||||
|
||||
func (s *APIServer) handleGetPreRaces(w http.ResponseWriter, r *http.Request) {
|
||||
@ -51,6 +54,18 @@ func (s *APIServer) handleGetPreRaces(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (s *APIServer) handleCreatePreRace(w http.ResponseWriter, r *http.Request) {
|
||||
race := NewRace()
|
||||
_ = json.NewDecoder(r.Body).Decode(&race)
|
||||
defer r.Body.Close()
|
||||
|
||||
race.PreRace = true
|
||||
|
||||
err := s.Db.CreatePreRace(race)
|
||||
if err != nil {
|
||||
log.Println("Could not create new race in db", err)
|
||||
WriteJSON(w, http.StatusOK, race)
|
||||
}
|
||||
WriteJSON(w, http.StatusOK, "{Error: Error}")
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,5 +2,5 @@
|
||||
host = "0.0.0.0:3000"
|
||||
# TMDbApiKey is required
|
||||
tmdbApiKey = ""
|
||||
dbName = "racer"
|
||||
dbName = "racer.db"
|
||||
uploadFolder = "/home/rouggy/torrents/rtorrent/Race"
|
||||
|
94
database.go
Normal file
94
database.go
Normal file
@ -0,0 +1,94 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"log"
|
||||
|
||||
sq "github.com/Masterminds/squirrel"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
type Database interface {
|
||||
CreatePreRace(*Race) error
|
||||
DeletePreRace(int) error
|
||||
UpdatePreRace(int) error
|
||||
GetPreRaceByID(int) (*Race, error)
|
||||
GetPreRaces() ([]*Race, error)
|
||||
}
|
||||
|
||||
type SQLiteDatabase struct {
|
||||
Db *sql.DB
|
||||
}
|
||||
|
||||
func NewSQLiteDatabase(cfg Config) (*SQLiteDatabase, error) {
|
||||
db, err := sql.Open("sqlite3", cfg.DBName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.Println("Opening SQLite database")
|
||||
|
||||
_, err = db.ExecContext(
|
||||
context.Background(),
|
||||
`CREATE TABLE IF NOT EXISTS "races" (
|
||||
"id" INTEGER NOT NULL UNIQUE,
|
||||
"torrentname" TEXT NOT NULL,
|
||||
"category" TEXT,
|
||||
"indexer" TEXT,
|
||||
"type" TEXT,
|
||||
"title" TEXT,
|
||||
"season" TEXT,
|
||||
"episode" TEXT,
|
||||
"year" TEXT,
|
||||
"resolution" TEXT,
|
||||
"source" TEXT,
|
||||
"torrentURL" TEXT,
|
||||
"won" INTEGER,
|
||||
"prerace" INTEGER,
|
||||
PRIMARY KEY("ID" AUTOINCREMENT)
|
||||
)`,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
log.Panicln("Cannot create table", err)
|
||||
}
|
||||
|
||||
return &SQLiteDatabase{
|
||||
Db: db,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *SQLiteDatabase) CreatePreRace(r *Race) error {
|
||||
|
||||
if r.Type == "movie" || r.Type == "episode" {
|
||||
queryBuilder := sq.
|
||||
Insert("races").
|
||||
Columns("torrentname", "category", "indexer", "type", "title", "season", "episode", "year", "resolution", "source", "torrenturl", "won", "prerace").
|
||||
Values(r.TorrentName, r.Category, r.Indexer, r.Type, r.Title, r.Season, r.Episode, r.Year, r.Resolution, r.Source, r.TorrentURL, r.Won, r.PreRace).
|
||||
Suffix("RETURNING id").RunWith(s.Db)
|
||||
|
||||
err := queryBuilder.QueryRow().Scan(&r.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Printf("Prerace *** %s *** from %s added to the database", r.TorrentName, r.Indexer)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *SQLiteDatabase) DeletePreRace(*Race) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *SQLiteDatabase) UpdatePreRace(*Race) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *SQLiteDatabase) GetPreRaceByID(*Race) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *SQLiteDatabase) GetPreRaces(*Race) error {
|
||||
return nil
|
||||
}
|
8
go.mod
8
go.mod
@ -5,3 +5,11 @@ go 1.22.4
|
||||
require github.com/BurntSushi/toml v1.4.0
|
||||
|
||||
require github.com/gorilla/mux v1.8.1
|
||||
|
||||
require github.com/mattn/go-sqlite3 v1.14.22
|
||||
|
||||
require (
|
||||
github.com/Masterminds/squirrel v1.5.4 // indirect
|
||||
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
|
||||
)
|
||||
|
11
go.sum
11
go.sum
@ -1,4 +1,15 @@
|
||||
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
|
||||
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM=
|
||||
github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
||||
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
||||
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw=
|
||||
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o=
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk=
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw=
|
||||
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
||||
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
|
250
goracerr.log
250
goracerr.log
@ -11,3 +11,253 @@
|
||||
[GoRacerr]2024/08/30 12:12:45 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 12:22:46 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 12:22:46 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 12:57:40 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 12:57:40 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 13:01:54 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 13:01:54 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 13:02:35 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 13:02:35 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 13:05:21 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 13:05:21 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 13:09:33 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 13:09:33 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 13:10:07 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 13:10:07 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 13:11:11 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 13:11:11 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 14:24:07 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 14:24:07 Could not open database: sql: unknown driver "sqlite3" (forgotten import?)
|
||||
[GoRacerr]2024/08/30 14:25:33 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 14:25:33 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 14:26:23 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 14:27:16 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 14:37:18 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 14:37:18 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 14:37:18 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 14:38:04 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 14:38:04 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 14:38:04 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 14:38:25 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 14:38:25 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 14:38:25 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 14:46:14 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 14:46:14 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 14:46:14 &{Db:0xc0001aa8f0}
|
||||
[GoRacerr]2024/08/30 14:46:14 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 14:50:14 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 14:50:14 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 14:50:14 &{Db:0xc0000888f0}
|
||||
[GoRacerr]2024/08/30 14:50:14 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 14:53:11 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 14:53:11 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 14:53:11 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 14:58:06 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 14:58:06 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 14:58:11 Cannot create table database is locked
|
||||
[GoRacerr]2024/08/30 14:58:25 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 14:58:25 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 14:58:25 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 15:08:28 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 15:08:28 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 15:08:28 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 15:14:03 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 15:14:03 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 15:14:03 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 15:14:35 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 15:14:35 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 15:14:35 Cannot create table sql: database is closed
|
||||
[GoRacerr]2024/08/30 15:15:50 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 15:15:50 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 15:15:50 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 15:45:29 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 15:45:29 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 15:45:29 Cannot create table table "races" already exists
|
||||
[GoRacerr]2024/08/30 15:45:57 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 15:45:57 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 15:45:57 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 15:47:40 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 15:47:40 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 15:47:40 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 15:47:50 &{0xc0001ae000 <nil> <nil> false true {0 0} false false false 0x7ff6259c4380}
|
||||
[GoRacerr]2024/08/30 15:50:18 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 15:50:18 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 15:50:18 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 15:54:44 &{0xc0001ac000 <nil> <nil> false true {0 0} true false false 0x7ff64f774380}
|
||||
[GoRacerr]2024/08/30 15:56:18 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 15:56:18 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 15:56:18 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:02:14 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:02:14 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:02:14 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:02:19 &{0xc0000b2000 <nil> <nil> false true {0 0} true false false 0x7ff6950b4380}
|
||||
[GoRacerr]2024/08/30 16:02:57 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:02:57 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:02:57 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:03:03 &{0xc0000b2000 <nil> <nil> false true {0 0} true false false 0x7ff6cfb94380}
|
||||
[GoRacerr]2024/08/30 16:04:06 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:04:06 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:04:06 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:06:18 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:06:18 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:06:18 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:06:23 &{0xc0000b2000 <nil> <nil> false true {0 0} true false false 0x7ff6358d4380}
|
||||
[GoRacerr]2024/08/30 16:06:38 {0xc0000a8150}
|
||||
[GoRacerr]2024/08/30 16:06:51 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:06:51 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:06:51 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:06:53 &{0xc000008018 <nil> <nil> false true {0 0} true false false 0x7ff762224380}
|
||||
[GoRacerr]2024/08/30 16:06:56 &{0xc00020a150}
|
||||
[GoRacerr]2024/08/30 16:08:56 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:08:56 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:08:56 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:08:58 &{0xc0001160a8 <nil> <nil> false true {0 0} true false false 0x7ff60c685ca0}
|
||||
[GoRacerr]2024/08/30 16:09:01 SELECT * FROM races
|
||||
[GoRacerr]2024/08/30 16:13:14 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:13:14 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:13:14 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:13:18 &{0xc000190018 <nil> <nil> false true {0 0} true false false 0x7ff6b8d55ca0}
|
||||
[GoRacerr]2024/08/30 16:13:35 &{0xc000024380 <nil>}
|
||||
[GoRacerr]2024/08/30 16:13:51 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:13:51 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:13:51 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:13:54 &{0xc0000b0000 <nil> <nil> false true {0 0} true false false 0x7ff60f815ca0}
|
||||
[GoRacerr]2024/08/30 16:14:00 &{<nil> 0xc0000a0240}
|
||||
[GoRacerr]2024/08/30 16:20:12 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:20:12 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:20:12 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:20:15 &{0xc0001160d8 <nil> <nil> false true {0 0} true false false 0x7ff7785d5ca0}
|
||||
[GoRacerr]2024/08/30 16:20:22 &{0xc00010c5d0 <nil>}
|
||||
[GoRacerr]2024/08/30 16:21:09 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:21:09 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:21:09 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:21:11 &{0xc0000b4000 <nil> <nil> false true {0 0} true false false 0x7ff6d4075ca0}
|
||||
[GoRacerr]2024/08/30 16:21:15 <nil>
|
||||
[GoRacerr]2024/08/30 16:23:21 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:23:21 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:23:21 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:23:29 &{0xc0000080d8 <nil> <nil> false true {0 0} true false false 0x7ff70f455ca0}
|
||||
[GoRacerr]2024/08/30 16:25:05 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:25:05 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:25:05 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:25:06 &{0xc0000080c0 <nil> <nil> false true {0 0} true false false 0x7ff696385ca0}
|
||||
[GoRacerr]2024/08/30 16:25:08 Error inserting in database not enough args to execute query: want 11 got 0
|
||||
[GoRacerr]2024/08/30 16:25:08 <nil>
|
||||
[GoRacerr]2024/08/30 16:25:21 &{0xc000096000 <nil> <nil> false true {0 0} true false false 0x7ff696385ca0}
|
||||
[GoRacerr]2024/08/30 16:25:21 Error inserting in database not enough args to execute query: want 11 got 0
|
||||
[GoRacerr]2024/08/30 16:25:21 <nil>
|
||||
[GoRacerr]2024/08/30 16:28:55 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:28:55 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:28:55 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:28:59 &{0xc0000a8000 <nil> <nil> false true {0 0} true false false 0x7ff63a6e4380}
|
||||
[GoRacerr]2024/08/30 16:32:40 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:32:40 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:32:40 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:35:19 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:35:19 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:35:19 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:39:38 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:39:38 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:39:38 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:39:42 Could not insert new race in db near ")": syntax error
|
||||
[GoRacerr]2024/08/30 16:40:10 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:40:10 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:40:10 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:40:12 Could not insert new race in db not enough args to execute query: want 13 got 0
|
||||
[GoRacerr]2024/08/30 16:45:32 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:45:32 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:45:32 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:45:36 Could not insert new race in db sql: converting argument $1 type: unsupported type []interface {}, a slice of interface
|
||||
[GoRacerr]2024/08/30 16:45:36 <nil>
|
||||
[GoRacerr]2024/08/30 16:47:04 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:47:04 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:47:04 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:47:06 Could not insert new race in db sql: converting argument $1 type: unsupported type []interface {}, a slice of interface
|
||||
[GoRacerr]2024/08/30 16:47:06 <nil>
|
||||
[GoRacerr]2024/08/30 16:48:17 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:48:17 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:48:17 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 16:48:18 Could not insert new race in db not enough args to execute query: want 13 got 0
|
||||
[GoRacerr]2024/08/30 16:48:18 <nil>
|
||||
[GoRacerr]2024/08/30 16:59:52 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 16:59:52 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 16:59:52 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:00:04 Could not insert new race in db sql: converting argument $1 type: unsupported type []interface {}, a slice of interface
|
||||
[GoRacerr]2024/08/30 17:00:04 <nil>
|
||||
[GoRacerr]2024/08/30 17:01:19 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:01:19 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:01:19 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:01:21 Could not insert new race in db sql: converting argument $1 type: unsupported type []interface {}, a slice of interface
|
||||
[GoRacerr]2024/08/30 17:01:21 <nil>
|
||||
[GoRacerr]2024/08/30 17:05:43 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:05:43 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:05:43 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:05:45 Could not insert new race in db sql: converting argument $1 type: unsupported type []interface {}, a slice of interface
|
||||
[GoRacerr]2024/08/30 17:05:45 <nil>
|
||||
[GoRacerr]2024/08/30 17:07:29 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:07:29 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:07:29 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:07:31 Could not insert new race in db sql: converting argument $1 type: unsupported type []interface {}, a slice of interface
|
||||
[GoRacerr]2024/08/30 17:07:31 <nil>
|
||||
[GoRacerr]2024/08/30 17:11:13 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:11:13 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:11:13 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:11:15 Could not insert new race in db sql: converting argument $1 type: unsupported type []interface {}, a slice of interface
|
||||
[GoRacerr]2024/08/30 17:11:15 <nil>
|
||||
[GoRacerr]2024/08/30 17:15:57 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:15:57 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:15:57 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:16:08 Could not insert new race in db sql: converting argument $1 type: unsupported type []interface {}, a slice of interface
|
||||
[GoRacerr]2024/08/30 17:16:08 <nil>
|
||||
[GoRacerr]2024/08/30 17:17:38 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:17:38 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:17:38 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:17:46 Could not insert new race in db sql: converting argument $1 type: unsupported type []interface {}, a slice of interface
|
||||
[GoRacerr]2024/08/30 17:17:46 <nil>
|
||||
[GoRacerr]2024/08/30 17:18:04 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:18:04 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:18:04 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:19:44 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:19:44 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:19:44 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:24:46 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:24:46 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:24:46 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:35:04 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:35:04 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:35:04 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:40:23 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:40:23 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:40:23 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:41:17 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:41:17 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:41:17 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:41:17 Prerace Touch 2024 2160p WEB-DL DD+5.1 HDR x265-ETHEL added to the database
|
||||
[GoRacerr]2024/08/30 17:41:35 Prerace TechSmith.Camtasia.2024.0.6.macOS-NoGrp added to the database
|
||||
[GoRacerr]2024/08/30 17:47:54 Prerace ColorFoto.No.09.2024.GERMAN.HYBRID.MAGAZINE.eBook-LORENZ added to the database
|
||||
[GoRacerr]2024/08/30 17:47:55 Prerace CSI.NY.S09E04.MULTi.1080p.WEB.H264-AZR added to the database
|
||||
[GoRacerr]2024/08/30 17:47:57 Prerace CSI.NY.S09E10.MULTi.1080p.WEB.H264-AZR added to the database
|
||||
[GoRacerr]2024/08/30 17:48:11 Prerace Lana_Scolaro-Revenge_(TOLOKA_Smile_(UA)_Extended_Remix)-(POLY0024)-SINGLE-WEB-2024-AFO_INT added to the database
|
||||
[GoRacerr]2024/08/30 17:48:18 Prerace DWJ.-.Das.Magazin.fuer.Waffenbesitzer.No.09.2024.GERMAN.HYBRID.MAGAZINE.eBook-LORENZ added to the database
|
||||
[GoRacerr]2024/08/30 17:48:22 Prerace CSI.NY.S09E06.MULTi.1080p.WEB.H264-AZR added to the database
|
||||
[GoRacerr]2024/08/30 17:48:33 Prerace FACES.No.09.2024.GERMAN.HYBRID.MAGAZINE.eBook-LORENZ added to the database
|
||||
[GoRacerr]2024/08/30 17:49:01 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:49:01 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:49:01 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:49:24 Prerace FOCUS.No.36.2024.GERMAN.HYBRID.MAGAZINE.eBook-LORENZ added to the database
|
||||
[GoRacerr]2024/08/30 17:49:24 Prerace FOTOHITS.No.10.2024.GERMAN.HYBRID.MAGAZINE.eBook-LORENZ added to the database
|
||||
[GoRacerr]2024/08/30 17:49:26 Prerace Nihil_Young_and_Fredrik_Ferrier-Shimmer-(N484)-SINGLE-16BIT-WEB-FLAC-2024-AFO added to the database
|
||||
[GoRacerr]2024/08/30 17:49:48 Prerace HiFi.TEST.TV.HIFI.No.05.2024.GERMAN.HYBRID.MAGAZINE.eBook-LORENZ added to the database
|
||||
[GoRacerr]2024/08/30 17:49:49 Prerace LP.No.06.2024.GERMAN.HYBRID.MAGAZINE.eBook-LORENZ added to the database
|
||||
[GoRacerr]2024/08/30 17:50:15 Prerace LinuxWelt.Extra.No.01.2024.GERMAN.HYBRID.MAGAZINE.eBook-LORENZ added to the database
|
||||
[GoRacerr]2024/08/30 17:50:39 Prerace MICHEL-Rundschau.No.09.2024.GERMAN.HYBRID.MAGAZINE.eBook-LORENZ added to the database
|
||||
[GoRacerr]2024/08/30 17:50:45 Prerace Christian_Meldal-Sunset_(Extended_Mix)-(N486B)-SINGLE-WEB-2024-AFO_INT added to the database
|
||||
[GoRacerr]2024/08/30 17:51:00 Prerace Power-Wrestling.No.09.2024.GERMAN.HYBRID.MAGAZINE.eBook-LORENZ added to the database
|
||||
[GoRacerr]2024/08/30 17:51:02 Prerace Entropy - Dharmakāya [2024] (WEB FLAC 24BIT Lossless) added to the database
|
||||
[GoRacerr]2024/08/30 17:51:02 Prerace Entropy - Dharmakāya [2024] (WEB FLAC Lossless) added to the database
|
||||
[GoRacerr]2024/08/30 17:51:13 Starting GoRacerr on 0.0.0.0:3000
|
||||
[GoRacerr]2024/08/30 17:51:13 Opening SQLite database
|
||||
[GoRacerr]2024/08/30 17:51:13 Listening for new Preraces / Races
|
||||
[GoRacerr]2024/08/30 17:51:13 Prerace Holy Frit (2021) 1080p WEBRip 5.1-LAMA added to the database
|
||||
[GoRacerr]2024/08/30 17:52:49 Prerace Into The West S01E04 Hell on Wheels 1080p BluRay x264-OFT added to the database
|
||||
[GoRacerr]2024/08/30 17:55:19 Prerace Urotsukidoji.Legend.Of.The.Overfiend.1989.EXTENDED.BDRIP.X264-WATCHABLE added to the database
|
||||
[GoRacerr]2024/08/30 18:00:24 Prerace Kinds of Kindness 2024 2160p MA WEB-DL DDP5.1 Atmos H.265-HHWEB added to the database
|
||||
|
7
race.go
7
race.go
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
type Race struct {
|
||||
ID int64 `json:"id"`
|
||||
TorrentName string `json:"torrentname"`
|
||||
Category string `json:"category"`
|
||||
Indexer string `json:"indexer"`
|
||||
@ -16,8 +17,6 @@ type Race struct {
|
||||
PreRace bool `json:"prerace"`
|
||||
}
|
||||
|
||||
func NewRace(torrentName string) *Race {
|
||||
return &Race{
|
||||
TorrentName: torrentName,
|
||||
}
|
||||
func NewRace() *Race {
|
||||
return &Race{}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user