|
|
@ -7,6 +7,7 @@ import (
|
|
|
|
"log"
|
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"strconv"
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
"strings"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
"unicode/utf8"
|
|
|
|
"unicode/utf8"
|
|
|
|
|
|
|
|
|
|
|
@ -62,6 +63,8 @@ func main() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
added := time.Unix(addedUnix, 0)
|
|
|
|
added := time.Unix(addedUnix, 0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
name = strings.ToLower(name)
|
|
|
|
|
|
|
|
|
|
|
|
//fmt.Printf("Ih %v name %v len %v added %v", infohash, name, length, added)
|
|
|
|
//fmt.Printf("Ih %v name %v len %v added %v", infohash, name, length, added)
|
|
|
|
_, err = db.Exec("INSERT INTO torrent (infohash, name, length, added) VALUES ($1, $2, $3, $4)", infohash, name, length, added)
|
|
|
|
_, err = db.Exec("INSERT INTO torrent (infohash, name, length, added) VALUES ($1, $2, $3, $4)", infohash, name, length, added)
|
|
|
|
if err, ok := err.(*pq.Error); ok { //dark magic
|
|
|
|
if err, ok := err.(*pq.Error); ok { //dark magic
|
|
|
|