This isn't looking for sources.  It's looking for paths that have scraper content assigned.  These don't need to be the same thing (but for most users they will be).  In particular, for some episode/show subpaths they might be shows inside a source (due to a bug where we store content when we find a .nfo file).

What you have is better than we have before though.

IMO it can't be remedied properly without the sources themselves being stored in the database.