SickGear/sickbeard/metadata/helpers.py

40 lines
1.4 KiB
Python
Raw Normal View History

# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SickGear is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
from sickbeard import helpers
from sickbeard import logger
def getShowImage(url, imgNum=None, showName=None):
Add fanart to Episodes View, Display Show, Edit Show, and Media Renamer page. Add "Maximum fanart image files per show to cache" to config General/Interface. Add populate images when the daily show updater is run with a default maximum 3 images per show. Change force full update in a show will replace existing images with new. Add fanart livepanel to lower right of Episodes View and Display Show page. Add highlight panel red until button is clicked a few times. Add flick through multiple background images on Episodes View and Display Show page. Add persistent move poster image to right hand side or hide on Display Show page (multi-click the eye). Add persistent translucency of background images on Episodes View and Display Show page. Add persistent fanart rating to avoid art completely, random display, random from a group, or display fave always. Add persistent views of the show detail on Display Show page. Add persistent views on Episodes View. Add persistent button to collapse and expand card images on Episode View/Layout daybyday. Add non persistent "Open gear" and "Full fanart" image views to Episodes View and Display Show page. Add "smart" selection of fanart image to display on Episode view. Change insert [!] and change text shade of ended shows in drop down show list on Display Show page. Change button graphic for next and previous show of show list on Display Show page. Add logic to hide some livepanel buttons until artwork becomes available or in other circumstances. Add "(Ended)" where appropriate to show title on Display Show page. Add links to fanart.tv where appropriate on Display Show page. Change use tense for label "Airs" or "Aired" depending on if show ended. Change display "No files" instead of "0 files" and "Upgrade once" instead of "End upgrade on first match". Add persistent button to newest season to "Show all" episodes. Add persistent button to all shown seasons to "Hide most" episodes. Add button to older seasons to toggle "Show Season n" or "Show Specials" with "Hide..." episodes. Add season level status counts next to each season header on display show page Add sorting to season table headers on display show page Add filename and size to quality badge on display show page, removed its redundant "downloaded" text Remove redundant "Add show" buttons Change combine the NFO and TBN columns into a single Meta column Change reduce screen estate used by episode numbers columns Change improve clarity of text on Add Show page. Add "Reset fanart ratings" to show Edit/Other tab. Add fanart usage to show Edit/Other tab. Add fanart keys guide to show Edit/Other tab. Change add placeholder tip to "Alternative release name(s)" on show Edit. Change add placeholder tip to search box on shows Search. Change hide Anime tips on show Edit when selecting its mutually exclusive options. Change label "End upgrade on first match" to "Upgrade once" on show Edit. Change improve performance rendering displayShow. Add total episodes to start of show description (excludes specials if those are hidden). Add "Add show" actions i.e. "Search", "Trakt cards", "IMDb cards", and "Anime" to Shows menu. Add "Import (existing)" action to Tools menu. Change SD quality from red to dark green, 2160p UHD 4K is red. Change relocate the functions of Logs & Errors to the right side Tools menu -> View Log File. Add warning indicator to the Tools menu in different colour depending on error count (green through red). Change View Log error item output from reversed to natural order. Change View Log add a typeface and some colour to improve readability. Change View Log/Errors only display "Clear Errors" button when there are errors to clear. Change improve performance of View Log File.
2016-02-28 23:43:40 +00:00
if None is url:
return None
# if they provided a fanart number try to use it instead
Add fanart to Episodes View, Display Show, Edit Show, and Media Renamer page. Add "Maximum fanart image files per show to cache" to config General/Interface. Add populate images when the daily show updater is run with a default maximum 3 images per show. Change force full update in a show will replace existing images with new. Add fanart livepanel to lower right of Episodes View and Display Show page. Add highlight panel red until button is clicked a few times. Add flick through multiple background images on Episodes View and Display Show page. Add persistent move poster image to right hand side or hide on Display Show page (multi-click the eye). Add persistent translucency of background images on Episodes View and Display Show page. Add persistent fanart rating to avoid art completely, random display, random from a group, or display fave always. Add persistent views of the show detail on Display Show page. Add persistent views on Episodes View. Add persistent button to collapse and expand card images on Episode View/Layout daybyday. Add non persistent "Open gear" and "Full fanart" image views to Episodes View and Display Show page. Add "smart" selection of fanart image to display on Episode view. Change insert [!] and change text shade of ended shows in drop down show list on Display Show page. Change button graphic for next and previous show of show list on Display Show page. Add logic to hide some livepanel buttons until artwork becomes available or in other circumstances. Add "(Ended)" where appropriate to show title on Display Show page. Add links to fanart.tv where appropriate on Display Show page. Change use tense for label "Airs" or "Aired" depending on if show ended. Change display "No files" instead of "0 files" and "Upgrade once" instead of "End upgrade on first match". Add persistent button to newest season to "Show all" episodes. Add persistent button to all shown seasons to "Hide most" episodes. Add button to older seasons to toggle "Show Season n" or "Show Specials" with "Hide..." episodes. Add season level status counts next to each season header on display show page Add sorting to season table headers on display show page Add filename and size to quality badge on display show page, removed its redundant "downloaded" text Remove redundant "Add show" buttons Change combine the NFO and TBN columns into a single Meta column Change reduce screen estate used by episode numbers columns Change improve clarity of text on Add Show page. Add "Reset fanart ratings" to show Edit/Other tab. Add fanart usage to show Edit/Other tab. Add fanart keys guide to show Edit/Other tab. Change add placeholder tip to "Alternative release name(s)" on show Edit. Change add placeholder tip to search box on shows Search. Change hide Anime tips on show Edit when selecting its mutually exclusive options. Change label "End upgrade on first match" to "Upgrade once" on show Edit. Change improve performance rendering displayShow. Add total episodes to start of show description (excludes specials if those are hidden). Add "Add show" actions i.e. "Search", "Trakt cards", "IMDb cards", and "Anime" to Shows menu. Add "Import (existing)" action to Tools menu. Change SD quality from red to dark green, 2160p UHD 4K is red. Change relocate the functions of Logs & Errors to the right side Tools menu -> View Log File. Add warning indicator to the Tools menu in different colour depending on error count (green through red). Change View Log error item output from reversed to natural order. Change View Log add a typeface and some colour to improve readability. Change View Log/Errors only display "Clear Errors" button when there are errors to clear. Change improve performance of View Log File.
2016-02-28 23:43:40 +00:00
temp_url = url if None is imgNum else url.split('-')[0] + '-' + str(imgNum) + '.jpg'
Add fanart to Episodes View, Display Show, Edit Show, and Media Renamer page. Add "Maximum fanart image files per show to cache" to config General/Interface. Add populate images when the daily show updater is run with a default maximum 3 images per show. Change force full update in a show will replace existing images with new. Add fanart livepanel to lower right of Episodes View and Display Show page. Add highlight panel red until button is clicked a few times. Add flick through multiple background images on Episodes View and Display Show page. Add persistent move poster image to right hand side or hide on Display Show page (multi-click the eye). Add persistent translucency of background images on Episodes View and Display Show page. Add persistent fanart rating to avoid art completely, random display, random from a group, or display fave always. Add persistent views of the show detail on Display Show page. Add persistent views on Episodes View. Add persistent button to collapse and expand card images on Episode View/Layout daybyday. Add non persistent "Open gear" and "Full fanart" image views to Episodes View and Display Show page. Add "smart" selection of fanart image to display on Episode view. Change insert [!] and change text shade of ended shows in drop down show list on Display Show page. Change button graphic for next and previous show of show list on Display Show page. Add logic to hide some livepanel buttons until artwork becomes available or in other circumstances. Add "(Ended)" where appropriate to show title on Display Show page. Add links to fanart.tv where appropriate on Display Show page. Change use tense for label "Airs" or "Aired" depending on if show ended. Change display "No files" instead of "0 files" and "Upgrade once" instead of "End upgrade on first match". Add persistent button to newest season to "Show all" episodes. Add persistent button to all shown seasons to "Hide most" episodes. Add button to older seasons to toggle "Show Season n" or "Show Specials" with "Hide..." episodes. Add season level status counts next to each season header on display show page Add sorting to season table headers on display show page Add filename and size to quality badge on display show page, removed its redundant "downloaded" text Remove redundant "Add show" buttons Change combine the NFO and TBN columns into a single Meta column Change reduce screen estate used by episode numbers columns Change improve clarity of text on Add Show page. Add "Reset fanart ratings" to show Edit/Other tab. Add fanart usage to show Edit/Other tab. Add fanart keys guide to show Edit/Other tab. Change add placeholder tip to "Alternative release name(s)" on show Edit. Change add placeholder tip to search box on shows Search. Change hide Anime tips on show Edit when selecting its mutually exclusive options. Change label "End upgrade on first match" to "Upgrade once" on show Edit. Change improve performance rendering displayShow. Add total episodes to start of show description (excludes specials if those are hidden). Add "Add show" actions i.e. "Search", "Trakt cards", "IMDb cards", and "Anime" to Shows menu. Add "Import (existing)" action to Tools menu. Change SD quality from red to dark green, 2160p UHD 4K is red. Change relocate the functions of Logs & Errors to the right side Tools menu -> View Log File. Add warning indicator to the Tools menu in different colour depending on error count (green through red). Change View Log error item output from reversed to natural order. Change View Log add a typeface and some colour to improve readability. Change View Log/Errors only display "Clear Errors" button when there are errors to clear. Change improve performance of View Log File.
2016-02-28 23:43:40 +00:00
logger.log(u'Fetching image from ' + temp_url, logger.DEBUG)
Add fanart to Episodes View, Display Show, Edit Show, and Media Renamer page. Add "Maximum fanart image files per show to cache" to config General/Interface. Add populate images when the daily show updater is run with a default maximum 3 images per show. Change force full update in a show will replace existing images with new. Add fanart livepanel to lower right of Episodes View and Display Show page. Add highlight panel red until button is clicked a few times. Add flick through multiple background images on Episodes View and Display Show page. Add persistent move poster image to right hand side or hide on Display Show page (multi-click the eye). Add persistent translucency of background images on Episodes View and Display Show page. Add persistent fanart rating to avoid art completely, random display, random from a group, or display fave always. Add persistent views of the show detail on Display Show page. Add persistent views on Episodes View. Add persistent button to collapse and expand card images on Episode View/Layout daybyday. Add non persistent "Open gear" and "Full fanart" image views to Episodes View and Display Show page. Add "smart" selection of fanart image to display on Episode view. Change insert [!] and change text shade of ended shows in drop down show list on Display Show page. Change button graphic for next and previous show of show list on Display Show page. Add logic to hide some livepanel buttons until artwork becomes available or in other circumstances. Add "(Ended)" where appropriate to show title on Display Show page. Add links to fanart.tv where appropriate on Display Show page. Change use tense for label "Airs" or "Aired" depending on if show ended. Change display "No files" instead of "0 files" and "Upgrade once" instead of "End upgrade on first match". Add persistent button to newest season to "Show all" episodes. Add persistent button to all shown seasons to "Hide most" episodes. Add button to older seasons to toggle "Show Season n" or "Show Specials" with "Hide..." episodes. Add season level status counts next to each season header on display show page Add sorting to season table headers on display show page Add filename and size to quality badge on display show page, removed its redundant "downloaded" text Remove redundant "Add show" buttons Change combine the NFO and TBN columns into a single Meta column Change reduce screen estate used by episode numbers columns Change improve clarity of text on Add Show page. Add "Reset fanart ratings" to show Edit/Other tab. Add fanart usage to show Edit/Other tab. Add fanart keys guide to show Edit/Other tab. Change add placeholder tip to "Alternative release name(s)" on show Edit. Change add placeholder tip to search box on shows Search. Change hide Anime tips on show Edit when selecting its mutually exclusive options. Change label "End upgrade on first match" to "Upgrade once" on show Edit. Change improve performance rendering displayShow. Add total episodes to start of show description (excludes specials if those are hidden). Add "Add show" actions i.e. "Search", "Trakt cards", "IMDb cards", and "Anime" to Shows menu. Add "Import (existing)" action to Tools menu. Change SD quality from red to dark green, 2160p UHD 4K is red. Change relocate the functions of Logs & Errors to the right side Tools menu -> View Log File. Add warning indicator to the Tools menu in different colour depending on error count (green through red). Change View Log error item output from reversed to natural order. Change View Log add a typeface and some colour to improve readability. Change View Log/Errors only display "Clear Errors" button when there are errors to clear. Change improve performance of View Log File.
2016-02-28 23:43:40 +00:00
image_data = helpers.getURL(temp_url)
if None is image_data:
logger.log('There was an error trying to retrieve the image%s, aborting' %
('', ' for show: %s' % showName)[None is not showName], logger.WARNING)
return
return image_data