Skip to content

Commit

Permalink
Experiment with unifying Artwork interface for all databases
Browse files Browse the repository at this point in the history
  • Loading branch information
rednoah committed Apr 17, 2016
1 parent 4e6a621 commit c07ec3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion amc.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ groups.each{ group, files ->
if (dest != null) {
if (artwork) {
dest.mapByFolder().each{ dir, fs ->
def hasSeasonFolder = (config.format =~ /(?i)Season/)
def hasSeasonFolder = dir.name =~ /(?i:Season.\d+)/
def sxe = fs.findResult{ eps -> parseEpisodeNumber(eps) }
def seriesName = detectSeriesName(fs)
def options = TheTVDB.search(seriesName, _args.locale)
Expand Down
8 changes: 3 additions & 5 deletions lib/htpc.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def fetchSeriesBanner(outputFile, series, bannerType, bannerType2, season, overr
}

// select and fetch banner
def banner = [locale, null].findResult { TheTVDB.getBanner(series, [BannerType:bannerType, BannerType2:bannerType2, Season:season, Language:it]) }
def artwork = TheTVDB.getArtwork(series.id, bannerType, locale)
def banner = [locale.language, null].findResult { lang -> artwork.find{ (bannerType2 == null || it.category.contains(bannerType2)) && (season == null || it.category.contains(season)) && (lang == null || lang == it.language) } }
if (banner == null) {
log.finest "Banner not found: $outputFile / $bannerType:$bannerType2"
return null
Expand All @@ -85,7 +86,7 @@ def fetchSeriesFanart(outputFile, series, type, season, override, locale) {
}

def artwork = FanartTV.getArtwork(series.id, "tv", locale)
def fanart = [locale, null].findResult{ lang -> artwork.find{ it.category.contains(type) && (season == null || it.category.contains(season)) && (lang == null || lang == it.language) }}
def fanart = [locale.language, null].findResult{ lang -> artwork.find{ it.category.contains(type) && (season == null || it.category.contains(season)) && (lang == null || lang == it.language) }}
if (fanart == null) {
log.finest "Fanart not found: $outputFile / $type"
return null
Expand All @@ -108,9 +109,6 @@ def fetchSeriesNfo(outputFile, seriesInfo, locale) {
runtime(i.runtime)
mpaa(i.contentRating)
id(i.id)
episodeguide {
url(cache:"${i.id}.xml", "http://www.thetvdb.com/api/1D62F2F90030C444/series/${i.id}/all/${locale.language}.zip")
}
i.genres?.each{
genre(it)
}
Expand Down

0 comments on commit c07ec3d

Please sign in to comment.