mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-08 05:51:47 -07:00
Fixed: Previous airing in ArtistOverview not working
This commit is contained in:
parent
fe865fc4c3
commit
6ec8e522de
6 changed files with 54 additions and 18 deletions
|
@ -86,6 +86,7 @@ class ArtistIndexOverview extends Component {
|
|||
overviewOptions,
|
||||
showRelativeDates,
|
||||
shortDateFormat,
|
||||
longDateFormat,
|
||||
timeFormat,
|
||||
rowHeight,
|
||||
isSmallScreen,
|
||||
|
@ -203,6 +204,7 @@ class ArtistIndexOverview extends Component {
|
|||
qualityProfile={qualityProfile}
|
||||
showRelativeDates={showRelativeDates}
|
||||
shortDateFormat={shortDateFormat}
|
||||
longDateFormat={longDateFormat}
|
||||
timeFormat={timeFormat}
|
||||
{...overviewOptions}
|
||||
{...otherProps}
|
||||
|
@ -246,6 +248,7 @@ ArtistIndexOverview.propTypes = {
|
|||
overviewOptions: PropTypes.object.isRequired,
|
||||
showRelativeDates: PropTypes.bool.isRequired,
|
||||
shortDateFormat: PropTypes.string.isRequired,
|
||||
longDateFormat: PropTypes.string.isRequired,
|
||||
timeFormat: PropTypes.string.isRequired,
|
||||
isSmallScreen: PropTypes.bool.isRequired,
|
||||
isRefreshingArtist: PropTypes.bool.isRequired,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint max-params: 0 */
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import formatDateTime from 'Utilities/Date/formatDateTime';
|
||||
import getRelativeDate from 'Utilities/Date/getRelativeDate';
|
||||
import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import { icons } from 'Helpers/Props';
|
||||
|
@ -22,6 +22,11 @@ const rows = [
|
|||
showProp: 'showQualityProfile',
|
||||
valueProp: 'qualityProfileId'
|
||||
},
|
||||
{
|
||||
name: 'lastAlbum',
|
||||
showProp: 'showLastAlbum',
|
||||
valueProp: 'lastAlbum'
|
||||
},
|
||||
{
|
||||
name: 'added',
|
||||
showProp: 'showAdded',
|
||||
|
@ -73,22 +78,46 @@ function getInfoRowProps(row, props) {
|
|||
|
||||
if (name === 'qualityProfileId') {
|
||||
return {
|
||||
title: 'Quality PROFILE',
|
||||
title: 'Quality Profile',
|
||||
iconName: icons.PROFILE,
|
||||
label: props.qualityProfile.name
|
||||
};
|
||||
}
|
||||
|
||||
if (name === 'lastAlbum') {
|
||||
const {
|
||||
lastAlbum,
|
||||
showRelativeDates,
|
||||
shortDateFormat,
|
||||
timeFormat
|
||||
} = props;
|
||||
|
||||
return {
|
||||
title: `Last Album: ${lastAlbum.title}`,
|
||||
iconName: icons.CALENDAR,
|
||||
label: getRelativeDate(
|
||||
lastAlbum.releaseDate,
|
||||
shortDateFormat,
|
||||
showRelativeDates,
|
||||
{
|
||||
timeFormat,
|
||||
timeForToday: true
|
||||
}
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
if (name === 'added') {
|
||||
const {
|
||||
added,
|
||||
shortDateFormat,
|
||||
showRelativeDates,
|
||||
shortDateFormat,
|
||||
longDateFormat,
|
||||
timeFormat
|
||||
} = props;
|
||||
|
||||
return {
|
||||
title: 'Added',
|
||||
title: `Added: ${formatDateTime(added, longDateFormat, timeFormat)}`,
|
||||
iconName: icons.ADD,
|
||||
label: getRelativeDate(
|
||||
added,
|
||||
|
@ -142,6 +171,7 @@ function ArtistIndexOverviewInfo(props) {
|
|||
nextAiring,
|
||||
showRelativeDates,
|
||||
shortDateFormat,
|
||||
longDateFormat,
|
||||
timeFormat
|
||||
} = props;
|
||||
|
||||
|
@ -154,7 +184,7 @@ function ArtistIndexOverviewInfo(props) {
|
|||
{
|
||||
!!nextAiring &&
|
||||
<ArtistIndexOverviewInfoRow
|
||||
title={nextAiring}
|
||||
title={formatDateTime(nextAiring, longDateFormat, timeFormat)}
|
||||
iconName={icons.SCHEDULED}
|
||||
label={getRelativeDate(
|
||||
nextAiring,
|
||||
|
@ -196,7 +226,6 @@ function ArtistIndexOverviewInfo(props) {
|
|||
|
||||
ArtistIndexOverviewInfo.propTypes = {
|
||||
height: PropTypes.number.isRequired,
|
||||
showNetwork: PropTypes.bool.isRequired,
|
||||
showMonitored: PropTypes.bool.isRequired,
|
||||
showQualityProfile: PropTypes.bool.isRequired,
|
||||
showAdded: PropTypes.bool.isRequired,
|
||||
|
@ -206,7 +235,7 @@ ArtistIndexOverviewInfo.propTypes = {
|
|||
monitored: PropTypes.bool.isRequired,
|
||||
nextAiring: PropTypes.string,
|
||||
qualityProfile: PropTypes.object.isRequired,
|
||||
previousAiring: PropTypes.string,
|
||||
lastAlbum: PropTypes.object,
|
||||
added: PropTypes.string,
|
||||
albumCount: PropTypes.number.isRequired,
|
||||
path: PropTypes.string.isRequired,
|
||||
|
@ -214,6 +243,7 @@ ArtistIndexOverviewInfo.propTypes = {
|
|||
sortKey: PropTypes.string.isRequired,
|
||||
showRelativeDates: PropTypes.bool.isRequired,
|
||||
shortDateFormat: PropTypes.string.isRequired,
|
||||
longDateFormat: PropTypes.string.isRequired,
|
||||
timeFormat: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
|
|
|
@ -167,6 +167,7 @@ class ArtistIndexOverviews extends Component {
|
|||
overviewOptions,
|
||||
showRelativeDates,
|
||||
shortDateFormat,
|
||||
longDateFormat,
|
||||
timeFormat,
|
||||
isSmallScreen
|
||||
} = this.props;
|
||||
|
@ -194,6 +195,7 @@ class ArtistIndexOverviews extends Component {
|
|||
overviewOptions={overviewOptions}
|
||||
showRelativeDates={showRelativeDates}
|
||||
shortDateFormat={shortDateFormat}
|
||||
longDateFormat={longDateFormat}
|
||||
timeFormat={timeFormat}
|
||||
isSmallScreen={isSmallScreen}
|
||||
style={style}
|
||||
|
@ -278,6 +280,7 @@ ArtistIndexOverviews.propTypes = {
|
|||
contentBody: PropTypes.object.isRequired,
|
||||
showRelativeDates: PropTypes.bool.isRequired,
|
||||
shortDateFormat: PropTypes.string.isRequired,
|
||||
longDateFormat: PropTypes.string.isRequired,
|
||||
isSmallScreen: PropTypes.bool.isRequired,
|
||||
timeFormat: PropTypes.string.isRequired,
|
||||
onRender: PropTypes.func.isRequired,
|
||||
|
|
|
@ -16,6 +16,7 @@ function createMapStateToProps() {
|
|||
overviewOptions,
|
||||
showRelativeDates: uiSettings.showRelativeDates,
|
||||
shortDateFormat: uiSettings.shortDateFormat,
|
||||
longDateFormat: uiSettings.longDateFormat,
|
||||
timeFormat: uiSettings.timeFormat,
|
||||
isSmallScreen: dimensions.isSmallScreen,
|
||||
...artist
|
||||
|
|
|
@ -31,7 +31,7 @@ class ArtistIndexOverviewOptionsModalContent extends Component {
|
|||
size: props.size,
|
||||
showMonitored: props.showMonitored,
|
||||
showQualityProfile: props.showQualityProfile,
|
||||
showPreviousAiring: props.showPreviousAiring,
|
||||
showLastAlbum: props.showLastAlbum,
|
||||
showAdded: props.showAdded,
|
||||
showAlbumCount: props.showAlbumCount,
|
||||
showPath: props.showPath,
|
||||
|
@ -45,7 +45,7 @@ class ArtistIndexOverviewOptionsModalContent extends Component {
|
|||
size,
|
||||
showMonitored,
|
||||
showQualityProfile,
|
||||
showPreviousAiring,
|
||||
showLastAlbum,
|
||||
showAdded,
|
||||
showAlbumCount,
|
||||
showPath,
|
||||
|
@ -70,8 +70,8 @@ class ArtistIndexOverviewOptionsModalContent extends Component {
|
|||
state.showQualityProfile = showQualityProfile;
|
||||
}
|
||||
|
||||
if (showPreviousAiring !== prevProps.showPreviousAiring) {
|
||||
state.showPreviousAiring = showPreviousAiring;
|
||||
if (showLastAlbum !== prevProps.showLastAlbum) {
|
||||
state.showLastAlbum = showLastAlbum;
|
||||
}
|
||||
|
||||
if (showAdded !== prevProps.showAdded) {
|
||||
|
@ -119,7 +119,7 @@ class ArtistIndexOverviewOptionsModalContent extends Component {
|
|||
size,
|
||||
showMonitored,
|
||||
showQualityProfile,
|
||||
showPreviousAiring,
|
||||
showLastAlbum,
|
||||
showAdded,
|
||||
showAlbumCount,
|
||||
showPath,
|
||||
|
@ -182,12 +182,12 @@ class ArtistIndexOverviewOptionsModalContent extends Component {
|
|||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Show Previous Airing</FormLabel>
|
||||
<FormLabel>Show Last Album</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="showPreviousAiring"
|
||||
value={showPreviousAiring}
|
||||
name="showLastAlbum"
|
||||
value={showLastAlbum}
|
||||
onChange={this.onChangeOverviewOption}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
@ -254,7 +254,7 @@ ArtistIndexOverviewOptionsModalContent.propTypes = {
|
|||
size: PropTypes.string.isRequired,
|
||||
showMonitored: PropTypes.bool.isRequired,
|
||||
showQualityProfile: PropTypes.bool.isRequired,
|
||||
showPreviousAiring: PropTypes.bool.isRequired,
|
||||
showLastAlbum: PropTypes.bool.isRequired,
|
||||
showAdded: PropTypes.bool.isRequired,
|
||||
showAlbumCount: PropTypes.bool.isRequired,
|
||||
showPath: PropTypes.bool.isRequired,
|
||||
|
|
|
@ -43,9 +43,8 @@ export const defaultState = {
|
|||
detailedProgressBar: false,
|
||||
size: 'medium',
|
||||
showMonitored: true,
|
||||
showNetwork: true,
|
||||
showQualityProfile: true,
|
||||
showPreviousAiring: false,
|
||||
showLastAlbum: false,
|
||||
showAdded: false,
|
||||
showAlbumCount: true,
|
||||
showPath: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue