If you're going to do something inside of a loop, I prefer to limit the results, and then act on them.

In this case, you just want the Shows, right? So, why not query for the shows, instead of the network? How might that look?