Fixed: Manage Tracks not showing whether language/quality meets cutoff

Signed-off-by: Robin Dadswell <robin@dadswell.email>
pull/770/head
Qstick 4 years ago
parent 17b5187729
commit 72314c4388

@ -10,6 +10,7 @@ function BookFileEditorRow(props) {
id, id,
path, path,
quality, quality,
qualityCutoffNotMet,
isSelected, isSelected,
onSelectedChange onSelectedChange
} = props; } = props;
@ -28,6 +29,7 @@ function BookFileEditorRow(props) {
<TableRowCell> <TableRowCell>
<BookQuality <BookQuality
quality={quality} quality={quality}
isCutoffNotMet={qualityCutoffNotMet}
/> />
</TableRowCell> </TableRowCell>
</TableRow> </TableRow>
@ -38,6 +40,7 @@ BookFileEditorRow.propTypes = {
id: PropTypes.number.isRequired, id: PropTypes.number.isRequired,
path: PropTypes.string.isRequired, path: PropTypes.string.isRequired,
quality: PropTypes.object.isRequired, quality: PropTypes.object.isRequired,
qualityCutoffNotMet: PropTypes.bool.isRequired,
isSelected: PropTypes.bool, isSelected: PropTypes.bool,
onSelectedChange: PropTypes.func.isRequired onSelectedChange: PropTypes.func.isRequired
}; };

@ -200,26 +200,30 @@ export const actionHandlers = handleThunks({
dispatch(set({ section, isSaving: true })); dispatch(set({ section, isSaving: true }));
const data = { const requestData = {
bookFileIds bookFileIds
}; };
if (quality) { if (quality) {
data.quality = quality; requestData.quality = quality;
} }
const promise = createAjaxRequest({ const promise = createAjaxRequest({
url: '/bookFile/editor', url: '/bookFile/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([
...bookFileIds.map((id) => { ...bookFileIds.map((id) => {
const props = {}; const props = {};
const trackFile = data.find((file) => file.id === id);
props.qualityCutoffNotMet = trackFile.qualityCutoffNotMet;
if (quality) { if (quality) {
props.quality = quality; props.quality = quality;
} }

Loading…
Cancel
Save