Fixed: Added missing sort token details for poster views

Fixes #1424
pull/1398/head
ta264 3 years ago
parent 472da10149
commit 76bcf94f1d

@ -94,6 +94,7 @@ class AuthorIndexPoster extends Component {
showMonitored, showMonitored,
showQualityProfile, showQualityProfile,
qualityProfile, qualityProfile,
metadataProfile,
showSearchAction, showSearchAction,
showRelativeDates, showRelativeDates,
shortDateFormat, shortDateFormat,
@ -259,6 +260,7 @@ class AuthorIndexPoster extends Component {
sizeOnDisk={sizeOnDisk} sizeOnDisk={sizeOnDisk}
qualityProfile={qualityProfile} qualityProfile={qualityProfile}
showQualityProfile={showQualityProfile} showQualityProfile={showQualityProfile}
metadataProfile={metadataProfile}
showRelativeDates={showRelativeDates} showRelativeDates={showRelativeDates}
shortDateFormat={shortDateFormat} shortDateFormat={shortDateFormat}
timeFormat={timeFormat} timeFormat={timeFormat}
@ -300,6 +302,7 @@ AuthorIndexPoster.propTypes = {
showMonitored: PropTypes.bool.isRequired, showMonitored: PropTypes.bool.isRequired,
showQualityProfile: PropTypes.bool.isRequired, showQualityProfile: PropTypes.bool.isRequired,
qualityProfile: PropTypes.object.isRequired, qualityProfile: PropTypes.object.isRequired,
metadataProfile: PropTypes.object.isRequired,
showSearchAction: PropTypes.bool.isRequired, showSearchAction: PropTypes.bool.isRequired,
showRelativeDates: PropTypes.bool.isRequired, showRelativeDates: PropTypes.bool.isRequired,
shortDateFormat: PropTypes.string.isRequired, shortDateFormat: PropTypes.string.isRequired,

@ -8,8 +8,10 @@ function AuthorIndexPosterInfo(props) {
const { const {
qualityProfile, qualityProfile,
showQualityProfile, showQualityProfile,
previousAiring, metadataProfile,
added, added,
nextBook,
lastBook,
bookCount, bookCount,
path, path,
sizeOnDisk, sizeOnDisk,
@ -27,27 +29,53 @@ function AuthorIndexPosterInfo(props) {
); );
} }
if (sortKey === 'previousAiring' && previousAiring) { if (sortKey === 'metadataProfileId') {
return ( return (
<div className={styles.info}> <div className={styles.info}>
{ {metadataProfile.name}
getRelativeDate( </div>
previousAiring, );
}
if (sortKey === 'added' && added) {
const addedDate = getRelativeDate(
added,
shortDateFormat, shortDateFormat,
showRelativeDates, showRelativeDates,
{ {
timeFormat, timeFormat,
timeForToday: true timeForToday: false
} }
) );
return (
<div className={styles.info}>
{`Added ${addedDate}`}
</div>
);
} }
if (sortKey === 'nextBook' && nextBook) {
const date = getRelativeDate(
nextBook.releaseDate,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
return (
<div className={styles.info}>
{`Next Book ${date}`}
</div> </div>
); );
} }
if (sortKey === 'added' && added) { if (sortKey === 'lastBook' && lastBook) {
const addedDate = getRelativeDate( const date = getRelativeDate(
added, lastBook.releaseDate,
shortDateFormat, shortDateFormat,
showRelativeDates, showRelativeDates,
{ {
@ -58,7 +86,7 @@ function AuthorIndexPosterInfo(props) {
return ( return (
<div className={styles.info}> <div className={styles.info}>
{`Added ${addedDate}`} {`Last Book ${date}`}
</div> </div>
); );
} }
@ -101,8 +129,10 @@ function AuthorIndexPosterInfo(props) {
AuthorIndexPosterInfo.propTypes = { AuthorIndexPosterInfo.propTypes = {
qualityProfile: PropTypes.object.isRequired, qualityProfile: PropTypes.object.isRequired,
showQualityProfile: PropTypes.bool.isRequired, showQualityProfile: PropTypes.bool.isRequired,
previousAiring: PropTypes.string, metadataProfile: PropTypes.object.isRequired,
added: PropTypes.string, added: PropTypes.string,
nextBook: PropTypes.object,
lastBook: PropTypes.object,
bookCount: PropTypes.number.isRequired, bookCount: PropTypes.number.isRequired,
path: PropTypes.string.isRequired, path: PropTypes.string.isRequired,
sizeOnDisk: PropTypes.number, sizeOnDisk: PropTypes.number,

@ -8,8 +8,8 @@ function BookIndexPosterInfo(props) {
const { const {
qualityProfile, qualityProfile,
showQualityProfile, showQualityProfile,
previousAiring,
added, added,
releaseDate,
author, author,
bookFileCount, bookFileCount,
sizeOnDisk, sizeOnDisk,
@ -27,27 +27,27 @@ function BookIndexPosterInfo(props) {
); );
} }
if (sortKey === 'previousAiring' && previousAiring) { if (sortKey === 'added' && added) {
return ( const addedDate = getRelativeDate(
<div className={styles.info}> added,
{
getRelativeDate(
previousAiring,
shortDateFormat, shortDateFormat,
showRelativeDates, showRelativeDates,
{ {
timeFormat, timeFormat,
timeForToday: true timeForToday: false
}
)
} }
);
return (
<div className={styles.info}>
{`Added ${addedDate}`}
</div> </div>
); );
} }
if (sortKey === 'added' && added) { if (sortKey === 'releaseDate' && added) {
const addedDate = getRelativeDate( const date = getRelativeDate(
added, releaseDate,
shortDateFormat, shortDateFormat,
showRelativeDates, showRelativeDates,
{ {
@ -58,7 +58,7 @@ function BookIndexPosterInfo(props) {
return ( return (
<div className={styles.info}> <div className={styles.info}>
{`Added ${addedDate}`} {`Released ${date}`}
</div> </div>
); );
} }
@ -101,9 +101,9 @@ function BookIndexPosterInfo(props) {
BookIndexPosterInfo.propTypes = { BookIndexPosterInfo.propTypes = {
qualityProfile: PropTypes.object.isRequired, qualityProfile: PropTypes.object.isRequired,
showQualityProfile: PropTypes.bool.isRequired, showQualityProfile: PropTypes.bool.isRequired,
previousAiring: PropTypes.string,
author: PropTypes.object.isRequired, author: PropTypes.object.isRequired,
added: PropTypes.string, added: PropTypes.string,
releaseDate: PropTypes.string,
bookFileCount: PropTypes.number.isRequired, bookFileCount: PropTypes.number.isRequired,
sizeOnDisk: PropTypes.number, sizeOnDisk: PropTypes.number,
sortKey: PropTypes.string.isRequired, sortKey: PropTypes.string.isRequired,

Loading…
Cancel
Save