mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-23 08:15:27 +00:00
Fixed: Limit titles in task name to 10 series
This commit is contained in:
parent
efb3fa93e4
commit
c81ae65461
1 changed files with 17 additions and 1 deletions
|
@ -6,6 +6,22 @@ import createMultiSeriesSelector from 'Store/Selectors/createMultiSeriesSelector
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import styles from './QueuedTaskRowNameCell.css';
|
import styles from './QueuedTaskRowNameCell.css';
|
||||||
|
|
||||||
|
function formatTitles(titles: string[]) {
|
||||||
|
if (!titles) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (titles.length > 11) {
|
||||||
|
return (
|
||||||
|
<span title={titles.join(', ')}>
|
||||||
|
{titles.slice(0, 10).join(', ')}, {titles.length - 10} more
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return <span>{titles.join(', ')}</span>;
|
||||||
|
}
|
||||||
|
|
||||||
export interface QueuedTaskRowNameCellProps {
|
export interface QueuedTaskRowNameCellProps {
|
||||||
commandName: string;
|
commandName: string;
|
||||||
body: CommandBody;
|
body: CommandBody;
|
||||||
|
@ -32,7 +48,7 @@ export default function QueuedTaskRowNameCell(
|
||||||
<span className={styles.commandName}>
|
<span className={styles.commandName}>
|
||||||
{commandName}
|
{commandName}
|
||||||
{sortedSeries.length ? (
|
{sortedSeries.length ? (
|
||||||
<span> - {sortedSeries.map((s) => s.title).join(', ')}</span>
|
<span> - {formatTitles(sortedSeries.map((s) => s.title))}</span>
|
||||||
) : null}
|
) : null}
|
||||||
{body.seasonNumber ? (
|
{body.seasonNumber ? (
|
||||||
<span>
|
<span>
|
||||||
|
|
Loading…
Reference in a new issue