New: Last Searched column on Wanted screens

This commit is contained in:
ManiMatter 2024-09-02 22:24:55 +02:00 committed by GitHub
parent c80bd81bb9
commit 546e9fd1d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 48 additions and 5 deletions

View File

@ -9,6 +9,7 @@ interface Episode extends ModelBase {
episodeNumber: number;
airDate: string;
airDateUtc?: string;
lastSearchTime?: string;
runtime: number;
absoluteEpisodeNumber?: number;
sceneSeasonNumber?: number;

View File

@ -50,6 +50,12 @@ export const defaultState = {
isSortable: true,
isVisible: true
},
{
name: 'episodes.lastSearchTime',
label: () => translate('LastSearched'),
isSortable: true,
isVisible: false
},
{
name: 'status',
label: () => translate('Status'),
@ -122,6 +128,12 @@ export const defaultState = {
isSortable: true,
isVisible: true
},
{
name: 'episodes.lastSearchTime',
label: () => translate('LastSearched'),
isSortable: true,
isVisible: false
},
{
name: 'languages',
label: () => translate('Languages'),

View File

@ -126,14 +126,16 @@ class CutoffUnmetConnector extends Component {
onSearchSelectedPress = (selected) => {
this.props.executeCommand({
name: commandNames.EPISODE_SEARCH,
episodeIds: selected
episodeIds: selected,
commandFinished: this.repopulate
});
};
onSearchAllCutoffUnmetPress = (monitored) => {
this.props.executeCommand({
name: commandNames.CUTOFF_UNMET_EPISODE_SEARCH,
monitored
monitored,
commandFinished: this.repopulate
});
};

View File

@ -26,6 +26,7 @@ function CutoffUnmetRow(props) {
sceneAbsoluteEpisodeNumber,
unverifiedSceneNumbering,
airDateUtc,
lastSearchTime,
title,
isSelected,
columns,
@ -106,6 +107,16 @@ function CutoffUnmetRow(props) {
);
}
if (name === 'episodes.lastSearchTime') {
return (
<RelativeDateCell
key={name}
date={lastSearchTime}
includeSeconds={true}
/>
);
}
if (name === 'languages') {
return (
<TableRowCell
@ -166,6 +177,7 @@ CutoffUnmetRow.propTypes = {
sceneAbsoluteEpisodeNumber: PropTypes.number,
unverifiedSceneNumbering: PropTypes.bool.isRequired,
airDateUtc: PropTypes.string.isRequired,
lastSearchTime: PropTypes.string,
title: PropTypes.string.isRequired,
isSelected: PropTypes.bool,
columns: PropTypes.arrayOf(PropTypes.object).isRequired,

View File

@ -117,14 +117,16 @@ class MissingConnector extends Component {
onSearchSelectedPress = (selected) => {
this.props.executeCommand({
name: commandNames.EPISODE_SEARCH,
episodeIds: selected
episodeIds: selected,
commandFinished: this.repopulate
});
};
onSearchAllMissingPress = (monitored) => {
this.props.executeCommand({
name: commandNames.MISSING_EPISODE_SEARCH,
monitored
monitored,
commandFinished: this.repopulate
});
};

View File

@ -25,6 +25,7 @@ function MissingRow(props) {
sceneAbsoluteEpisodeNumber,
unverifiedSceneNumbering,
airDateUtc,
lastSearchTime,
title,
isSelected,
columns,
@ -109,6 +110,16 @@ function MissingRow(props) {
);
}
if (name === 'episodes.lastSearchTime') {
return (
<RelativeDateCell
key={name}
date={lastSearchTime}
includeSeconds={true}
/>
);
}
if (name === 'status') {
return (
<TableRowCell
@ -156,6 +167,7 @@ MissingRow.propTypes = {
sceneAbsoluteEpisodeNumber: PropTypes.number,
unverifiedSceneNumbering: PropTypes.bool.isRequired,
airDateUtc: PropTypes.string.isRequired,
lastSearchTime: PropTypes.string,
title: PropTypes.string.isRequired,
isSelected: PropTypes.bool,
columns: PropTypes.arrayOf(PropTypes.object).isRequired,

View File

@ -1069,6 +1069,7 @@
"Large": "Large",
"LastDuration": "Last Duration",
"LastExecution": "Last Execution",
"LastSearched": "Last Searched",
"LastUsed": "Last Used",
"LastWriteTime": "Last Write Time",
"LatestSeason": "Latest Season",

View File

@ -21,6 +21,7 @@ namespace Sonarr.Api.V3.Episodes
public string Title { get; set; }
public string AirDate { get; set; }
public DateTime? AirDateUtc { get; set; }
public DateTime? LastSearchTime { get; set; }
public int Runtime { get; set; }
public string FinaleType { get; set; }
public string Overview { get; set; }
@ -35,7 +36,6 @@ namespace Sonarr.Api.V3.Episodes
public DateTime? EndTime { get; set; }
public DateTime? GrabDate { get; set; }
public SeriesResource Series { get; set; }
public List<MediaCover> Images { get; set; }
// Hiding this so people don't think its usable (only used to set the initial state)
@ -68,6 +68,7 @@ namespace Sonarr.Api.V3.Episodes
Runtime = model.Runtime,
FinaleType = model.FinaleType,
Overview = model.Overview,
LastSearchTime = model.LastSearchTime,
// EpisodeFile