Permalink
Browse files

Fixes #281 Show all season banners

  • Loading branch information...
1 parent 826f38a commit 4b8a720924edb04b91cef2205639dceb514cf3fd Daniel Kabel committed Mar 8, 2013
Showing with 19 additions and 5 deletions.
  1. +17 −3 data/TvShow.cpp
  2. +1 −1 data/TvShow.h
  3. +1 −1 imageProviders/TheTvDbImages.cpp
View
@@ -598,12 +598,26 @@ QByteArray TvShow::seasonBannerImage(int season)
return m_seasonBannerImages[season];
}
-QList<Poster> TvShow::seasonBanners(int season) const
+QList<Poster> TvShow::seasonBanners(int season, bool returnAll) const
{
- if (!m_seasonBanners.contains(season))
+ if (!m_seasonBanners.contains(season) && !returnAll)
return QList<Poster>();
- return m_seasonBanners[season];
+ if (!returnAll)
+ return m_seasonBanners[season];
+
+ QList<Poster> banners;
+ if (m_seasonBanners.contains(season))
+ banners = m_seasonBanners[season];
+
+ QMapIterator<int, QList<Poster> > it(m_seasonBanners);
+ while (it.hasNext()) {
+ it.next();
+ if (it.key() == season)
+ continue;
+ banners << it.value();
+ }
+ return banners;
}
/**
View
@@ -67,7 +67,7 @@ class TvShow : public QObject
QList<Poster> banners() const;
QList<Poster> seasonPosters(int season) const;
QList<Poster> seasonBackdrops(int season) const;
- QList<Poster> seasonBanners(int season) const;
+ QList<Poster> seasonBanners(int season, bool returnAll = false) const;
bool posterImageChanged() const;
bool backdropImageChanged() const;
bool bannerImageChanged() const;
@@ -126,7 +126,7 @@ void TheTvDbImages::onLoadTvShowDataFinished()
} else if (m_currentType == TypeSeasonPoster) {
posters = m_dummyShow->seasonPosters(m_season);
} else if (m_currentType == TypeSeasonBanner) {
- posters = m_dummyShow->seasonBanners(m_season);
+ posters = m_dummyShow->seasonBanners(m_season, true);
} else if (m_currentType == TypeShowThumbnail && !m_dummyEpisode->thumbnail().isEmpty()) {
Poster p;
p.thumbUrl = m_dummyEpisode->thumbnail();

0 comments on commit 4b8a720

Please sign in to comment.