New: Use Goodreads directly, allow multiple editions of a book (new DB required)

This commit is contained in:
ta264
2020-06-30 21:46:01 +01:00
parent d83d2548e5
commit 45d49117ca
178 changed files with 3332 additions and 1786 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import AuthorImage from './AuthorImage';
const bannerPlaceholder = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAC5AgMAAADG9/24AAAADFBMVEUyMjI7Ozs1NTU4ODjgOsZvAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QkRBgAc5PUQ8QAAB7tJREFUeNrtnb1rHEsMwMdjArtrUrpf3uMg2cOl+5QpXWRvjQkXlyHVK8MVYXFl3F+/GAzrNfdSuXkQnH9ie/Oqw32aFM6bkTQfd85rHrwi0qjJJql+pxlJo9FISv0XqX8mKkmSJEmSJEmSJEmSJEmSJEmS5NeVYrh7HDqJ5DeY23kQB64/u7zW91amzgXqvRqjfGYvarnfxqncuaQlf72Zxv4gSOluudOfjRy1Hzh1L+nPj+KU3jh0MWr3Sp87dDFq98An/msmg3zPW/aFR6/vRaBPglML6Mci0H0g92MYfrjvRgJ5TrDvhuFyGIZv9NdTOev93dDry1Z59mM56/2hU8WZcefFjZgVT/Z90SlEV9VKio3HeKYZLLSGII6WPP+oBv3ZwkL3iE4JG/ZRjUYb16mAripUO/c4Hl3bd/juCF19FuHeJn6nK90VBh0s3SjBvcFW/wTrvfBa118EbHY8qmMOtmgdupoKOLTvAmOH1k059LKAX+Qra/TncExH4hcBXV3Zf/+Dv5Vb43cfod/wt3PLsN5VF6HDiudt56IbB23Ql5/oZ8A7CfZWbgF61sap62XdlOZTZ2rF3c7ltNW1+f7LuDez/uc6uDfO8dwkbPXcKF8vPS9sds527pC2utH0uCb0Jmz2t8wNvN3q2jj4ntDJna94m3g4sb7HH8Gue0RH4Je8z61g4GGr79Wz1qHjbi94m/jcH1IOccsj+lt/sOFr4m0EPz+3XyNueURvSmfn+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AS33ckvlZpH4uedu2nOcWhleiPr9peLFT32fyfGD7fMGBlf/jfCLZOd8oIrw6q4/o2jogzlc2z2fAW8w2nwvd3eqp0YXxCcdiS1HzRC8fw2ezJjvHVtn2tPbhqnOzTgNp1/kdv6pV7ig4RQOruuDBCax1+94dOHTo0KFDk34DoJynpPus3GIAAAAASUVORK5CYII=';
function AuthorBanner(props) {
return (
+1 -1
View File
@@ -9,7 +9,7 @@ function findImage(images, coverType) {
function getUrl(image, coverType, size) {
if (image) {
// Remove protocol
let url = image.url.replace(/^https?:/, '');
let url = image.url;
url = url.replace(`${coverType}.jpg`, `${coverType}-${size}.jpg`);
+4 -6
View File
@@ -6,6 +6,7 @@ import TextTruncate from 'react-text-truncate';
import formatBytes from 'Utilities/Number/formatBytes';
import selectAll from 'Utilities/Table/selectAll';
import toggleSelected from 'Utilities/Table/toggleSelected';
import stripHtml from 'Utilities/String/stripHtml';
import { align, icons, kinds, sizes, tooltipPositions } from 'Helpers/Props';
import fonts from 'Styles/Variables/fonts';
import HeartRating from 'Components/HeartRating';
@@ -166,7 +167,6 @@ class AuthorDetails extends Component {
overview,
links,
images,
authorType,
alternateTitles,
tags,
isSaving,
@@ -206,7 +206,6 @@ class AuthorDetails extends Component {
} = this.state;
const continuing = status === 'continuing';
const endedString = authorType === 'Person' ? 'Deceased' : 'Ended';
let bookFilesCountMessage = 'No book files';
@@ -458,7 +457,7 @@ class AuthorDetails extends Component {
/>
<span className={styles.qualityProfileName}>
{continuing ? 'Continuing' : endedString}
{continuing ? 'Continuing' : 'Deceased'}
</span>
</Label>
@@ -515,7 +514,7 @@ class AuthorDetails extends Component {
<div className={styles.overview}>
<TextTruncate
line={Math.floor(125 / (defaultFontSize * lineHeight))}
text={overview.replace(/<[^>]*>?/gm, '')}
text={stripHtml(overview)}
/>
</div>
</div>
@@ -697,9 +696,8 @@ AuthorDetails.propTypes = {
statistics: PropTypes.object.isRequired,
qualityProfileId: PropTypes.number.isRequired,
monitored: PropTypes.bool.isRequired,
authorType: PropTypes.string,
status: PropTypes.string.isRequired,
overview: PropTypes.string.isRequired,
overview: PropTypes.string,
links: PropTypes.arrayOf(PropTypes.object).isRequired,
images: PropTypes.arrayOf(PropTypes.object).isRequired,
alternateTitles: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -226,7 +226,7 @@ AuthorDetailsSeries.propTypes = {
onSortPress: PropTypes.func.isRequired,
onMonitorBookPress: PropTypes.func.isRequired,
uiSettings: PropTypes.object.isRequired,
authorMonitored: PropTypes.object.isRequired
authorMonitored: PropTypes.bool.isRequired
};
export default AuthorDetailsSeries;
-3
View File
@@ -73,7 +73,6 @@ class BookRow extends Component {
title,
position,
ratings,
disambiguation,
isSaving,
authorMonitored,
titleSlug,
@@ -124,7 +123,6 @@ class BookRow extends Component {
<BookTitleLink
titleSlug={titleSlug}
title={title}
disambiguation={disambiguation}
/>
</TableRowCell>
);
@@ -208,7 +206,6 @@ BookRow.propTypes = {
title: PropTypes.string.isRequired,
position: PropTypes.string,
ratings: PropTypes.object.isRequired,
disambiguation: PropTypes.string,
titleSlug: PropTypes.string.isRequired,
isSaving: PropTypes.bool,
authorMonitored: PropTypes.bool.isRequired,
@@ -4,6 +4,7 @@ import TextTruncate from 'react-text-truncate';
import { icons } from 'Helpers/Props';
import dimensions from 'Styles/Variables/dimensions';
import fonts from 'Styles/Variables/fonts';
import stripHtml from 'Utilities/String/stripHtml';
import IconButton from 'Components/Link/IconButton';
import Link from 'Components/Link/Link';
import SpinnerIconButton from 'Components/Link/SpinnerIconButton';
@@ -113,7 +114,8 @@ class AuthorIndexOverview extends Component {
const elementStyle = {
width: `${posterWidth}px`,
height: `${posterHeight}px`
height: `${posterHeight}px`,
objectFit: 'contain'
};
const contentHeight = getContentHeight(rowHeight, isSmallScreen);
@@ -203,7 +205,7 @@ class AuthorIndexOverview extends Component {
>
<TextTruncate
line={Math.floor(overviewHeight / (defaultFontSize * lineHeight))}
text={overview}
text={stripHtml(overview)}
/>
</Link>
@@ -110,9 +110,9 @@ class AuthorIndexPoster extends Component {
const elementStyle = {
width: `${posterWidth}px`,
height: `${posterHeight}px`
height: `${posterHeight}px`,
objectFit: 'contain'
};
elementStyle.objectFit = 'contain';
return (
<div className={styles.container}>
@@ -82,7 +82,6 @@ class AuthorIndexRow extends Component {
status,
authorName,
titleSlug,
authorType,
qualityProfile,
metadataProfile,
nextBook,
@@ -134,7 +133,6 @@ class AuthorIndexRow extends Component {
<AuthorStatusCell
key={name}
className={styles[name]}
authorType={authorType}
monitored={monitored}
status={status}
component={VirtualTableRowCell}
@@ -184,17 +182,6 @@ class AuthorIndexRow extends Component {
);
}
if (name === 'authorType') {
return (
<VirtualTableRowCell
key={name}
className={styles[name]}
>
{authorType}
</VirtualTableRowCell>
);
}
if (name === 'qualityProfileId') {
return (
<VirtualTableRowCell
@@ -421,7 +408,6 @@ AuthorIndexRow.propTypes = {
status: PropTypes.string.isRequired,
authorName: PropTypes.string.isRequired,
titleSlug: PropTypes.string.isRequired,
authorType: PropTypes.string,
qualityProfile: PropTypes.object.isRequired,
metadataProfile: PropTypes.object.isRequired,
nextBook: PropTypes.object,
@@ -8,15 +8,12 @@ import styles from './AuthorStatusCell.css';
function AuthorStatusCell(props) {
const {
className,
authorType,
monitored,
status,
component: Component,
...otherProps
} = props;
const endedString = authorType === 'Person' ? 'Deceased' : 'Ended';
return (
<Component
className={className}
@@ -31,7 +28,7 @@ function AuthorStatusCell(props) {
<Icon
className={styles.statusIcon}
name={status === 'ended' ? icons.AUTHOR_ENDED : icons.AUTHOR_CONTINUING}
title={status === 'ended' ? endedString : 'Continuing'}
title={status === 'ended' ? 'Deceased' : 'Continuing'}
/>
</Component>
);
@@ -39,7 +36,6 @@ function AuthorStatusCell(props) {
AuthorStatusCell.propTypes = {
className: PropTypes.string.isRequired,
authorType: PropTypes.string,
monitored: PropTypes.bool.isRequired,
status: PropTypes.string.isRequired,
component: PropTypes.elementType