From 1b64171b30dc04699139361a2c840d3854d4b498 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 28 Oct 2017 15:51:10 -0400 Subject: [PATCH] Fix Poster Render on Add Artist, Add EPs by Default --- frontend/src/Artist/ArtistBanner.js | 2 +- frontend/src/Artist/ArtistPoster.js | 2 +- frontend/src/Artist/Details/ArtistDetails.js | 15 ++++----------- .../src/Artist/Details/ArtistDetailsSeason.js | 6 +++--- frontend/src/Store/Reducers/addArtistReducers.js | 2 +- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/frontend/src/Artist/ArtistBanner.js b/frontend/src/Artist/ArtistBanner.js index b79c5cc97..6bc5d7fe6 100644 --- a/frontend/src/Artist/ArtistBanner.js +++ b/frontend/src/Artist/ArtistBanner.js @@ -11,7 +11,7 @@ function findBanner(images) { function getBannerUrl(banner, size) { if (banner) { - if (banner.url.contains('lastWrite')) { + if (banner.url.contains('lastWrite=') || (/^https?:/).test(banner.url)) { // Remove protocol let url = banner.url.replace(/^https?:/, ''); url = url.replace('banner.jpg', `banner-${size}.jpg`); diff --git a/frontend/src/Artist/ArtistPoster.js b/frontend/src/Artist/ArtistPoster.js index 84867681b..25b744c80 100644 --- a/frontend/src/Artist/ArtistPoster.js +++ b/frontend/src/Artist/ArtistPoster.js @@ -11,7 +11,7 @@ function findPoster(images) { function getPosterUrl(poster, size) { if (poster) { - if (poster.url.contains('lastWrite')) { + if (poster.url.contains('lastWrite=') || (/^https?:/).test(poster.url)) { // Remove protocol let url = poster.url.replace(/^https?:/, ''); url = url.replace('poster.jpg', `poster-${size}.jpg`); diff --git a/frontend/src/Artist/Details/ArtistDetails.js b/frontend/src/Artist/Details/ArtistDetails.js index 63a690d07..de11c7766 100644 --- a/frontend/src/Artist/Details/ArtistDetails.js +++ b/frontend/src/Artist/Details/ArtistDetails.js @@ -38,13 +38,13 @@ const albumTypes = [ isVisible: true }, { - name: 'single', - label: 'Single', + name: 'ep', + label: 'EP', isVisible: true }, { - name: 'ep', - label: 'EP', + name: 'single', + label: 'Single', isVisible: true }, { @@ -524,13 +524,6 @@ class ArtistDetails extends Component { } - { - isPopulated && !albums.length && -
- No episode information is available. -
- } - { - return isAfter(item.airDateUtc) || - isAfter(item.airDateUtc, { days: -30 }); + return isAfter(item.releaseDate) || + isAfter(item.releaseDate, { days: -30 }); }); onExpandPress(name, expand && name > 0); @@ -273,7 +273,7 @@ class ArtistDetailsSeason extends Component { diff --git a/frontend/src/Store/Reducers/addArtistReducers.js b/frontend/src/Store/Reducers/addArtistReducers.js index 5a4b8863a..951d362ef 100644 --- a/frontend/src/Store/Reducers/addArtistReducers.js +++ b/frontend/src/Store/Reducers/addArtistReducers.js @@ -22,7 +22,7 @@ export const defaultState = { monitor: 'allEpisodes', qualityProfileId: 0, languageProfileId: 0, - primaryAlbumTypes: ['Album'], + primaryAlbumTypes: ['Album', 'EP'], secondaryAlbumTypes: ['Studio'], albumFolder: true, tags: []