Fixed: Added missing sort token details for poster views

Fixes #1424
This commit is contained in:
ta264
2021-12-23 21:41:43 +00:00
parent 472da10149
commit 76bcf94f1d
3 changed files with 67 additions and 34 deletions
@@ -8,8 +8,8 @@ function BookIndexPosterInfo(props) {
const {
qualityProfile,
showQualityProfile,
previousAiring,
added,
releaseDate,
author,
bookFileCount,
sizeOnDisk,
@@ -27,24 +27,6 @@ function BookIndexPosterInfo(props) {
);
}
if (sortKey === 'previousAiring' && previousAiring) {
return (
<div className={styles.info}>
{
getRelativeDate(
previousAiring,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: true
}
)
}
</div>
);
}
if (sortKey === 'added' && added) {
const addedDate = getRelativeDate(
added,
@@ -63,6 +45,24 @@ function BookIndexPosterInfo(props) {
);
}
if (sortKey === 'releaseDate' && added) {
const date = getRelativeDate(
releaseDate,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
return (
<div className={styles.info}>
{`Released ${date}`}
</div>
);
}
if (sortKey === 'bookFileCount') {
let books = '1 file';
@@ -101,9 +101,9 @@ function BookIndexPosterInfo(props) {
BookIndexPosterInfo.propTypes = {
qualityProfile: PropTypes.object.isRequired,
showQualityProfile: PropTypes.bool.isRequired,
previousAiring: PropTypes.string,
author: PropTypes.object.isRequired,
added: PropTypes.string,
releaseDate: PropTypes.string,
bookFileCount: PropTypes.number.isRequired,
sizeOnDisk: PropTypes.number,
sortKey: PropTypes.string.isRequired,