|
|
@ -81,7 +81,8 @@ class MovieFileEditorRow extends Component {
|
|
|
|
qualityCutoffNotMet,
|
|
|
|
qualityCutoffNotMet,
|
|
|
|
customFormats,
|
|
|
|
customFormats,
|
|
|
|
customFormatScore,
|
|
|
|
customFormatScore,
|
|
|
|
languages
|
|
|
|
languages,
|
|
|
|
|
|
|
|
columns
|
|
|
|
} = this.props;
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
const {
|
|
|
@ -91,138 +92,214 @@ class MovieFileEditorRow extends Component {
|
|
|
|
} = this.state;
|
|
|
|
} = this.state;
|
|
|
|
|
|
|
|
|
|
|
|
const showQualityPlaceholder = !quality;
|
|
|
|
const showQualityPlaceholder = !quality;
|
|
|
|
|
|
|
|
|
|
|
|
const showLanguagePlaceholder = !languages;
|
|
|
|
const showLanguagePlaceholder = !languages;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableRowCell
|
|
|
|
{
|
|
|
|
className={styles.relativePath}
|
|
|
|
columns.map((column) => {
|
|
|
|
title={relativePath}
|
|
|
|
const {
|
|
|
|
>
|
|
|
|
name,
|
|
|
|
{relativePath}
|
|
|
|
isVisible
|
|
|
|
</TableRowCell>
|
|
|
|
} = column;
|
|
|
|
|
|
|
|
|
|
|
|
<TableRowCell>
|
|
|
|
if (!isVisible) {
|
|
|
|
<MediaInfoConnector
|
|
|
|
return null;
|
|
|
|
movieFileId={id}
|
|
|
|
}
|
|
|
|
type={mediaInfoTypes.VIDEO}
|
|
|
|
|
|
|
|
/>
|
|
|
|
if (name === 'relativePath') {
|
|
|
|
</TableRowCell>
|
|
|
|
return (
|
|
|
|
|
|
|
|
<TableRowCell
|
|
|
|
<TableRowCell>
|
|
|
|
key={name}
|
|
|
|
<MediaInfoConnector
|
|
|
|
className={styles.relativePath}
|
|
|
|
movieFileId={id}
|
|
|
|
title={relativePath}
|
|
|
|
type={mediaInfoTypes.AUDIO}
|
|
|
|
>
|
|
|
|
/>
|
|
|
|
{relativePath}
|
|
|
|
</TableRowCell>
|
|
|
|
</TableRowCell>
|
|
|
|
|
|
|
|
);
|
|
|
|
<TableRowCell
|
|
|
|
}
|
|
|
|
className={styles.audioLanguages}
|
|
|
|
|
|
|
|
>
|
|
|
|
if (name === 'customFormats') {
|
|
|
|
<MediaInfoConnector
|
|
|
|
return (
|
|
|
|
type={mediaInfoTypes.AUDIO_LANGUAGES}
|
|
|
|
<TableRowCell key={name}>
|
|
|
|
movieFileId={id}
|
|
|
|
<MovieFormats
|
|
|
|
/>
|
|
|
|
formats={customFormats}
|
|
|
|
</TableRowCell>
|
|
|
|
/>
|
|
|
|
|
|
|
|
</TableRowCell>
|
|
|
|
<TableRowCell
|
|
|
|
);
|
|
|
|
className={styles.subtitles}
|
|
|
|
}
|
|
|
|
>
|
|
|
|
|
|
|
|
<MediaInfoConnector
|
|
|
|
if (name === 'customFormatScore') {
|
|
|
|
type={mediaInfoTypes.SUBTITLES}
|
|
|
|
return (
|
|
|
|
movieFileId={id}
|
|
|
|
<TableRowCell
|
|
|
|
/>
|
|
|
|
key={name}
|
|
|
|
</TableRowCell>
|
|
|
|
className={styles.customFormatScore}
|
|
|
|
|
|
|
|
>
|
|
|
|
<TableRowCell
|
|
|
|
<Tooltip
|
|
|
|
className={styles.size}
|
|
|
|
anchor={formatCustomFormatScore(
|
|
|
|
title={size}
|
|
|
|
customFormatScore,
|
|
|
|
>
|
|
|
|
customFormats.length
|
|
|
|
{formatBytes(size)}
|
|
|
|
)}
|
|
|
|
</TableRowCell>
|
|
|
|
tooltip={<MovieFormats formats={customFormats} />}
|
|
|
|
|
|
|
|
position={tooltipPositions.TOP}
|
|
|
|
<TableRowCell
|
|
|
|
/>
|
|
|
|
className={styles.language}
|
|
|
|
</TableRowCell>
|
|
|
|
>
|
|
|
|
);
|
|
|
|
{
|
|
|
|
}
|
|
|
|
showLanguagePlaceholder &&
|
|
|
|
|
|
|
|
<MovieFileRowCellPlaceholder />
|
|
|
|
if (name === 'languages') {
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
|
|
|
|
<TableRowCell
|
|
|
|
{
|
|
|
|
key={name}
|
|
|
|
!showLanguagePlaceholder && !!languages &&
|
|
|
|
className={styles.languages}
|
|
|
|
<MovieLanguage
|
|
|
|
>
|
|
|
|
className={styles.label}
|
|
|
|
{
|
|
|
|
languages={languages}
|
|
|
|
showLanguagePlaceholder ?
|
|
|
|
/>
|
|
|
|
<MovieFileRowCellPlaceholder /> :
|
|
|
|
}
|
|
|
|
null
|
|
|
|
</TableRowCell>
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
<TableRowCell
|
|
|
|
{
|
|
|
|
className={styles.quality}
|
|
|
|
!showLanguagePlaceholder && !!languages &&
|
|
|
|
>
|
|
|
|
<MovieLanguage
|
|
|
|
{
|
|
|
|
className={styles.label}
|
|
|
|
showQualityPlaceholder &&
|
|
|
|
languages={languages}
|
|
|
|
<MovieFileRowCellPlaceholder />
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</TableRowCell>
|
|
|
|
{
|
|
|
|
);
|
|
|
|
!showQualityPlaceholder && !!quality &&
|
|
|
|
}
|
|
|
|
<MovieQuality
|
|
|
|
|
|
|
|
className={styles.label}
|
|
|
|
if (name === 'quality') {
|
|
|
|
quality={quality}
|
|
|
|
return (
|
|
|
|
isCutoffNotMet={qualityCutoffNotMet}
|
|
|
|
<TableRowCell
|
|
|
|
/>
|
|
|
|
key={name}
|
|
|
|
}
|
|
|
|
className={styles.quality}
|
|
|
|
</TableRowCell>
|
|
|
|
>
|
|
|
|
|
|
|
|
{
|
|
|
|
<TableRowCell
|
|
|
|
showQualityPlaceholder ?
|
|
|
|
className={styles.releaseGroup}
|
|
|
|
<MovieFileRowCellPlaceholder /> :
|
|
|
|
>
|
|
|
|
null
|
|
|
|
{releaseGroup}
|
|
|
|
}
|
|
|
|
</TableRowCell>
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
<TableRowCell
|
|
|
|
!showQualityPlaceholder && !!quality &&
|
|
|
|
className={styles.formats}
|
|
|
|
<MovieQuality
|
|
|
|
>
|
|
|
|
className={styles.label}
|
|
|
|
<MovieFormats
|
|
|
|
quality={quality}
|
|
|
|
formats={customFormats}
|
|
|
|
isCutoffNotMet={qualityCutoffNotMet}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</TableRowCell>
|
|
|
|
}
|
|
|
|
|
|
|
|
</TableRowCell>
|
|
|
|
<TableRowCell
|
|
|
|
);
|
|
|
|
className={styles.customFormatScore}
|
|
|
|
}
|
|
|
|
>
|
|
|
|
|
|
|
|
<Tooltip
|
|
|
|
if (name === 'audioInfo') {
|
|
|
|
anchor={formatCustomFormatScore(
|
|
|
|
return (
|
|
|
|
customFormatScore,
|
|
|
|
<TableRowCell
|
|
|
|
customFormats.length
|
|
|
|
key={name}
|
|
|
|
)}
|
|
|
|
className={styles.audio}
|
|
|
|
tooltip={<MovieFormats formats={customFormats} />}
|
|
|
|
>
|
|
|
|
position={tooltipPositions.TOP}
|
|
|
|
<MediaInfoConnector
|
|
|
|
/>
|
|
|
|
movieFileId={id}
|
|
|
|
</TableRowCell>
|
|
|
|
type={mediaInfoTypes.AUDIO}
|
|
|
|
|
|
|
|
/>
|
|
|
|
<TableRowCell className={styles.actions}>
|
|
|
|
</TableRowCell>
|
|
|
|
<IconButton
|
|
|
|
);
|
|
|
|
title={translate('EditMovieFile')}
|
|
|
|
}
|
|
|
|
name={icons.EDIT}
|
|
|
|
|
|
|
|
onPress={this.onFileEditPress}
|
|
|
|
if (name === 'audioLanguages') {
|
|
|
|
/>
|
|
|
|
return (
|
|
|
|
|
|
|
|
<TableRowCell
|
|
|
|
<IconButton
|
|
|
|
key={name}
|
|
|
|
title={translate('Details')}
|
|
|
|
className={styles.audioLanguages}
|
|
|
|
name={icons.MEDIA_INFO}
|
|
|
|
>
|
|
|
|
onPress={this.onFileDetailsPress}
|
|
|
|
<MediaInfoConnector
|
|
|
|
/>
|
|
|
|
type={mediaInfoTypes.AUDIO_LANGUAGES}
|
|
|
|
|
|
|
|
movieFileId={id}
|
|
|
|
<IconButton
|
|
|
|
/>
|
|
|
|
title={translate('DeleteFile')}
|
|
|
|
</TableRowCell>
|
|
|
|
name={icons.REMOVE}
|
|
|
|
);
|
|
|
|
onPress={this.onDeletePress}
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
|
|
|
|
</TableRowCell>
|
|
|
|
if (name === 'subtitleLanguages') {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<TableRowCell
|
|
|
|
|
|
|
|
key={name}
|
|
|
|
|
|
|
|
className={styles.subtitles}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<MediaInfoConnector
|
|
|
|
|
|
|
|
type={mediaInfoTypes.SUBTITLES}
|
|
|
|
|
|
|
|
movieFileId={id}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</TableRowCell>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (name === 'videoCodec') {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<TableRowCell
|
|
|
|
|
|
|
|
key={name}
|
|
|
|
|
|
|
|
className={styles.video}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<MediaInfoConnector
|
|
|
|
|
|
|
|
movieFileId={id}
|
|
|
|
|
|
|
|
type={mediaInfoTypes.VIDEO}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</TableRowCell>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (name === 'size') {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<TableRowCell
|
|
|
|
|
|
|
|
key={name}
|
|
|
|
|
|
|
|
className={styles.size}
|
|
|
|
|
|
|
|
title={size}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{formatBytes(size)}
|
|
|
|
|
|
|
|
</TableRowCell>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (name === 'releaseGroup') {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<TableRowCell
|
|
|
|
|
|
|
|
key={name}
|
|
|
|
|
|
|
|
className={styles.releaseGroup}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{releaseGroup}
|
|
|
|
|
|
|
|
</TableRowCell>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (name === 'actions') {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<TableRowCell key={name} className={styles.actions}>
|
|
|
|
|
|
|
|
<IconButton
|
|
|
|
|
|
|
|
title={translate('EditMovieFile')}
|
|
|
|
|
|
|
|
name={icons.EDIT}
|
|
|
|
|
|
|
|
onPress={this.onFileEditPress}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<IconButton
|
|
|
|
|
|
|
|
title={translate('Details')}
|
|
|
|
|
|
|
|
name={icons.MEDIA_INFO}
|
|
|
|
|
|
|
|
onPress={this.onFileDetailsPress}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<IconButton
|
|
|
|
|
|
|
|
title={translate('DeleteFile')}
|
|
|
|
|
|
|
|
name={icons.REMOVE}
|
|
|
|
|
|
|
|
onPress={this.onDeletePress}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</TableRowCell>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
<FileDetailsModal
|
|
|
|
<FileDetailsModal
|
|
|
|
isOpen={isFileDetailsModalOpen}
|
|
|
|
isOpen={isFileDetailsModalOpen}
|
|
|
@ -263,7 +340,12 @@ MovieFileEditorRow.propTypes = {
|
|
|
|
qualityCutoffNotMet: PropTypes.bool.isRequired,
|
|
|
|
qualityCutoffNotMet: PropTypes.bool.isRequired,
|
|
|
|
languages: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
|
|
languages: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
|
|
mediaInfo: PropTypes.object,
|
|
|
|
mediaInfo: PropTypes.object,
|
|
|
|
|
|
|
|
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
|
|
onDeletePress: PropTypes.func.isRequired
|
|
|
|
onDeletePress: PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MovieFileEditorRow.defaultProps = {
|
|
|
|
|
|
|
|
customFormats: []
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default MovieFileEditorRow;
|
|
|
|
export default MovieFileEditorRow;
|
|
|
|