func NumTorrents(d core.Database) int { c := make(chan string) go d.GetTorrents(c) count := 0 for range c { count += 1 } return count }