1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-16 21:15:33 -04:00

Fixed: Movie Details Tab (#3564)

* History Added

* History Cleanup

* History Mark Failed Fix

* History Lint Fix

* Search Tab Initial

* Interactive Search Cleanup

* Files Tab + Small Backend change to MovieFile api

* Reverse Movie History Items

* Grabbed files are not grabbable again.

* Partial movie title outline + Search not updating fix

* Lint Fix + InteractiveSearch refactor

* Rename movieLanguage.js to MovieLanguage.js

* Fixes for qstick's comments

* Rename language selector to allow for const languages

* Qstick comment changes.

* Activity Tabs - Language Column fixed

* Movie Details - MoveStatusLabel fixed

* Spaces + Lower Case added

* fixed DownloadAllowed

* Added padding to history and file tables

* Fix class =>  className

* Updated search to not refresh unless switching movie

* lint fix

* File Tab Converted to Inline Editting

* FIles tab fix + Alt Titles tab implemented

* lint fix

* Cleanup via qstick request
This commit is contained in:
devbrian
2019-07-06 08:47:11 -05:00
committed by Qstick
parent 06b1c03053
commit 12fba024f0
60 changed files with 1565 additions and 821 deletions

View File

@@ -1,62 +1,195 @@
import PropTypes from 'prop-types';
import React from 'react';
import Label from 'Components/Label';
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
import React, { Component } from 'react';
import IconButton from 'Components/Link/IconButton';
import { icons, kinds } from 'Helpers/Props';
import TableRow from 'Components/Table/TableRow';
import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
import TableRowCellButton from 'Components/Table/Cells/TableRowCellButton';
import MovieQuality from 'Movie/MovieQuality';
import MovieLanguage from 'Movie/MovieLanguage';
import ConfirmModal from 'Components/Modal/ConfirmModal';
import SelectQualityModal from 'MovieFile/Quality/SelectQualityModal';
import SelectLanguageModal from 'MovieFile/Language/SelectLanguageModal';
import * as mediaInfoTypes from 'MovieFile/mediaInfoTypes';
import MediaInfoConnector from 'MovieFile/MediaInfoConnector';
import MovieFileRowCellPlaceholder from './MovieFileRowCellPlaceholder';
import styles from './MovieFileEditorRow.css';
function MovieFileEditorRow(props) {
const {
id,
relativePath,
airDateUtc,
language,
quality,
isSelected,
onSelectedChange
} = props;
class MovieFileEditorRow extends Component {
return (
<TableRow>
<TableSelectCell
id={id}
isSelected={isSelected}
onSelectedChange={onSelectedChange}
/>
//
// Lifecycle
<TableRowCell>
{relativePath}
</TableRowCell>
constructor(props, context) {
super(props, context);
<RelativeDateCellConnector
date={airDateUtc}
/>
this.state = {
isSelectQualityModalOpen: false,
isSelectLanguageModalOpen: false,
isConfirmDeleteModalOpen: false
};
}
<TableRowCell>
<Label>
{language.name}
</Label>
</TableRowCell>
//
// Listeners
<TableRowCell>
<MovieQuality
quality={quality}
onSelectQualityPress = () => {
this.setState({ isSelectQualityModalOpen: true });
}
onSelectLanguagePress = () => {
this.setState({ isSelectLanguageModalOpen: true });
}
onSelectQualityModalClose = () => {
this.setState({ isSelectQualityModalOpen: false });
}
onSelectLanguageModalClose = () => {
this.setState({ isSelectLanguageModalOpen: false });
}
onDeletePress = () => {
this.setState({ isConfirmDeleteModalOpen: true });
}
onConfirmDelete = () => {
this.setState({ isConfirmDeleteModalOpen: false });
this.props.onDeletePress(this.props.id);
}
onConfirmDeleteModalClose = () => {
this.setState({ isConfirmDeleteModalOpen: false });
}
//
// Render
render() {
const {
id,
relativePath,
quality,
languages
} = this.props;
const {
isSelectQualityModalOpen,
isSelectLanguageModalOpen,
isConfirmDeleteModalOpen
} = this.state;
const showQualityPlaceholder = !quality;
const showLanguagePlaceholder = !languages;
return (
<TableRow>
<TableRowCell
className={styles.relativePath}
title={relativePath}
>
{relativePath}
</TableRowCell>
<TableRowCell>
<MediaInfoConnector
movieFileId={id}
type={mediaInfoTypes.VIDEO}
/>
<MediaInfoConnector
movieFileId={id}
type={mediaInfoTypes.AUDIO}
/>
</TableRowCell>
<TableRowCellButton
className={styles.language}
title="Click to change language"
onPress={this.onSelectLanguagePress}
>
{
showLanguagePlaceholder &&
<MovieFileRowCellPlaceholder />
}
{
!showLanguagePlaceholder && !!languages &&
<MovieLanguage
className={styles.label}
languages={languages}
/>
}
</TableRowCellButton>
<TableRowCellButton
className={styles.quality}
title="Click to change quality"
onPress={this.onSelectQualityPress}
>
{
showQualityPlaceholder &&
<MovieFileRowCellPlaceholder />
}
{
!showQualityPlaceholder && !!quality &&
<MovieQuality
className={styles.label}
quality={quality}
/>
}
</TableRowCellButton>
<TableRowCell className={styles.actions}>
<IconButton
title="Delete file"
name={icons.REMOVE}
onPress={this.onDeletePress}
/>
</TableRowCell>
<ConfirmModal
isOpen={isConfirmDeleteModalOpen}
ids={[id]}
kind={kinds.DANGER}
title="Delete Selected Movie Files"
message={'Are you sure you want to delete the selected movie files?'}
confirmLabel="Delete"
onConfirm={this.onConfirmDelete}
onCancel={this.onConfirmDeleteModalClose}
/>
</TableRowCell>
</TableRow>
);
<SelectQualityModal
isOpen={isSelectQualityModalOpen}
ids={[id]}
qualityId={quality ? quality.quality.id : 0}
proper={quality ? quality.revision.version > 1 : false}
real={quality ? quality.revision.real > 0 : false}
onModalClose={this.onSelectQualityModalClose}
/>
<SelectLanguageModal
isOpen={isSelectLanguageModalOpen}
ids={[id]}
languageId={languages[0] ? languages[0].id : 0}
onModalClose={this.onSelectLanguageModalClose}
/>
</TableRow>
);
}
}
MovieFileEditorRow.propTypes = {
id: PropTypes.number.isRequired,
size: PropTypes.number.isRequired,
relativePath: PropTypes.string.isRequired,
airDateUtc: PropTypes.string.isRequired,
language: PropTypes.object.isRequired,
quality: PropTypes.object.isRequired,
isSelected: PropTypes.bool,
onSelectedChange: PropTypes.func.isRequired
languages: PropTypes.arrayOf(PropTypes.object).isRequired,
mediaInfo: PropTypes.object.isRequired,
onDeletePress: PropTypes.func.isRequired
};
export default MovieFileEditorRow;