mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 11:48:26 -07:00
[UI] Add Language to Manual Import, Fix Posters,Banners
This commit is contained in:
parent
25eef250a4
commit
48d31523a5
19 changed files with 325 additions and 30 deletions
|
@ -40,8 +40,8 @@ class ArtistBanner extends Component {
|
||||||
pixelRatio,
|
pixelRatio,
|
||||||
banner,
|
banner,
|
||||||
bannerUrl: getBannerUrl(banner, pixelRatio * size),
|
bannerUrl: getBannerUrl(banner, pixelRatio * size),
|
||||||
hasError: false,
|
isLoaded: false,
|
||||||
isLoaded: false
|
hasError: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,17 +52,18 @@ class ArtistBanner extends Component {
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
banner,
|
||||||
pixelRatio
|
pixelRatio
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
const banner = findBanner(images);
|
const nextBanner = findBanner(images);
|
||||||
|
|
||||||
if (banner && banner.url !== this.state.banner.url) {
|
if (nextBanner && (!banner || nextBanner.url !== banner.url)) {
|
||||||
this.setState({
|
this.setState({
|
||||||
banner,
|
banner: nextBanner,
|
||||||
bannerUrl: getBannerUrl(banner, pixelRatio * size),
|
posterUrl: getBannerUrl(nextBanner, pixelRatio * size),
|
||||||
hasError: false,
|
isLoaded: false,
|
||||||
isLoaded: false
|
hasError: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +76,10 @@ class ArtistBanner extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad = () => {
|
onLoad = () => {
|
||||||
this.setState({ isLoaded: true });
|
this.setState({
|
||||||
|
isLoaded: true,
|
||||||
|
hasError: false
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -40,8 +40,8 @@ class ArtistPoster extends Component {
|
||||||
pixelRatio,
|
pixelRatio,
|
||||||
poster,
|
poster,
|
||||||
posterUrl: getPosterUrl(poster, pixelRatio * size),
|
posterUrl: getPosterUrl(poster, pixelRatio * size),
|
||||||
hasError: false,
|
isLoaded: false,
|
||||||
isLoaded: false
|
hasError: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,17 +52,18 @@ class ArtistPoster extends Component {
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
poster,
|
||||||
pixelRatio
|
pixelRatio
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
const poster = findPoster(images);
|
const nextPoster = findPoster(images);
|
||||||
|
|
||||||
if (poster && poster.url !== this.state.poster.url) {
|
if (nextPoster && (!poster || nextPoster.url !== poster.url)) {
|
||||||
this.setState({
|
this.setState({
|
||||||
poster,
|
poster: nextPoster,
|
||||||
posterUrl: getPosterUrl(poster, pixelRatio * size),
|
posterUrl: getPosterUrl(nextPoster, pixelRatio * size),
|
||||||
hasError: false,
|
isLoaded: false,
|
||||||
isLoaded: false
|
hasError: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +76,10 @@ class ArtistPoster extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad = () => {
|
onLoad = () => {
|
||||||
this.setState({ isLoaded: true });
|
this.setState({
|
||||||
|
isLoaded: true,
|
||||||
|
hasError: false
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -570,4 +570,8 @@ ArtistDetails.propTypes = {
|
||||||
onSearchPress: PropTypes.func.isRequired
|
onSearchPress: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ArtistDetails.defaultProps = {
|
||||||
|
isSaving: false
|
||||||
|
};
|
||||||
|
|
||||||
export default ArtistDetails;
|
export default ArtistDetails;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.header {
|
.header {
|
||||||
z-index: 2;
|
z-index: 3;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
|
|
@ -19,13 +19,13 @@
|
||||||
.sidebarContainer {
|
.sidebarContainer {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 1;
|
z-index: 2;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 1;
|
z-index: 2;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
|
@ -173,7 +173,10 @@ class SignalRConnector extends Component {
|
||||||
const resource = body.resource;
|
const resource = body.resource;
|
||||||
const state = resource.state;
|
const state = resource.state;
|
||||||
|
|
||||||
if (state === 'completed') {
|
// Both sucessful and failed commands need to be
|
||||||
|
// completed, otherwise they spin until they timeout.
|
||||||
|
|
||||||
|
if (state === 'completed' || state === 'failed') {
|
||||||
this.props.finishCommand(resource);
|
this.props.finishCommand(resource);
|
||||||
} else {
|
} else {
|
||||||
this.props.updateCommand(resource);
|
this.props.updateCommand(resource);
|
||||||
|
|
|
@ -49,6 +49,12 @@ const columns = [
|
||||||
isSortable: true,
|
isSortable: true,
|
||||||
isVisible: true
|
isVisible: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'language',
|
||||||
|
label: 'Language',
|
||||||
|
isSortable: true,
|
||||||
|
isVisible: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'size',
|
name: 'size',
|
||||||
label: 'Size',
|
label: 'Size',
|
||||||
|
|
|
@ -74,7 +74,8 @@ class InteractiveImportModalContentConnector extends Component {
|
||||||
artist,
|
artist,
|
||||||
album,
|
album,
|
||||||
tracks,
|
tracks,
|
||||||
quality
|
quality,
|
||||||
|
language
|
||||||
} = item;
|
} = item;
|
||||||
|
|
||||||
if (!artist) {
|
if (!artist) {
|
||||||
|
@ -98,6 +99,7 @@ class InteractiveImportModalContentConnector extends Component {
|
||||||
albumId: album.id,
|
albumId: album.id,
|
||||||
trackIds: _.map(tracks, 'id'),
|
trackIds: _.map(tracks, 'id'),
|
||||||
quality,
|
quality,
|
||||||
|
language,
|
||||||
downloadId: this.props.downloadId
|
downloadId: this.props.downloadId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,10 +9,12 @@ import TableRowCellButton from 'Components/Table/Cells/TableRowCellButton';
|
||||||
import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
|
import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
|
||||||
import Popover from 'Components/Tooltip/Popover';
|
import Popover from 'Components/Tooltip/Popover';
|
||||||
import EpisodeQuality from 'Episode/EpisodeQuality';
|
import EpisodeQuality from 'Episode/EpisodeQuality';
|
||||||
|
import EpisodeLanguage from 'Episode/EpisodeLanguage';
|
||||||
import SelectArtistModal from 'InteractiveImport/Artist/SelectArtistModal';
|
import SelectArtistModal from 'InteractiveImport/Artist/SelectArtistModal';
|
||||||
import SelectAlbumModal from 'InteractiveImport/Album/SelectAlbumModal';
|
import SelectAlbumModal from 'InteractiveImport/Album/SelectAlbumModal';
|
||||||
import SelectTrackModal from 'InteractiveImport/Track/SelectTrackModal';
|
import SelectTrackModal from 'InteractiveImport/Track/SelectTrackModal';
|
||||||
import SelectQualityModal from 'InteractiveImport/Quality/SelectQualityModal';
|
import SelectQualityModal from 'InteractiveImport/Quality/SelectQualityModal';
|
||||||
|
import SelectLanguageModal from 'InteractiveImport/Language/SelectLanguageModal';
|
||||||
import InteractiveImportRowCellPlaceholder from './InteractiveImportRowCellPlaceholder';
|
import InteractiveImportRowCellPlaceholder from './InteractiveImportRowCellPlaceholder';
|
||||||
import styles from './InteractiveImportRow.css';
|
import styles from './InteractiveImportRow.css';
|
||||||
|
|
||||||
|
@ -28,7 +30,8 @@ class InteractiveImportRow extends Component {
|
||||||
isSelectArtistModalOpen: false,
|
isSelectArtistModalOpen: false,
|
||||||
isSelectAlbumModalOpen: false,
|
isSelectAlbumModalOpen: false,
|
||||||
isSelectTrackModalOpen: false,
|
isSelectTrackModalOpen: false,
|
||||||
isSelectQualityModalOpen: false
|
isSelectQualityModalOpen: false,
|
||||||
|
isSelectLanguageModalOpen: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,10 +41,17 @@ class InteractiveImportRow extends Component {
|
||||||
artist,
|
artist,
|
||||||
album,
|
album,
|
||||||
tracks,
|
tracks,
|
||||||
quality
|
quality,
|
||||||
|
language
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
if (artist && album !== undefined && tracks.length && quality) {
|
if (
|
||||||
|
artist &&
|
||||||
|
album != null &&
|
||||||
|
tracks.length &&
|
||||||
|
quality &&
|
||||||
|
language
|
||||||
|
) {
|
||||||
this.props.onSelectedChange({ id, value: true });
|
this.props.onSelectedChange({ id, value: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +63,7 @@ class InteractiveImportRow extends Component {
|
||||||
album,
|
album,
|
||||||
tracks,
|
tracks,
|
||||||
quality,
|
quality,
|
||||||
|
language,
|
||||||
isSelected,
|
isSelected,
|
||||||
onValidRowChange
|
onValidRowChange
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
@ -61,7 +72,13 @@ class InteractiveImportRow extends Component {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isValid = !!(artist && album != null && tracks.length && quality);
|
const isValid = !!(
|
||||||
|
artist &&
|
||||||
|
album != null &&
|
||||||
|
tracks.length &&
|
||||||
|
quality &&
|
||||||
|
language
|
||||||
|
);
|
||||||
|
|
||||||
if (isSelected && !isValid) {
|
if (isSelected && !isValid) {
|
||||||
onValidRowChange(id, false);
|
onValidRowChange(id, false);
|
||||||
|
@ -103,6 +120,10 @@ class InteractiveImportRow extends Component {
|
||||||
this.setState({ isSelectQualityModalOpen: true });
|
this.setState({ isSelectQualityModalOpen: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onSelectLanguagePress = () => {
|
||||||
|
this.setState({ isSelectLanguageModalOpen: true });
|
||||||
|
}
|
||||||
|
|
||||||
onSelectArtistModalClose = (changed) => {
|
onSelectArtistModalClose = (changed) => {
|
||||||
this.setState({ isSelectArtistModalOpen: false });
|
this.setState({ isSelectArtistModalOpen: false });
|
||||||
this.selectRowAfterChange(changed);
|
this.selectRowAfterChange(changed);
|
||||||
|
@ -123,6 +144,11 @@ class InteractiveImportRow extends Component {
|
||||||
this.selectRowAfterChange(changed);
|
this.selectRowAfterChange(changed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onSelectLanguageModalClose = (changed) => {
|
||||||
|
this.setState({ isSelectLanguageModalOpen: false });
|
||||||
|
this.selectRowAfterChange(changed);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Render
|
// Render
|
||||||
|
|
||||||
|
@ -134,6 +160,7 @@ class InteractiveImportRow extends Component {
|
||||||
album,
|
album,
|
||||||
tracks,
|
tracks,
|
||||||
quality,
|
quality,
|
||||||
|
language,
|
||||||
size,
|
size,
|
||||||
rejections,
|
rejections,
|
||||||
isSelected,
|
isSelected,
|
||||||
|
@ -144,7 +171,8 @@ class InteractiveImportRow extends Component {
|
||||||
isSelectArtistModalOpen,
|
isSelectArtistModalOpen,
|
||||||
isSelectAlbumModalOpen,
|
isSelectAlbumModalOpen,
|
||||||
isSelectTrackModalOpen,
|
isSelectTrackModalOpen,
|
||||||
isSelectQualityModalOpen
|
isSelectQualityModalOpen,
|
||||||
|
isSelectLanguageModalOpen
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
const artistName = artist ? artist.artistName : '';
|
const artistName = artist ? artist.artistName : '';
|
||||||
|
@ -206,6 +234,15 @@ class InteractiveImportRow extends Component {
|
||||||
/>
|
/>
|
||||||
</TableRowCellButton>
|
</TableRowCellButton>
|
||||||
|
|
||||||
|
<TableRowCellButton
|
||||||
|
className={styles.language}
|
||||||
|
onPress={this.onSelectLanguagePress}
|
||||||
|
>
|
||||||
|
<EpisodeLanguage
|
||||||
|
language={language}
|
||||||
|
/>
|
||||||
|
</TableRowCellButton>
|
||||||
|
|
||||||
<TableRowCell>
|
<TableRowCell>
|
||||||
{formatBytes(size)}
|
{formatBytes(size)}
|
||||||
</TableRowCell>
|
</TableRowCell>
|
||||||
|
@ -268,6 +305,13 @@ class InteractiveImportRow extends Component {
|
||||||
real={quality.revision.real > 0}
|
real={quality.revision.real > 0}
|
||||||
onModalClose={this.onSelectQualityModalClose}
|
onModalClose={this.onSelectQualityModalClose}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<SelectLanguageModal
|
||||||
|
isOpen={isSelectLanguageModalOpen}
|
||||||
|
id={id}
|
||||||
|
languageId={language.id}
|
||||||
|
onModalClose={this.onSelectLanguageModalClose}
|
||||||
|
/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -281,6 +325,7 @@ InteractiveImportRow.propTypes = {
|
||||||
album: PropTypes.object,
|
album: PropTypes.object,
|
||||||
tracks: PropTypes.arrayOf(PropTypes.object).isRequired,
|
tracks: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
quality: PropTypes.object,
|
quality: PropTypes.object,
|
||||||
|
language: PropTypes.object,
|
||||||
size: PropTypes.number.isRequired,
|
size: PropTypes.number.isRequired,
|
||||||
rejections: PropTypes.arrayOf(PropTypes.object).isRequired,
|
rejections: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
isSelected: PropTypes.bool,
|
isSelected: PropTypes.bool,
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
import Modal from 'Components/Modal/Modal';
|
||||||
|
import SelectLanguageModalContentConnector from './SelectLanguageModalContentConnector';
|
||||||
|
|
||||||
|
class SelectLanguageModal extends Component {
|
||||||
|
|
||||||
|
//
|
||||||
|
// Render
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {
|
||||||
|
isOpen,
|
||||||
|
onModalClose,
|
||||||
|
...otherProps
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
isOpen={isOpen}
|
||||||
|
onModalClose={onModalClose}
|
||||||
|
>
|
||||||
|
<SelectLanguageModalContentConnector
|
||||||
|
{...otherProps}
|
||||||
|
onModalClose={onModalClose}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SelectLanguageModal.propTypes = {
|
||||||
|
isOpen: PropTypes.bool.isRequired,
|
||||||
|
onModalClose: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SelectLanguageModal;
|
|
@ -0,0 +1,87 @@
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import React from 'react';
|
||||||
|
import { inputTypes } from 'Helpers/Props';
|
||||||
|
import Button from 'Components/Link/Button';
|
||||||
|
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
||||||
|
import Form from 'Components/Form/Form';
|
||||||
|
import FormGroup from 'Components/Form/FormGroup';
|
||||||
|
import FormLabel from 'Components/Form/FormLabel';
|
||||||
|
import FormInputGroup from 'Components/Form/FormInputGroup';
|
||||||
|
import ModalContent from 'Components/Modal/ModalContent';
|
||||||
|
import ModalHeader from 'Components/Modal/ModalHeader';
|
||||||
|
import ModalBody from 'Components/Modal/ModalBody';
|
||||||
|
import ModalFooter from 'Components/Modal/ModalFooter';
|
||||||
|
|
||||||
|
function SelectLanguageModalContent(props) {
|
||||||
|
const {
|
||||||
|
languageId,
|
||||||
|
isFetching,
|
||||||
|
isPopulated,
|
||||||
|
error,
|
||||||
|
items,
|
||||||
|
onModalClose,
|
||||||
|
onLanguageSelect
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const languageOptions = items.map(({ language }) => {
|
||||||
|
return {
|
||||||
|
key: language.id,
|
||||||
|
value: language.name
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalContent onModalClose={onModalClose}>
|
||||||
|
<ModalHeader>
|
||||||
|
Manual Import - Select Language
|
||||||
|
</ModalHeader>
|
||||||
|
|
||||||
|
<ModalBody>
|
||||||
|
{
|
||||||
|
isFetching &&
|
||||||
|
<LoadingIndicator />
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
!isFetching && !!error &&
|
||||||
|
<div>Unable to load languages</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
isPopulated && !error &&
|
||||||
|
<Form>
|
||||||
|
<FormGroup>
|
||||||
|
<FormLabel>Language</FormLabel>
|
||||||
|
|
||||||
|
<FormInputGroup
|
||||||
|
type={inputTypes.SELECT}
|
||||||
|
name="language"
|
||||||
|
value={languageId}
|
||||||
|
values={languageOptions}
|
||||||
|
onChange={onLanguageSelect}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
</Form>
|
||||||
|
}
|
||||||
|
</ModalBody>
|
||||||
|
|
||||||
|
<ModalFooter>
|
||||||
|
<Button onPress={onModalClose}>
|
||||||
|
Cancel
|
||||||
|
</Button>
|
||||||
|
</ModalFooter>
|
||||||
|
</ModalContent>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
SelectLanguageModalContent.propTypes = {
|
||||||
|
languageId: PropTypes.number.isRequired,
|
||||||
|
isFetching: PropTypes.bool.isRequired,
|
||||||
|
isPopulated: PropTypes.bool.isRequired,
|
||||||
|
error: PropTypes.object,
|
||||||
|
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
|
onLanguageSelect: PropTypes.func.isRequired,
|
||||||
|
onModalClose: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SelectLanguageModalContent;
|
|
@ -0,0 +1,87 @@
|
||||||
|
import _ from 'lodash';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { createSelector } from 'reselect';
|
||||||
|
import { fetchLanguageProfileSchema } from 'Store/Actions/settingsActions';
|
||||||
|
import { updateInteractiveImportItem } from 'Store/Actions/interactiveImportActions';
|
||||||
|
import SelectLanguageModalContent from './SelectLanguageModalContent';
|
||||||
|
|
||||||
|
function createMapStateToProps() {
|
||||||
|
return createSelector(
|
||||||
|
(state) => state.settings.languageProfiles,
|
||||||
|
(languageProfiles) => {
|
||||||
|
const {
|
||||||
|
isFetchingSchema: isFetching,
|
||||||
|
schemaPopulated: isPopulated,
|
||||||
|
schemaError: error,
|
||||||
|
schema
|
||||||
|
} = languageProfiles;
|
||||||
|
|
||||||
|
return {
|
||||||
|
isFetching,
|
||||||
|
isPopulated,
|
||||||
|
error,
|
||||||
|
items: schema.languages || []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapDispatchToProps = {
|
||||||
|
fetchLanguageProfileSchema,
|
||||||
|
updateInteractiveImportItem
|
||||||
|
};
|
||||||
|
|
||||||
|
class SelectLanguageModalContentConnector extends Component {
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lifecycle
|
||||||
|
|
||||||
|
componentDidMount = () => {
|
||||||
|
if (!this.props.isPopulated) {
|
||||||
|
this.props.fetchLanguageProfileSchema();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Listeners
|
||||||
|
|
||||||
|
onLanguageSelect = ({ value }) => {
|
||||||
|
const languageId = parseInt(value);
|
||||||
|
const language = _.find(this.props.items,
|
||||||
|
(item) => item.language.id === languageId).language;
|
||||||
|
|
||||||
|
this.props.updateInteractiveImportItem({
|
||||||
|
id: this.props.id,
|
||||||
|
language
|
||||||
|
});
|
||||||
|
|
||||||
|
this.props.onModalClose(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Render
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<SelectLanguageModalContent
|
||||||
|
{...this.props}
|
||||||
|
onLanguageSelect={this.onLanguageSelect}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SelectLanguageModalContentConnector.propTypes = {
|
||||||
|
id: PropTypes.number.isRequired,
|
||||||
|
isFetching: PropTypes.bool.isRequired,
|
||||||
|
isPopulated: PropTypes.bool.isRequired,
|
||||||
|
error: PropTypes.object,
|
||||||
|
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
|
fetchLanguageProfileSchema: PropTypes.func.isRequired,
|
||||||
|
updateInteractiveImportItem: PropTypes.func.isRequired,
|
||||||
|
onModalClose: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(createMapStateToProps, mapDispatchToProps)(SelectLanguageModalContentConnector);
|
|
@ -49,6 +49,12 @@ const releaseReducers = handleActions({
|
||||||
const guid = payload.guid;
|
const guid = payload.guid;
|
||||||
const newState = Object.assign({}, state);
|
const newState = Object.assign({}, state);
|
||||||
const items = newState.items;
|
const items = newState.items;
|
||||||
|
|
||||||
|
// Return early if there aren't any items (the user closed the modal)
|
||||||
|
if (!items.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const index = _.findIndex(items, { guid });
|
const index = _.findIndex(items, { guid });
|
||||||
const item = Object.assign({}, items[index], payload);
|
const item = Object.assign({}, items[index], payload);
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
border-bottom: 1px solid #e5e5e5;
|
border-bottom: 1px solid #e5e5e5;
|
||||||
line-height: 21px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.version {
|
.version {
|
||||||
|
|
|
@ -139,7 +139,7 @@ class Updates extends Component {
|
||||||
|
|
||||||
Updates.propTypes = {
|
Updates.propTypes = {
|
||||||
isPopulated: PropTypes.bool.isRequired,
|
isPopulated: PropTypes.bool.isRequired,
|
||||||
error: PropTypes.object.isRequired,
|
error: PropTypes.object,
|
||||||
items: PropTypes.array.isRequired,
|
items: PropTypes.array.isRequired,
|
||||||
isInstallingUpdate: PropTypes.bool.isRequired,
|
isInstallingUpdate: PropTypes.bool.isRequired,
|
||||||
shortDateFormat: PropTypes.string.isRequired,
|
shortDateFormat: PropTypes.string.isRequired,
|
||||||
|
|
|
@ -2,6 +2,7 @@ using NzbDrone.Common.Crypto;
|
||||||
using NzbDrone.Core.DecisionEngine;
|
using NzbDrone.Core.DecisionEngine;
|
||||||
using NzbDrone.Core.MediaFiles.TrackImport.Manual;
|
using NzbDrone.Core.MediaFiles.TrackImport.Manual;
|
||||||
using NzbDrone.Core.Qualities;
|
using NzbDrone.Core.Qualities;
|
||||||
|
using NzbDrone.Core.Languages;
|
||||||
using Lidarr.Api.V3.Artist;
|
using Lidarr.Api.V3.Artist;
|
||||||
using Lidarr.Api.V3.Albums;
|
using Lidarr.Api.V3.Albums;
|
||||||
using Lidarr.Api.V3.Tracks;
|
using Lidarr.Api.V3.Tracks;
|
||||||
|
@ -21,6 +22,7 @@ namespace Lidarr.Api.V3.ManualImport
|
||||||
public AlbumResource Album { get; set; }
|
public AlbumResource Album { get; set; }
|
||||||
public List<TrackResource> Tracks { get; set; }
|
public List<TrackResource> Tracks { get; set; }
|
||||||
public QualityModel Quality { get; set; }
|
public QualityModel Quality { get; set; }
|
||||||
|
public Language Language { get; set; }
|
||||||
public int QualityWeight { get; set; }
|
public int QualityWeight { get; set; }
|
||||||
public string DownloadId { get; set; }
|
public string DownloadId { get; set; }
|
||||||
public IEnumerable<Rejection> Rejections { get; set; }
|
public IEnumerable<Rejection> Rejections { get; set; }
|
||||||
|
@ -43,6 +45,7 @@ namespace Lidarr.Api.V3.ManualImport
|
||||||
Album = model.Album.ToResource(),
|
Album = model.Album.ToResource(),
|
||||||
Tracks = model.Tracks.ToResource(),
|
Tracks = model.Tracks.ToResource(),
|
||||||
Quality = model.Quality,
|
Quality = model.Quality,
|
||||||
|
Language = model.Language,
|
||||||
//QualityWeight
|
//QualityWeight
|
||||||
DownloadId = model.DownloadId,
|
DownloadId = model.DownloadId,
|
||||||
Rejections = model.Rejections
|
Rejections = model.Rejections
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NzbDrone.Core.Qualities;
|
using NzbDrone.Core.Qualities;
|
||||||
|
using NzbDrone.Core.Languages;
|
||||||
|
|
||||||
namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
|
namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
|
||||||
{
|
{
|
||||||
|
@ -10,6 +11,7 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
|
||||||
public int AlbumId { get; set; }
|
public int AlbumId { get; set; }
|
||||||
public List<int> TrackIds { get; set; }
|
public List<int> TrackIds { get; set; }
|
||||||
public QualityModel Quality { get; set; }
|
public QualityModel Quality { get; set; }
|
||||||
|
public Language Language { get; set; }
|
||||||
public string DownloadId { get; set; }
|
public string DownloadId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NzbDrone.Core.DecisionEngine;
|
using NzbDrone.Core.DecisionEngine;
|
||||||
using NzbDrone.Core.Qualities;
|
using NzbDrone.Core.Qualities;
|
||||||
|
using NzbDrone.Core.Languages;
|
||||||
using NzbDrone.Core.Music;
|
using NzbDrone.Core.Music;
|
||||||
|
|
||||||
namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
|
namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
|
||||||
|
@ -15,6 +16,7 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
|
||||||
public Album Album { get; set; }
|
public Album Album { get; set; }
|
||||||
public List<Track> Tracks { get; set; }
|
public List<Track> Tracks { get; set; }
|
||||||
public QualityModel Quality { get; set; }
|
public QualityModel Quality { get; set; }
|
||||||
|
public Language Language { get; set; }
|
||||||
public string DownloadId { get; set; }
|
public string DownloadId { get; set; }
|
||||||
public IEnumerable<Rejection> Rejections { get; set; }
|
public IEnumerable<Rejection> Rejections { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,6 +147,7 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
|
||||||
var localTrack = new LocalTrack();
|
var localTrack = new LocalTrack();
|
||||||
localTrack.Path = file;
|
localTrack.Path = file;
|
||||||
localTrack.Quality = QualityParser.ParseQuality(file);
|
localTrack.Quality = QualityParser.ParseQuality(file);
|
||||||
|
localEpisode.Language = LanguageParser.ParseLanguage(file);
|
||||||
localTrack.Size = _diskProvider.GetFileSize(file);
|
localTrack.Size = _diskProvider.GetFileSize(file);
|
||||||
|
|
||||||
return MapItem(new ImportDecision(localTrack, new Rejection("Unknown Artist")), folder, downloadId);
|
return MapItem(new ImportDecision(localTrack, new Rejection("Unknown Artist")), folder, downloadId);
|
||||||
|
@ -183,6 +184,7 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
|
||||||
}
|
}
|
||||||
|
|
||||||
item.Quality = decision.LocalTrack.Quality;
|
item.Quality = decision.LocalTrack.Quality;
|
||||||
|
item.Language = decision.LocalTrack.Language;
|
||||||
item.Size = _diskProvider.GetFileSize(decision.LocalTrack.Path);
|
item.Size = _diskProvider.GetFileSize(decision.LocalTrack.Path);
|
||||||
item.Rejections = decision.Rejections;
|
item.Rejections = decision.Rejections;
|
||||||
|
|
||||||
|
@ -216,6 +218,7 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Manual
|
||||||
ParsedTrackInfo = parsedTrackInfo,
|
ParsedTrackInfo = parsedTrackInfo,
|
||||||
Path = file.Path,
|
Path = file.Path,
|
||||||
Quality = file.Quality,
|
Quality = file.Quality,
|
||||||
|
Language = file.Language,
|
||||||
Artist = artist,
|
Artist = artist,
|
||||||
Album = album,
|
Album = album,
|
||||||
Size = 0
|
Size = 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue