Add support for downloading artwork info for programme icon. #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Although programmes can have an episodeImage, this is often
missing from the SD data. For my channels, no programmes at all
have an episodeImage.
So we now fetch image information for every programme
we are downloading and use that to generate the programme icon.
We download the URL information only and not the actual artwork.
Since many programmes and show information are already cached,
the database will need to be cleared if you want the artwork
immediately for all programmes, otherwise it will be downloaded
the next time the show is updated since we only download images
for changed programmes.
The downloading is done on a "best effort" basis, so we don't keep
trying to re-download images for any shows where artwork is missing.
The overhead of downloading artwork seems minimal after the initial grab.
Where there is multiple artwork, we try and pick good quality episode artwork
(based on image width), but fall-back to show artwork otherwise.
For daytime shows sometimes there is no decent artwork for the show either
so in that case we pick up "iconic" artwork from the episode, which appears
to be just a screenshot.
I've tried to keep the code consistent with the existing logic, but error 5001
(queued) is ignored since I've never seen a case where a re-request is
successful.