plexinc-plugins/4oD.bundle — pull request #8 by ReallyFuzzy (2012-10-16 23:50:19+00:00)
Title: Fix for shows with no series thumb

Hi,

Certain popular shows (well ok, I've found one so far) don't have normal series pages but instead have mini sites dedicated to them.

These mini sites don't follow the normal rules and as such the plugin isn't able to find a thumb for the series. Which, due to a "bug" in ResourceKit, then breaks the plugin when trying to navigate through to the episode listing for which it tries to pass through the non-existent series thumb.

This works around the ResourceKit bug by ensuring that if the series thumb hasn't been set then we don't pass it down to ContentsOfURLWithFallback where passing a None value type to urllib.quote will raise an exception.

The real fix is quite simple but as I can't seem to find an up-to-date Framework.bundle on GitHub, there's no easy way to pass that on.

So I guess, a diff will have to do.

Running it with patch on Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/resourcekit.py applies cleanly.

89c89
< urls = ','.join([urllib.quote(u) for u in url]) if isinstance(url, list) else None,
---
> urls = ','.join([urllib.quote(u) for u in filter(None, url)]) if isinstance(url, list) else None,