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