Skip to content
This repository has been archived by the owner on Aug 27, 2020. It is now read-only.

Commit

Permalink
Skip anything imported that doesn't have a 40 char btih. Closes #29.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen304 committed Jan 17, 2015
1 parent 1e6f130 commit 1dbec16
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,8 @@ func importLine(line string) (bool, error) {
return false, errors.New("Something's up with this torrent. Expected 5 values separated by |.")
}
data := strings.Split(line, "|")
if len(data[0]) != 40 {
return false, errors.New("Probably not a torrent archive")
}
return torrentDB.Insert(data[0], data[1], data[2], data[3], data[4])
}

0 comments on commit 1dbec16

Please sign in to comment.