Fix uppercase infohashes

This commit is contained in:
Urban Guacamole
2021-01-03 10:36:05 +01:00
parent 716b0b036b
commit e3cce3988b

View File

@@ -7,6 +7,7 @@ import (
"log"
"os"
"strconv"
"strings"
"time"
"unicode/utf8"
@@ -62,6 +63,8 @@ func main() {
}
added := time.Unix(addedUnix, 0)
name = strings.ToLower(name)
//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)
if err, ok := err.(*pq.Error); ok { //dark magic