Fixed: Manage Episodes not showing whether language/quality meets cutoff
This commit is contained in:
parent
894de923b9
commit
fd89e88d40
|
@ -72,6 +72,8 @@ function createMapStateToProps() {
|
||||||
relativePath: episodeFile.relativePath,
|
relativePath: episodeFile.relativePath,
|
||||||
language: episodeFile.language,
|
language: episodeFile.language,
|
||||||
quality: episodeFile.quality,
|
quality: episodeFile.quality,
|
||||||
|
languageCutoffNotMet: episodeFile.languageCutoffNotMet,
|
||||||
|
qualityCutoffNotMet: episodeFile.qualityCutoffNotMet,
|
||||||
...episode
|
...episode
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,6 +6,7 @@ import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellCo
|
||||||
import TableRow from 'Components/Table/TableRow';
|
import TableRow from 'Components/Table/TableRow';
|
||||||
import TableRowCell from 'Components/Table/Cells/TableRowCell';
|
import TableRowCell from 'Components/Table/Cells/TableRowCell';
|
||||||
import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
|
import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
|
||||||
|
import EpisodeLanguage from 'Episode/EpisodeLanguage';
|
||||||
import EpisodeQuality from 'Episode/EpisodeQuality';
|
import EpisodeQuality from 'Episode/EpisodeQuality';
|
||||||
import styles from './EpisodeFileEditorRow';
|
import styles from './EpisodeFileEditorRow';
|
||||||
|
|
||||||
|
@ -20,6 +21,8 @@ function EpisodeFileEditorRow(props) {
|
||||||
airDateUtc,
|
airDateUtc,
|
||||||
language,
|
language,
|
||||||
quality,
|
quality,
|
||||||
|
qualityCutoffNotMet,
|
||||||
|
languageCutoffNotMet,
|
||||||
isSelected,
|
isSelected,
|
||||||
onSelectedChange
|
onSelectedChange
|
||||||
} = props;
|
} = props;
|
||||||
|
@ -52,14 +55,16 @@ function EpisodeFileEditorRow(props) {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TableRowCell>
|
<TableRowCell>
|
||||||
<Label>
|
<EpisodeLanguage
|
||||||
{language.name}
|
language={language}
|
||||||
</Label>
|
isCutoffNotMet={languageCutoffNotMet}
|
||||||
|
/>
|
||||||
</TableRowCell>
|
</TableRowCell>
|
||||||
|
|
||||||
<TableRowCell>
|
<TableRowCell>
|
||||||
<EpisodeQuality
|
<EpisodeQuality
|
||||||
quality={quality}
|
quality={quality}
|
||||||
|
isCutoffNotMet={qualityCutoffNotMet}
|
||||||
/>
|
/>
|
||||||
</TableRowCell>
|
</TableRowCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
@ -76,6 +81,8 @@ EpisodeFileEditorRow.propTypes = {
|
||||||
airDateUtc: PropTypes.string.isRequired,
|
airDateUtc: PropTypes.string.isRequired,
|
||||||
language: PropTypes.object.isRequired,
|
language: PropTypes.object.isRequired,
|
||||||
quality: PropTypes.object.isRequired,
|
quality: PropTypes.object.isRequired,
|
||||||
|
qualityCutoffNotMet: PropTypes.bool.isRequired,
|
||||||
|
languageCutoffNotMet: PropTypes.bool.isRequired,
|
||||||
isSelected: PropTypes.bool,
|
isSelected: PropTypes.bool,
|
||||||
onSelectedChange: PropTypes.func.isRequired
|
onSelectedChange: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
|
@ -148,30 +148,35 @@ export const actionHandlers = handleThunks({
|
||||||
|
|
||||||
dispatch(set({ section, isSaving: true }));
|
dispatch(set({ section, isSaving: true }));
|
||||||
|
|
||||||
const data = {
|
const requestData = {
|
||||||
episodeFileIds
|
episodeFileIds
|
||||||
};
|
};
|
||||||
|
|
||||||
if (language) {
|
if (language) {
|
||||||
data.language = language;
|
requestData.language = language;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quality) {
|
if (quality) {
|
||||||
data.quality = quality;
|
requestData.quality = quality;
|
||||||
}
|
}
|
||||||
|
|
||||||
const promise = createAjaxRequest({
|
const promise = createAjaxRequest({
|
||||||
url: '/episodeFile/editor',
|
url: '/episodeFile/editor',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: JSON.stringify(data)
|
data: JSON.stringify(requestData)
|
||||||
}).request;
|
}).request;
|
||||||
|
|
||||||
promise.done(() => {
|
promise.done((data) => {
|
||||||
dispatch(batchActions([
|
dispatch(batchActions([
|
||||||
...episodeFileIds.map((id) => {
|
...episodeFileIds.map((id) => {
|
||||||
const props = {};
|
const props = {};
|
||||||
|
|
||||||
|
const episodeFile = data.find((file) => file.id === id);
|
||||||
|
|
||||||
|
props.qualityCutoffNotMet = episodeFile.qualityCutoffNotMet;
|
||||||
|
props.languageCutoffNotMet = episodeFile.languageCutoffNotMet;
|
||||||
|
|
||||||
if (language) {
|
if (language) {
|
||||||
props.language = language;
|
props.language = language;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue