Series Type
@@ -308,16 +276,13 @@ ImportSeriesFooter.propTypes = {
isLookingUpSeries: PropTypes.bool.isRequired,
defaultMonitor: PropTypes.string.isRequired,
defaultQualityProfileId: PropTypes.number,
- defaultLanguageProfileId: PropTypes.number,
defaultSeriesType: PropTypes.string.isRequired,
defaultSeasonFolder: PropTypes.bool.isRequired,
isMonitorMixed: PropTypes.bool.isRequired,
isQualityProfileIdMixed: PropTypes.bool.isRequired,
- isLanguageProfileIdMixed: PropTypes.bool.isRequired,
isSeriesTypeMixed: PropTypes.bool.isRequired,
isSeasonFolderMixed: PropTypes.bool.isRequired,
hasUnsearchedItems: PropTypes.bool.isRequired,
- showLanguageProfile: PropTypes.bool.isRequired,
importError: PropTypes.object,
onInputChange: PropTypes.func.isRequired,
onImportPress: PropTypes.func.isRequired,
diff --git a/frontend/src/AddSeries/ImportSeries/Import/ImportSeriesFooterConnector.js b/frontend/src/AddSeries/ImportSeries/Import/ImportSeriesFooterConnector.js
index d43fc6553..12a90aae7 100644
--- a/frontend/src/AddSeries/ImportSeries/Import/ImportSeriesFooterConnector.js
+++ b/frontend/src/AddSeries/ImportSeries/Import/ImportSeriesFooterConnector.js
@@ -19,7 +19,6 @@ function createMapStateToProps() {
const {
monitor: defaultMonitor,
qualityProfileId: defaultQualityProfileId,
- languageProfileId: defaultLanguageProfileId,
seriesType: defaultSeriesType,
seasonFolder: defaultSeasonFolder
} = addSeries.defaults;
@@ -33,7 +32,6 @@ function createMapStateToProps() {
const isMonitorMixed = isMixed(items, selectedIds, defaultMonitor, 'monitor');
const isQualityProfileIdMixed = isMixed(items, selectedIds, defaultQualityProfileId, 'qualityProfileId');
- const isLanguageProfileIdMixed = isMixed(items, selectedIds, defaultLanguageProfileId, 'languageProfileId');
const isSeriesTypeMixed = isMixed(items, selectedIds, defaultSeriesType, 'seriesType');
const isSeasonFolderMixed = isMixed(items, selectedIds, defaultSeasonFolder, 'seasonFolder');
const hasUnsearchedItems = !isLookingUpSeries && items.some((item) => !item.isPopulated);
@@ -44,12 +42,10 @@ function createMapStateToProps() {
isImporting,
defaultMonitor,
defaultQualityProfileId,
- defaultLanguageProfileId,
defaultSeriesType,
defaultSeasonFolder,
isMonitorMixed,
isQualityProfileIdMixed,
- isLanguageProfileIdMixed,
isSeriesTypeMixed,
isSeasonFolderMixed,
importError,
diff --git a/frontend/src/AddSeries/ImportSeries/Import/ImportSeriesHeader.css b/frontend/src/AddSeries/ImportSeries/Import/ImportSeriesHeader.css
index 00284e107..df5214bdd 100644
--- a/frontend/src/AddSeries/ImportSeries/Import/ImportSeriesHeader.css
+++ b/frontend/src/AddSeries/ImportSeries/Import/ImportSeriesHeader.css
@@ -11,8 +11,7 @@
min-width: 185px;
}
-.qualityProfile,
-.languageProfile {
+.qualityProfile {
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';
flex: 0 1 250px;
diff --git a/frontend/src/AddSeries/ImportSeries/Import/ImportSeriesHeader.js b/frontend/src/AddSeries/ImportSeries/Import/ImportSeriesHeader.js
index d9af38560..d6ce86bad 100644
--- a/frontend/src/AddSeries/ImportSeries/Import/ImportSeriesHeader.js
+++ b/frontend/src/AddSeries/ImportSeries/Import/ImportSeriesHeader.js
@@ -12,7 +12,6 @@ import styles from './ImportSeriesHeader.css';
function ImportSeriesHeader(props) {
const {
- showLanguageProfile,
allSelected,
allUnselected,
onSelectAllChange
@@ -59,16 +58,6 @@ function ImportSeriesHeader(props) {
Quality Profile
- {
- showLanguageProfile &&
-
- Language Profile
-
- }
-
-
-
-
-
}
- {
- showCutoffUnmetIcon &&
- !!episodeFile &&
- episodeFile.languageCutoffNotMet &&
- !episodeFile.qualityCutoffNotMet &&
-
- }
-
{
episodeNumber === 1 && seasonNumber > 0 &&
:
- null
- }
-
{
episodeNumber === 1 && seasonNumber > 0 ?
);
}
diff --git a/frontend/src/Components/Filter/Builder/FilterBuilderRow.js b/frontend/src/Components/Filter/Builder/FilterBuilderRow.js
index f6d0a8b6d..516ddf193 100644
--- a/frontend/src/Components/Filter/Builder/FilterBuilderRow.js
+++ b/frontend/src/Components/Filter/Builder/FilterBuilderRow.js
@@ -7,7 +7,6 @@ import BoolFilterBuilderRowValue from './BoolFilterBuilderRowValue';
import DateFilterBuilderRowValue from './DateFilterBuilderRowValue';
import FilterBuilderRowValueConnector from './FilterBuilderRowValueConnector';
import IndexerFilterBuilderRowValueConnector from './IndexerFilterBuilderRowValueConnector';
-import LanguageProfileFilterBuilderRowValueConnector from './LanguageProfileFilterBuilderRowValueConnector';
import ProtocolFilterBuilderRowValue from './ProtocolFilterBuilderRowValue';
import QualityFilterBuilderRowValueConnector from './QualityFilterBuilderRowValueConnector';
import QualityProfileFilterBuilderRowValueConnector from './QualityProfileFilterBuilderRowValueConnector';
@@ -61,9 +60,6 @@ function getRowValueConnector(selectedFilterBuilderProp) {
case filterBuilderValueTypes.INDEXER:
return IndexerFilterBuilderRowValueConnector;
- case filterBuilderValueTypes.LANGUAGE_PROFILE:
- return LanguageProfileFilterBuilderRowValueConnector;
-
case filterBuilderValueTypes.PROTOCOL:
return ProtocolFilterBuilderRowValue;
diff --git a/frontend/src/Components/Filter/Builder/LanguageProfileFilterBuilderRowValueConnector.js b/frontend/src/Components/Filter/Builder/LanguageProfileFilterBuilderRowValueConnector.js
deleted file mode 100644
index 31b1e952a..000000000
--- a/frontend/src/Components/Filter/Builder/LanguageProfileFilterBuilderRowValueConnector.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import { connect } from 'react-redux';
-import { createSelector } from 'reselect';
-import FilterBuilderRowValue from './FilterBuilderRowValue';
-
-function createMapStateToProps() {
- return createSelector(
- (state) => state.settings.languageProfiles,
- (languageProfiles) => {
- const tagList = languageProfiles.items.map((languageProfile) => {
- const {
- id,
- name
- } = languageProfile;
-
- return {
- id,
- name
- };
- });
-
- return {
- tagList
- };
- }
- );
-}
-
-export default connect(createMapStateToProps)(FilterBuilderRowValue);
diff --git a/frontend/src/Components/Form/FormInputGroup.js b/frontend/src/Components/Form/FormInputGroup.js
index 5951520d5..94780aba2 100644
--- a/frontend/src/Components/Form/FormInputGroup.js
+++ b/frontend/src/Components/Form/FormInputGroup.js
@@ -12,7 +12,6 @@ import EnhancedSelectInputConnector from './EnhancedSelectInputConnector';
import FormInputHelpText from './FormInputHelpText';
import IndexerSelectInputConnector from './IndexerSelectInputConnector';
import KeyValueListInput from './KeyValueListInput';
-import LanguageProfileSelectInputConnector from './LanguageProfileSelectInputConnector';
import MonitorEpisodesSelectInput from './MonitorEpisodesSelectInput';
import NumberInput from './NumberInput';
import OAuthInputConnector from './OAuthInputConnector';
@@ -64,9 +63,6 @@ function getComponent(type) {
case inputTypes.QUALITY_PROFILE_SELECT:
return QualityProfileSelectInputConnector;
- case inputTypes.LANGUAGE_PROFILE_SELECT:
- return LanguageProfileSelectInputConnector;
-
case inputTypes.INDEXER_SELECT:
return IndexerSelectInputConnector;
diff --git a/frontend/src/Components/Form/LanguageProfileSelectInputConnector.js b/frontend/src/Components/Form/LanguageProfileSelectInputConnector.js
deleted file mode 100644
index 01c00969d..000000000
--- a/frontend/src/Components/Form/LanguageProfileSelectInputConnector.js
+++ /dev/null
@@ -1,99 +0,0 @@
-import _ from 'lodash';
-import PropTypes from 'prop-types';
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { createSelector } from 'reselect';
-import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
-import sortByName from 'Utilities/Array/sortByName';
-import SelectInput from './SelectInput';
-
-function createMapStateToProps() {
- return createSelector(
- createSortedSectionSelector('settings.languageProfiles', sortByName),
- (state, { includeNoChange }) => includeNoChange,
- (state, { includeMixed }) => includeMixed,
- (languageProfiles, includeNoChange, includeMixed) => {
- const values = _.map(languageProfiles.items, (languageProfile) => {
- return {
- key: languageProfile.id,
- value: languageProfile.name
- };
- });
-
- if (includeNoChange) {
- values.unshift({
- key: 'noChange',
- value: 'No Change',
- disabled: true
- });
- }
-
- if (includeMixed) {
- values.unshift({
- key: 'mixed',
- value: '(Mixed)',
- disabled: true
- });
- }
-
- return {
- values
- };
- }
- );
-}
-
-class LanguageProfileSelectInputConnector extends Component {
-
- //
- // Lifecycle
-
- componentDidMount() {
- const {
- name,
- value,
- values
- } = this.props;
-
- if (!value || !_.some(values, (option) => parseInt(option.key) === value)) {
- const firstValue = _.find(values, (option) => !isNaN(parseInt(option.key)));
-
- if (firstValue) {
- this.onChange({ name, value: firstValue.key });
- }
- }
- }
-
- //
- // Listeners
-
- onChange = ({ name, value }) => {
- this.props.onChange({ name, value: parseInt(value) });
- };
-
- //
- // Render
-
- render() {
- return (
-
- );
- }
-}
-
-LanguageProfileSelectInputConnector.propTypes = {
- name: PropTypes.string.isRequired,
- value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
- values: PropTypes.arrayOf(PropTypes.object).isRequired,
- includeNoChange: PropTypes.bool.isRequired,
- onChange: PropTypes.func.isRequired
-};
-
-LanguageProfileSelectInputConnector.defaultProps = {
- includeNoChange: false
-};
-
-export default connect(createMapStateToProps)(LanguageProfileSelectInputConnector);
diff --git a/frontend/src/Components/Form/LanguageSelectInputConnector.js b/frontend/src/Components/Form/LanguageSelectInputConnector.js
new file mode 100644
index 000000000..dd3a52017
--- /dev/null
+++ b/frontend/src/Components/Form/LanguageSelectInputConnector.js
@@ -0,0 +1,52 @@
+import PropTypes from 'prop-types';
+import React, { Component } from 'react';
+import { connect } from 'react-redux';
+import { createSelector } from 'reselect';
+import EnhancedSelectInput from './EnhancedSelectInput';
+
+function createMapStateToProps() {
+ return createSelector(
+ (state, { values }) => values,
+ ( languages ) => {
+
+ const minId = languages.reduce((min, v) => (v.key < 1 ? v.key : min), languages[0].key);
+
+ const values = languages.map(({ key, value }) => {
+ return {
+ key,
+ value,
+ dividerAfter: minId < 1 ? key === minId : false
+ };
+ });
+
+ return {
+ values
+ };
+ }
+ );
+}
+
+class LanguageSelectInputConnector extends Component {
+
+ //
+ // Render
+
+ render() {
+
+ return (
+
+ );
+ }
+}
+
+LanguageSelectInputConnector.propTypes = {
+ name: PropTypes.string.isRequired,
+ value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]).isRequired,
+ values: PropTypes.arrayOf(PropTypes.object).isRequired,
+ onChange: PropTypes.func.isRequired
+};
+
+export default connect(createMapStateToProps)(LanguageSelectInputConnector);
diff --git a/frontend/src/Components/Page/ErrorPage.js b/frontend/src/Components/Page/ErrorPage.js
index 7e2f5e405..fbbc1af25 100644
--- a/frontend/src/Components/Page/ErrorPage.js
+++ b/frontend/src/Components/Page/ErrorPage.js
@@ -11,7 +11,6 @@ function ErrorPage(props) {
customFiltersError,
tagsError,
qualityProfilesError,
- languageProfilesError,
uiSettingsError,
systemStatusError
} = props;
@@ -28,8 +27,6 @@ function ErrorPage(props) {
errorMessage = getErrorMessage(tagsError, 'Failed to load tags from API');
} else if (qualityProfilesError) {
errorMessage = getErrorMessage(qualityProfilesError, 'Failed to load quality profiles from API');
- } else if (languageProfilesError) {
- errorMessage = getErrorMessage(languageProfilesError, 'Failed to load language profiles from API');
} else if (uiSettingsError) {
errorMessage = getErrorMessage(uiSettingsError, 'Failed to load UI settings from API');
} else if (systemStatusError) {
@@ -56,7 +53,6 @@ ErrorPage.propTypes = {
customFiltersError: PropTypes.object,
tagsError: PropTypes.object,
qualityProfilesError: PropTypes.object,
- languageProfilesError: PropTypes.object,
uiSettingsError: PropTypes.object,
systemStatusError: PropTypes.object
};
diff --git a/frontend/src/Components/Page/PageConnector.js b/frontend/src/Components/Page/PageConnector.js
index 0cd28240b..a3127eddf 100644
--- a/frontend/src/Components/Page/PageConnector.js
+++ b/frontend/src/Components/Page/PageConnector.js
@@ -6,7 +6,7 @@ import { createSelector } from 'reselect';
import { saveDimensions, setIsSidebarVisible } from 'Store/Actions/appActions';
import { fetchCustomFilters } from 'Store/Actions/customFilterActions';
import { fetchSeries } from 'Store/Actions/seriesActions';
-import { fetchImportLists, fetchLanguageProfiles, fetchQualityProfiles, fetchUISettings } from 'Store/Actions/settingsActions';
+import { fetchImportLists, fetchLanguages, fetchQualityProfiles, fetchUISettings } from 'Store/Actions/settingsActions';
import { fetchStatus } from 'Store/Actions/systemActions';
import { fetchTags } from 'Store/Actions/tagActions';
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
@@ -49,7 +49,7 @@ const selectIsPopulated = createSelector(
(state) => state.tags.isPopulated,
(state) => state.settings.ui.isPopulated,
(state) => state.settings.qualityProfiles.isPopulated,
- (state) => state.settings.languageProfiles.isPopulated,
+ (state) => state.settings.languages.isPopulated,
(state) => state.settings.importLists.isPopulated,
(state) => state.system.status.isPopulated,
(
@@ -58,7 +58,7 @@ const selectIsPopulated = createSelector(
tagsIsPopulated,
uiSettingsIsPopulated,
qualityProfilesIsPopulated,
- languageProfilesIsPopulated,
+ languagesIsPopulated,
importListsIsPopulated,
systemStatusIsPopulated
) => {
@@ -68,7 +68,7 @@ const selectIsPopulated = createSelector(
tagsIsPopulated &&
uiSettingsIsPopulated &&
qualityProfilesIsPopulated &&
- languageProfilesIsPopulated &&
+ languagesIsPopulated &&
importListsIsPopulated &&
systemStatusIsPopulated
);
@@ -81,7 +81,7 @@ const selectErrors = createSelector(
(state) => state.tags.error,
(state) => state.settings.ui.error,
(state) => state.settings.qualityProfiles.error,
- (state) => state.settings.languageProfiles.error,
+ (state) => state.settings.languages.error,
(state) => state.settings.importLists.error,
(state) => state.system.status.error,
(
@@ -90,7 +90,7 @@ const selectErrors = createSelector(
tagsError,
uiSettingsError,
qualityProfilesError,
- languageProfilesError,
+ languagesError,
importListsError,
systemStatusError
) => {
@@ -100,7 +100,7 @@ const selectErrors = createSelector(
tagsError ||
uiSettingsError ||
qualityProfilesError ||
- languageProfilesError ||
+ languagesError ||
importListsError ||
systemStatusError
);
@@ -112,7 +112,7 @@ const selectErrors = createSelector(
tagsError,
uiSettingsError,
qualityProfilesError,
- languageProfilesError,
+ languagesError,
importListsError,
systemStatusError
};
@@ -161,8 +161,8 @@ function createMapDispatchToProps(dispatch, props) {
dispatchFetchQualityProfiles() {
dispatch(fetchQualityProfiles());
},
- dispatchFetchLanguageProfiles() {
- dispatch(fetchLanguageProfiles());
+ dispatchFetchLanguages() {
+ dispatch(fetchLanguages());
},
dispatchFetchImportLists() {
dispatch(fetchImportLists());
@@ -201,7 +201,7 @@ class PageConnector extends Component {
this.props.dispatchFetchCustomFilters();
this.props.dispatchFetchTags();
this.props.dispatchFetchQualityProfiles();
- this.props.dispatchFetchLanguageProfiles();
+ this.props.dispatchFetchLanguages();
this.props.dispatchFetchImportLists();
this.props.dispatchFetchUISettings();
this.props.dispatchFetchStatus();
@@ -225,7 +225,7 @@ class PageConnector extends Component {
dispatchFetchSeries,
dispatchFetchTags,
dispatchFetchQualityProfiles,
- dispatchFetchLanguageProfiles,
+ dispatchFetchLanguages,
dispatchFetchImportLists,
dispatchFetchUISettings,
dispatchFetchStatus,
@@ -264,7 +264,7 @@ PageConnector.propTypes = {
dispatchFetchCustomFilters: PropTypes.func.isRequired,
dispatchFetchTags: PropTypes.func.isRequired,
dispatchFetchQualityProfiles: PropTypes.func.isRequired,
- dispatchFetchLanguageProfiles: PropTypes.func.isRequired,
+ dispatchFetchLanguages: PropTypes.func.isRequired,
dispatchFetchImportLists: PropTypes.func.isRequired,
dispatchFetchUISettings: PropTypes.func.isRequired,
dispatchFetchStatus: PropTypes.func.isRequired,
diff --git a/frontend/src/Episode/EpisodeLanguage.js b/frontend/src/Episode/EpisodeLanguage.js
deleted file mode 100644
index 52c8b3390..000000000
--- a/frontend/src/Episode/EpisodeLanguage.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import PropTypes from 'prop-types';
-import React from 'react';
-import Label from 'Components/Label';
-import { kinds } from 'Helpers/Props';
-
-function EpisodeLanguage(props) {
- const {
- className,
- language,
- isCutoffNotMet
- } = props;
-
- if (!language) {
- return null;
- }
-
- return (
-
- );
-}
-
-EpisodeLanguage.propTypes = {
- className: PropTypes.string,
- language: PropTypes.object,
- isCutoffNotMet: PropTypes.bool
-};
-
-EpisodeLanguage.defaultProps = {
- isCutoffNotMet: true
-};
-
-export default EpisodeLanguage;
diff --git a/frontend/src/Episode/EpisodeLanguages.js b/frontend/src/Episode/EpisodeLanguages.js
new file mode 100644
index 000000000..53e3854cc
--- /dev/null
+++ b/frontend/src/Episode/EpisodeLanguages.js
@@ -0,0 +1,69 @@
+import PropTypes from 'prop-types';
+import React from 'react';
+import Label from 'Components/Label';
+import Popover from 'Components/Tooltip/Popover';
+import { kinds, tooltipPositions } from 'Helpers/Props';
+
+function EpisodeLanguages(props) {
+ const {
+ className,
+ languages,
+ isCutoffNotMet
+ } = props;
+
+ if (!languages) {
+ return null;
+ }
+
+ if (languages.length === 1) {
+ return (
+
+ );
+ }
+
+ return (
+
+ Multi-Languages
+
+ }
+ title={'Languages'}
+ body={
+
+ {
+ languages.map((language) => {
+ return (
+ -
+ {language.name}
+
+ );
+ })
+ }
+
+ }
+ position={tooltipPositions.LEFT}
+ />
+ );
+}
+
+EpisodeLanguages.propTypes = {
+ className: PropTypes.string,
+ languages: PropTypes.arrayOf(PropTypes.object),
+ isCutoffNotMet: PropTypes.bool
+};
+
+EpisodeLanguages.defaultProps = {
+ isCutoffNotMet: true
+};
+
+export default EpisodeLanguages;
diff --git a/frontend/src/Episode/History/EpisodeHistory.js b/frontend/src/Episode/History/EpisodeHistory.js
index e85c9589d..ebf6eaaff 100644
--- a/frontend/src/Episode/History/EpisodeHistory.js
+++ b/frontend/src/Episode/History/EpisodeHistory.js
@@ -18,8 +18,8 @@ const columns = [
isVisible: true
},
{
- name: 'language',
- label: 'Language',
+ name: 'languages',
+ label: 'Languages',
isVisible: true
},
{
diff --git a/frontend/src/Episode/History/EpisodeHistoryRow.js b/frontend/src/Episode/History/EpisodeHistoryRow.js
index f6a824b28..e02883124 100644
--- a/frontend/src/Episode/History/EpisodeHistoryRow.js
+++ b/frontend/src/Episode/History/EpisodeHistoryRow.js
@@ -11,7 +11,7 @@ import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableRow from 'Components/Table/TableRow';
import Popover from 'Components/Tooltip/Popover';
import Tooltip from 'Components/Tooltip/Tooltip';
-import EpisodeLanguage from 'Episode/EpisodeLanguage';
+import EpisodeLanguages from 'Episode/EpisodeLanguages';
import EpisodeQuality from 'Episode/EpisodeQuality';
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
@@ -65,7 +65,7 @@ class EpisodeHistoryRow extends Component {
const {
eventType,
sourceTitle,
- language,
+ languages,
languageCutoffNotMet,
quality,
qualityCutoffNotMet,
@@ -90,8 +90,8 @@ class EpisodeHistoryRow extends Component {
-
@@ -177,7 +177,7 @@ EpisodeHistoryRow.propTypes = {
id: PropTypes.number.isRequired,
eventType: PropTypes.string.isRequired,
sourceTitle: PropTypes.string.isRequired,
- language: PropTypes.object.isRequired,
+ languages: PropTypes.arrayOf(PropTypes.object).isRequired,
languageCutoffNotMet: PropTypes.bool.isRequired,
quality: PropTypes.object.isRequired,
qualityCutoffNotMet: PropTypes.bool.isRequired,
diff --git a/frontend/src/Episode/Summary/EpisodeFileRow.css b/frontend/src/Episode/Summary/EpisodeFileRow.css
index 565a785f0..a8b5f9372 100644
--- a/frontend/src/Episode/Summary/EpisodeFileRow.css
+++ b/frontend/src/Episode/Summary/EpisodeFileRow.css
@@ -4,7 +4,7 @@
width: 100px;
}
-.language,
+.languages,
.quality {
composes: cell from '~Components/Table/Cells/TableRowCell.css';
diff --git a/frontend/src/Episode/Summary/EpisodeFileRow.js b/frontend/src/Episode/Summary/EpisodeFileRow.js
index 32994a197..901771a48 100644
--- a/frontend/src/Episode/Summary/EpisodeFileRow.js
+++ b/frontend/src/Episode/Summary/EpisodeFileRow.js
@@ -6,7 +6,7 @@ import ConfirmModal from 'Components/Modal/ConfirmModal';
import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableRow from 'Components/Table/TableRow';
import Popover from 'Components/Tooltip/Popover';
-import EpisodeLanguage from 'Episode/EpisodeLanguage';
+import EpisodeLanguages from 'Episode/EpisodeLanguages';
import EpisodeQuality from 'Episode/EpisodeQuality';
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
import formatBytes from 'Utilities/Number/formatBytes';
@@ -50,7 +50,7 @@ class EpisodeFileRow extends Component {
const {
path,
size,
- language,
+ languages,
quality,
languageCutoffNotMet,
qualityCutoffNotMet,
@@ -87,14 +87,14 @@ class EpisodeFileRow extends Component {
);
}
- if (name === 'language') {
+ if (name === 'languages') {
return (
-
@@ -167,7 +167,7 @@ class EpisodeFileRow extends Component {
EpisodeFileRow.propTypes = {
path: PropTypes.string.isRequired,
size: PropTypes.number.isRequired,
- language: PropTypes.object.isRequired,
+ languages: PropTypes.arrayOf(PropTypes.object).isRequired,
languageCutoffNotMet: PropTypes.bool.isRequired,
quality: PropTypes.object.isRequired,
qualityCutoffNotMet: PropTypes.bool.isRequired,
diff --git a/frontend/src/Episode/Summary/EpisodeSummary.js b/frontend/src/Episode/Summary/EpisodeSummary.js
index 37d9f2150..74e6d7336 100644
--- a/frontend/src/Episode/Summary/EpisodeSummary.js
+++ b/frontend/src/Episode/Summary/EpisodeSummary.js
@@ -24,8 +24,8 @@ const columns = [
isVisible: true
},
{
- name: 'language',
- label: 'Language',
+ name: 'languages',
+ label: 'Languages',
isSortable: false,
isVisible: true
},
@@ -84,7 +84,7 @@ class EpisodeSummary extends Component {
mediaInfo,
path,
size,
- language,
+ languages,
quality,
languageCutoffNotMet,
qualityCutoffNotMet,
@@ -132,7 +132,7 @@ class EpisodeSummary extends Component {
{
return {
- language: episodeFile ? episodeFile.language : undefined
+ languages: episodeFile ? episodeFile.languages : undefined
};
}
);
}
-export default connect(createMapStateToProps)(EpisodeLanguage);
+export default connect(createMapStateToProps)(EpisodeLanguages);
diff --git a/frontend/src/Helpers/Props/filterBuilderValueTypes.js b/frontend/src/Helpers/Props/filterBuilderValueTypes.js
index 0490975a6..a1f8f499d 100644
--- a/frontend/src/Helpers/Props/filterBuilderValueTypes.js
+++ b/frontend/src/Helpers/Props/filterBuilderValueTypes.js
@@ -3,7 +3,6 @@ export const BYTES = 'bytes';
export const DATE = 'date';
export const DEFAULT = 'default';
export const INDEXER = 'indexer';
-export const LANGUAGE_PROFILE = 'languageProfile';
export const PROTOCOL = 'protocol';
export const QUALITY = 'quality';
export const QUALITY_PROFILE = 'qualityProfile';
diff --git a/frontend/src/Helpers/Props/inputTypes.js b/frontend/src/Helpers/Props/inputTypes.js
index 8bba563a2..d0aecd281 100644
--- a/frontend/src/Helpers/Props/inputTypes.js
+++ b/frontend/src/Helpers/Props/inputTypes.js
@@ -9,8 +9,8 @@ export const OAUTH = 'oauth';
export const PASSWORD = 'password';
export const PATH = 'path';
export const QUALITY_PROFILE_SELECT = 'qualityProfileSelect';
-export const LANGUAGE_PROFILE_SELECT = 'languageProfileSelect';
export const INDEXER_SELECT = 'indexerSelect';
+export const LANGUAGE_SELECT = 'languageSelect';
export const DOWNLOAD_CLIENT_SELECT = 'downloadClientSelect';
export const ROOT_FOLDER_SELECT = 'rootFolderSelect';
export const SELECT = 'select';
@@ -35,10 +35,10 @@ export const all = [
PASSWORD,
PATH,
QUALITY_PROFILE_SELECT,
- LANGUAGE_PROFILE_SELECT,
INDEXER_SELECT,
DOWNLOAD_CLIENT_SELECT,
ROOT_FOLDER_SELECT,
+ LANGUAGE_SELECT,
SELECT,
DYNAMIC_SELECT,
SERIES_TYPE_SELECT,
diff --git a/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContent.js b/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContent.js
index 214d8c189..4d52272c7 100644
--- a/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContent.js
+++ b/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContent.js
@@ -66,8 +66,8 @@ const columns = [
isVisible: true
},
{
- name: 'language',
- label: 'Language',
+ name: 'languages',
+ label: 'Languages',
isSortable: true,
isVisible: true
},
diff --git a/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContentConnector.js b/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContentConnector.js
index 92db91013..360f59652 100644
--- a/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContentConnector.js
+++ b/frontend/src/InteractiveImport/Interactive/InteractiveImportModalContentConnector.js
@@ -193,7 +193,7 @@ class InteractiveImportModalContentConnector extends Component {
episodes,
releaseGroup,
quality,
- language,
+ languages,
episodeFileId
} = item;
@@ -217,8 +217,8 @@ class InteractiveImportModalContentConnector extends Component {
return;
}
- if (!language) {
- this.setState({ interactiveImportErrorMessage: 'Language must be chosen for each selected file' });
+ if (!languages) {
+ this.setState({ interactiveImportErrorMessage: 'Language(s) must be chosen for each selected file' });
return;
}
@@ -230,7 +230,7 @@ class InteractiveImportModalContentConnector extends Component {
id: episodeFileId,
releaseGroup,
quality,
- language
+ languages
});
return;
@@ -244,7 +244,7 @@ class InteractiveImportModalContentConnector extends Component {
episodeIds: episodes.map((e) => e.id),
releaseGroup,
quality,
- language,
+ languages,
downloadId: this.props.downloadId,
episodeFileId
});
diff --git a/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.css b/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.css
index 012108f8c..b2304553f 100644
--- a/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.css
+++ b/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.css
@@ -5,7 +5,7 @@
}
.quality,
-.language {
+.languages {
composes: cell from '~Components/Table/Cells/TableRowCell.css';
text-align: center;
diff --git a/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.js b/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.js
index ba8c29ae5..8e89c4b9e 100644
--- a/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.js
+++ b/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.js
@@ -7,7 +7,7 @@ import TableRowCellButton from 'Components/Table/Cells/TableRowCellButton';
import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
import TableRow from 'Components/Table/TableRow';
import Popover from 'Components/Tooltip/Popover';
-import EpisodeLanguage from 'Episode/EpisodeLanguage';
+import EpisodeLanguages from 'Episode/EpisodeLanguages';
import EpisodeQuality from 'Episode/EpisodeQuality';
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
import SelectEpisodeModal from 'InteractiveImport/Episode/SelectEpisodeModal';
@@ -47,7 +47,7 @@ class InteractiveImportRow extends Component {
seasonNumber,
episodes,
quality,
- language,
+ languages,
episodeFileId,
columns
} = this.props;
@@ -58,7 +58,7 @@ class InteractiveImportRow extends Component {
seasonNumber != null &&
episodes.length &&
quality &&
- language
+ languages
) {
this.props.onSelectedChange({
id,
@@ -79,7 +79,7 @@ class InteractiveImportRow extends Component {
seasonNumber,
episodes,
quality,
- language,
+ languages,
isSelected,
onValidRowChange
} = this.props;
@@ -89,7 +89,7 @@ class InteractiveImportRow extends Component {
prevProps.seasonNumber === seasonNumber &&
!hasDifferentItems(prevProps.episodes, episodes) &&
prevProps.quality === quality &&
- prevProps.language === language &&
+ prevProps.languages === languages &&
prevProps.isSelected === isSelected
) {
return;
@@ -100,7 +100,7 @@ class InteractiveImportRow extends Component {
seasonNumber != null &&
episodes.length &&
quality &&
- language
+ languages
);
if (isSelected && !isValid) {
@@ -210,7 +210,7 @@ class InteractiveImportRow extends Component {
seasonNumber,
episodes,
quality,
- language,
+ languages,
releaseGroup,
size,
rejections,
@@ -252,7 +252,7 @@ class InteractiveImportRow extends Component {
const showEpisodeNumbersPlaceholder = isSelected && Number.isInteger(seasonNumber) && !episodes.length;
const showReleaseGroupPlaceholder = isSelected && !releaseGroup;
const showQualityPlaceholder = isSelected && !quality;
- const showLanguagePlaceholder = isSelected && !language;
+ const showLanguagePlaceholder = isSelected && !languages;
return (
@@ -352,10 +352,10 @@ class InteractiveImportRow extends Component {
}
{
- !showLanguagePlaceholder && !!language &&
-
}
@@ -441,7 +441,7 @@ class InteractiveImportRow extends Component {
@@ -460,7 +460,7 @@ InteractiveImportRow.propTypes = {
episodes: PropTypes.arrayOf(PropTypes.object).isRequired,
releaseGroup: PropTypes.string,
quality: PropTypes.object,
- language: PropTypes.object,
+ languages: PropTypes.arrayOf(PropTypes.object),
size: PropTypes.number.isRequired,
rejections: PropTypes.arrayOf(PropTypes.object).isRequired,
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
diff --git a/frontend/src/InteractiveImport/Language/SelectLanguageModalContentConnector.js b/frontend/src/InteractiveImport/Language/SelectLanguageModalContentConnector.js
index bda7193d0..5ed9660dc 100644
--- a/frontend/src/InteractiveImport/Language/SelectLanguageModalContentConnector.js
+++ b/frontend/src/InteractiveImport/Language/SelectLanguageModalContentConnector.js
@@ -4,7 +4,6 @@ import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { reprocessInteractiveImportItems, updateInteractiveImportItems } from 'Store/Actions/interactiveImportActions';
-import { fetchLanguageProfileSchema } from 'Store/Actions/settingsActions';
import createLanguagesSelector from 'Store/Selectors/createLanguagesSelector';
import SelectLanguageModalContent from './SelectLanguageModalContent';
@@ -18,22 +17,12 @@ function createMapStateToProps() {
}
const mapDispatchToProps = {
- dispatchFetchLanguageProfileSchema: fetchLanguageProfileSchema,
dispatchUpdateInteractiveImportItems: updateInteractiveImportItems,
dispatchReprocessInteractiveImportItems: reprocessInteractiveImportItems
};
class SelectLanguageModalContentConnector extends Component {
- //
- // Lifecycle
-
- componentDidMount = () => {
- if (!this.props.isPopulated) {
- this.props.dispatchFetchLanguageProfileSchema();
- }
- };
-
//
// Listeners
@@ -44,13 +33,20 @@ class SelectLanguageModalContentConnector extends Component {
dispatchReprocessInteractiveImportItems
} = this.props;
- const languageId = parseInt(value);
- const language = _.find(this.props.items,
- (item) => item.language.id === languageId).language;
+ const languages = [];
+
+ value.forEach((languageId) => {
+ const language = _.find(this.props.items,
+ (item) => item.id === parseInt(languageId));
+
+ if (language !== undefined) {
+ languages.push(language);
+ }
+ });
dispatchUpdateInteractiveImportItems({
ids,
- language
+ languages
});
dispatchReprocessInteractiveImportItems({ ids });
@@ -77,7 +73,6 @@ SelectLanguageModalContentConnector.propTypes = {
isPopulated: PropTypes.bool.isRequired,
error: PropTypes.object,
items: PropTypes.arrayOf(PropTypes.object).isRequired,
- dispatchFetchLanguageProfileSchema: PropTypes.func.isRequired,
dispatchUpdateInteractiveImportItems: PropTypes.func.isRequired,
dispatchReprocessInteractiveImportItems: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired
diff --git a/frontend/src/InteractiveSearch/InteractiveSearch.js b/frontend/src/InteractiveSearch/InteractiveSearch.js
index da0921314..c3eadb2ae 100644
--- a/frontend/src/InteractiveSearch/InteractiveSearch.js
+++ b/frontend/src/InteractiveSearch/InteractiveSearch.js
@@ -51,7 +51,7 @@ const columns = [
},
{
name: 'languageWeight',
- label: 'Language',
+ label: 'Languages',
isSortable: true,
isVisible: true
},
diff --git a/frontend/src/InteractiveSearch/InteractiveSearchRow.css b/frontend/src/InteractiveSearch/InteractiveSearchRow.css
index 4f7037ca6..b51f12375 100644
--- a/frontend/src/InteractiveSearch/InteractiveSearchRow.css
+++ b/frontend/src/InteractiveSearch/InteractiveSearchRow.css
@@ -24,13 +24,13 @@
}
.quality,
-.language {
+.languages {
composes: cell from '~Components/Table/Cells/TableRowCell.css';
text-align: center;
}
-.language {
+.languages {
width: 100px;
}
diff --git a/frontend/src/InteractiveSearch/InteractiveSearchRow.js b/frontend/src/InteractiveSearch/InteractiveSearchRow.js
index b0a7bed2b..dd68d00fc 100644
--- a/frontend/src/InteractiveSearch/InteractiveSearchRow.js
+++ b/frontend/src/InteractiveSearch/InteractiveSearchRow.js
@@ -10,7 +10,7 @@ import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableRow from 'Components/Table/TableRow';
import Popover from 'Components/Tooltip/Popover';
import Tooltip from 'Components/Tooltip/Tooltip';
-import EpisodeLanguage from 'Episode/EpisodeLanguage';
+import EpisodeLanguages from 'Episode/EpisodeLanguages';
import EpisodeQuality from 'Episode/EpisodeQuality';
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
import formatDateTime from 'Utilities/Date/formatDateTime';
@@ -116,7 +116,7 @@ class InteractiveSearchRow extends Component {
seeders,
leechers,
quality,
- language,
+ languages,
customFormatScore,
customFormats,
sceneMapping,
@@ -188,8 +188,8 @@ class InteractiveSearchRow extends Component {
}
-
-
+
+
@@ -286,7 +286,7 @@ InteractiveSearchRow.propTypes = {
seeders: PropTypes.number,
leechers: PropTypes.number,
quality: PropTypes.object.isRequired,
- language: PropTypes.object.isRequired,
+ languages: PropTypes.arrayOf(PropTypes.object).isRequired,
customFormats: PropTypes.arrayOf(PropTypes.object),
customFormatScore: PropTypes.number.isRequired,
sceneMapping: PropTypes.object,
diff --git a/frontend/src/Series/Details/EpisodeRow.css b/frontend/src/Series/Details/EpisodeRow.css
index 2585248a0..c9fa30526 100644
--- a/frontend/src/Series/Details/EpisodeRow.css
+++ b/frontend/src/Series/Details/EpisodeRow.css
@@ -28,7 +28,7 @@
width: 100px;
}
-.language,
+.languages,
.audio,
.video,
.status {
diff --git a/frontend/src/Series/Details/EpisodeRow.js b/frontend/src/Series/Details/EpisodeRow.js
index 0806f7f59..10e4daffb 100644
--- a/frontend/src/Series/Details/EpisodeRow.js
+++ b/frontend/src/Series/Details/EpisodeRow.js
@@ -180,11 +180,11 @@ class EpisodeRow extends Component {
);
}
- if (name === 'language') {
+ if (name === 'languages') {
return (
- {
- showLanguageProfile &&
-
- Language Profile
-
-
-
- }
-
Series Type
@@ -209,7 +193,6 @@ EditSeriesModalContent.propTypes = {
title: PropTypes.string.isRequired,
item: PropTypes.object.isRequired,
isSaving: PropTypes.bool.isRequired,
- showLanguageProfile: PropTypes.bool.isRequired,
isPathChanging: PropTypes.bool.isRequired,
originalPath: PropTypes.string.isRequired,
onInputChange: PropTypes.func.isRequired,
diff --git a/frontend/src/Series/Edit/EditSeriesModalContentConnector.js b/frontend/src/Series/Edit/EditSeriesModalContentConnector.js
index 7e3fa175a..0521f92df 100644
--- a/frontend/src/Series/Edit/EditSeriesModalContentConnector.js
+++ b/frontend/src/Series/Edit/EditSeriesModalContentConnector.js
@@ -27,10 +27,9 @@ function createIsPathChangingSelector() {
function createMapStateToProps() {
return createSelector(
(state) => state.series,
- (state) => state.settings.languageProfiles,
createSeriesSelector(),
createIsPathChangingSelector(),
- (seriesState, languageProfiles, series, isPathChanging) => {
+ (seriesState, series, isPathChanging) => {
const {
isSaving,
saveError,
@@ -41,7 +40,6 @@ function createMapStateToProps() {
'monitored',
'seasonFolder',
'qualityProfileId',
- 'languageProfileId',
'seriesType',
'path',
'tags'
@@ -56,7 +54,6 @@ function createMapStateToProps() {
isPathChanging,
originalPath: series.path,
item: settings.settings,
- showLanguageProfile: languageProfiles.items.length > 1,
...settings
};
}
diff --git a/frontend/src/Series/Editor/SeriesEditor.js b/frontend/src/Series/Editor/SeriesEditor.js
index 1439f2c65..b3aaffe12 100644
--- a/frontend/src/Series/Editor/SeriesEditor.js
+++ b/frontend/src/Series/Editor/SeriesEditor.js
@@ -212,7 +212,6 @@ class SeriesEditor extends Component {
deleteError={deleteError}
isOrganizingSeries={isOrganizingSeries}
columns={columns}
- showLanguageProfile={columns.find((column) => column.name === 'languageProfileId').isVisible}
onSaveSelected={this.onSaveSelected}
onOrganizeSeriesPress={this.onOrganizeSeriesPress}
/>
diff --git a/frontend/src/Series/Editor/SeriesEditorFooter.js b/frontend/src/Series/Editor/SeriesEditorFooter.js
index f31b7f046..f427b42bd 100644
--- a/frontend/src/Series/Editor/SeriesEditorFooter.js
+++ b/frontend/src/Series/Editor/SeriesEditorFooter.js
@@ -1,6 +1,5 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
-import LanguageProfileSelectInputConnector from 'Components/Form/LanguageProfileSelectInputConnector';
import QualityProfileSelectInputConnector from 'Components/Form/QualityProfileSelectInputConnector';
import RootFolderSelectInputConnector from 'Components/Form/RootFolderSelectInputConnector';
import SelectInput from 'Components/Form/SelectInput';
@@ -27,7 +26,6 @@ class SeriesEditorFooter extends Component {
this.state = {
monitored: NO_CHANGE,
qualityProfileId: NO_CHANGE,
- languageProfileId: NO_CHANGE,
seriesType: NO_CHANGE,
seasonFolder: NO_CHANGE,
rootFolderPath: NO_CHANGE,
@@ -49,7 +47,6 @@ class SeriesEditorFooter extends Component {
this.setState({
monitored: NO_CHANGE,
qualityProfileId: NO_CHANGE,
- languageProfileId: NO_CHANGE,
seriesType: NO_CHANGE,
seasonFolder: NO_CHANGE,
rootFolderPath: NO_CHANGE,
@@ -152,7 +149,6 @@ class SeriesEditorFooter extends Component {
const {
monitored,
qualityProfileId,
- languageProfileId,
seriesType,
seasonFolder,
rootFolderPath,
@@ -225,28 +221,6 @@ class SeriesEditorFooter extends Component {
);
}
- if (name === 'languageProfileId') {
- return (
-
-
-
-
-
- );
- }
-
if (name === 'seriesType') {
return (
- {languageProfile.name}
-
- );
- }
-
if (name === 'seriesType') {
return (
@@ -167,7 +158,6 @@ SeriesEditorRow.propTypes = {
titleSlug: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
monitored: PropTypes.bool.isRequired,
- languageProfile: PropTypes.object.isRequired,
qualityProfile: PropTypes.object.isRequired,
seriesType: PropTypes.string.isRequired,
seasonFolder: PropTypes.bool.isRequired,
diff --git a/frontend/src/Series/Editor/SeriesEditorRowConnector.js b/frontend/src/Series/Editor/SeriesEditorRowConnector.js
index 3d1ee2e71..1b70e92fe 100644
--- a/frontend/src/Series/Editor/SeriesEditorRowConnector.js
+++ b/frontend/src/Series/Editor/SeriesEditorRowConnector.js
@@ -2,17 +2,14 @@ import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
-import createLanguageProfileSelector from 'Store/Selectors/createLanguageProfileSelector';
import createQualityProfileSelector from 'Store/Selectors/createQualityProfileSelector';
import SeriesEditorRow from './SeriesEditorRow';
function createMapStateToProps() {
return createSelector(
- createLanguageProfileSelector(),
createQualityProfileSelector(),
- (languageProfile, qualityProfile) => {
+ (qualityProfile) => {
return {
- languageProfile,
qualityProfile
};
}
diff --git a/frontend/src/Series/History/SeriesHistoryModalContent.js b/frontend/src/Series/History/SeriesHistoryModalContent.js
index dc6d07a81..3bc19b857 100644
--- a/frontend/src/Series/History/SeriesHistoryModalContent.js
+++ b/frontend/src/Series/History/SeriesHistoryModalContent.js
@@ -29,8 +29,8 @@ const columns = [
isVisible: true
},
{
- name: 'language',
- label: 'Language',
+ name: 'languages',
+ label: 'Languages',
isVisible: true
},
{
diff --git a/frontend/src/Series/History/SeriesHistoryRow.js b/frontend/src/Series/History/SeriesHistoryRow.js
index a45495a9a..98a67cc93 100644
--- a/frontend/src/Series/History/SeriesHistoryRow.js
+++ b/frontend/src/Series/History/SeriesHistoryRow.js
@@ -11,7 +11,7 @@ import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableRow from 'Components/Table/TableRow';
import Popover from 'Components/Tooltip/Popover';
import Tooltip from 'Components/Tooltip/Tooltip';
-import EpisodeLanguage from 'Episode/EpisodeLanguage';
+import EpisodeLanguages from 'Episode/EpisodeLanguages';
import EpisodeNumber from 'Episode/EpisodeNumber';
import EpisodeQuality from 'Episode/EpisodeQuality';
import SeasonEpisodeNumber from 'Episode/SeasonEpisodeNumber';
@@ -67,7 +67,7 @@ class SeriesHistoryRow extends Component {
const {
eventType,
sourceTitle,
- language,
+ languages,
languageCutoffNotMet,
quality,
qualityCutoffNotMet,
@@ -110,8 +110,8 @@ class SeriesHistoryRow extends Component {
-
@@ -197,7 +197,7 @@ SeriesHistoryRow.propTypes = {
id: PropTypes.number.isRequired,
eventType: PropTypes.string.isRequired,
sourceTitle: PropTypes.string.isRequired,
- language: PropTypes.object.isRequired,
+ languages: PropTypes.object.isRequired,
languageCutoffNotMet: PropTypes.bool.isRequired,
quality: PropTypes.object.isRequired,
qualityCutoffNotMet: PropTypes.bool.isRequired,
diff --git a/frontend/src/Series/Index/Menus/SeriesIndexSortMenu.js b/frontend/src/Series/Index/Menus/SeriesIndexSortMenu.js
index 4ca1d86e6..018a4c8eb 100644
--- a/frontend/src/Series/Index/Menus/SeriesIndexSortMenu.js
+++ b/frontend/src/Series/Index/Menus/SeriesIndexSortMenu.js
@@ -55,15 +55,6 @@ function SeriesIndexSortMenu(props) {
Quality Profile
-
- Language Profile
-
-
diff --git a/frontend/src/Series/Index/Posters/SeriesIndexPosters.js b/frontend/src/Series/Index/Posters/SeriesIndexPosters.js
index 4339e0d2c..5e856bfe9 100644
--- a/frontend/src/Series/Index/Posters/SeriesIndexPosters.js
+++ b/frontend/src/Series/Index/Posters/SeriesIndexPosters.js
@@ -243,7 +243,6 @@ class SeriesIndexPosters extends Component {
timeFormat={timeFormat}
style={style}
seriesId={series.id}
- languageProfileId={series.languageProfileId}
qualityProfileId={series.qualityProfileId}
/>
diff --git a/frontend/src/Series/Index/SeriesIndexItemConnector.js b/frontend/src/Series/Index/SeriesIndexItemConnector.js
index 7f5380af2..bff4a77b1 100644
--- a/frontend/src/Series/Index/SeriesIndexItemConnector.js
+++ b/frontend/src/Series/Index/SeriesIndexItemConnector.js
@@ -6,7 +6,6 @@ import { createSelector } from 'reselect';
import * as commandNames from 'Commands/commandNames';
import { executeCommand } from 'Store/Actions/commandActions';
import createExecutingCommandsSelector from 'Store/Selectors/createExecutingCommandsSelector';
-import createSeriesLanguageProfileSelector from 'Store/Selectors/createSeriesLanguageProfileSelector';
import createSeriesQualityProfileSelector from 'Store/Selectors/createSeriesQualityProfileSelector';
import createSeriesSelector from 'Store/Selectors/createSeriesSelector';
@@ -32,13 +31,11 @@ function createMapStateToProps() {
return createSelector(
createSeriesSelector(),
createSeriesQualityProfileSelector(),
- createSeriesLanguageProfileSelector(),
selectShowSearchAction(),
createExecutingCommandsSelector(),
(
series,
qualityProfile,
- languageProfile,
showSearchAction,
executingCommands
) => {
@@ -71,7 +68,6 @@ function createMapStateToProps() {
return {
...series,
qualityProfile,
- languageProfile,
latestSeason,
showSearchAction,
isRefreshingSeries,
diff --git a/frontend/src/Series/Index/Table/SeriesIndexHeader.css b/frontend/src/Series/Index/Table/SeriesIndexHeader.css
index ce9f0f6ed..8c5d9f7b0 100644
--- a/frontend/src/Series/Index/Table/SeriesIndexHeader.css
+++ b/frontend/src/Series/Index/Table/SeriesIndexHeader.css
@@ -30,8 +30,7 @@
flex: 2 0 90px;
}
-.qualityProfileId,
-.languageProfileId {
+.qualityProfileId {
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';
flex: 1 0 125px;
diff --git a/frontend/src/Series/Index/Table/SeriesIndexRow.css b/frontend/src/Series/Index/Table/SeriesIndexRow.css
index c5375a7d7..85d313c05 100644
--- a/frontend/src/Series/Index/Table/SeriesIndexRow.css
+++ b/frontend/src/Series/Index/Table/SeriesIndexRow.css
@@ -66,8 +66,7 @@
flex: 2 0 90px;
}
-.qualityProfileId,
-.languageProfileId {
+.qualityProfileId {
composes: cell;
flex: 1 0 125px;
diff --git a/frontend/src/Series/Index/Table/SeriesIndexRow.js b/frontend/src/Series/Index/Table/SeriesIndexRow.js
index c33ff6783..96052addc 100644
--- a/frontend/src/Series/Index/Table/SeriesIndexRow.js
+++ b/frontend/src/Series/Index/Table/SeriesIndexRow.js
@@ -86,7 +86,6 @@ class SeriesIndexRow extends Component {
seriesType,
network,
qualityProfile,
- languageProfile,
nextAiring,
previousAiring,
added,
@@ -224,17 +223,6 @@ class SeriesIndexRow extends Component {
);
}
- if (name === 'languageProfileId') {
- return (
-
- {languageProfile.name}
-
- );
- }
-
if (name === 'nextAiring') {
return (
diff --git a/frontend/src/Series/Index/Table/hasGrowableColumns.js b/frontend/src/Series/Index/Table/hasGrowableColumns.js
index f51824314..7494e2402 100644
--- a/frontend/src/Series/Index/Table/hasGrowableColumns.js
+++ b/frontend/src/Series/Index/Table/hasGrowableColumns.js
@@ -1,7 +1,6 @@
const growableColumns = [
'network',
'qualityProfileId',
- 'languageProfileId',
'path',
'tags'
];
diff --git a/frontend/src/Settings/ImportLists/ImportLists/EditImportListModalContent.css b/frontend/src/Settings/ImportLists/ImportLists/EditImportListModalContent.css
index db5a98500..fd7ddf093 100644
--- a/frontend/src/Settings/ImportLists/ImportLists/EditImportListModalContent.css
+++ b/frontend/src/Settings/ImportLists/ImportLists/EditImportListModalContent.css
@@ -4,12 +4,6 @@
margin-right: auto;
}
-.hideLanguageProfile {
- composes: group from '~Components/Form/FormGroup.css';
-
- display: none;
-}
-
.labelIcon {
margin-left: 8px;
}
diff --git a/frontend/src/Settings/ImportLists/ImportLists/EditImportListModalContent.js b/frontend/src/Settings/ImportLists/ImportLists/EditImportListModalContent.js
index fb3400fd2..e71c680fc 100644
--- a/frontend/src/Settings/ImportLists/ImportLists/EditImportListModalContent.js
+++ b/frontend/src/Settings/ImportLists/ImportLists/EditImportListModalContent.js
@@ -35,7 +35,6 @@ function EditImportListModalContent(props) {
onSavePress,
onTestPress,
onDeleteImportListPress,
- showLanguageProfile,
...otherProps
} = props;
@@ -46,7 +45,6 @@ function EditImportListModalContent(props) {
shouldMonitor,
rootFolderPath,
qualityProfileId,
- languageProfileId,
seriesType,
seasonFolder,
tags,
@@ -148,18 +146,6 @@ function EditImportListModalContent(props) {
/>
-
- Language Profile
-
-
-
-
Series Type
@@ -279,7 +265,6 @@ EditImportListModalContent.propTypes = {
isTesting: PropTypes.bool.isRequired,
saveError: PropTypes.object,
item: PropTypes.object.isRequired,
- showLanguageProfile: PropTypes.bool.isRequired,
onInputChange: PropTypes.func.isRequired,
onFieldChange: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired,
diff --git a/frontend/src/Settings/ImportLists/ImportLists/EditImportListModalContentConnector.js b/frontend/src/Settings/ImportLists/ImportLists/EditImportListModalContentConnector.js
index 17981a1e4..3a7ad8b1f 100644
--- a/frontend/src/Settings/ImportLists/ImportLists/EditImportListModalContentConnector.js
+++ b/frontend/src/Settings/ImportLists/ImportLists/EditImportListModalContentConnector.js
@@ -9,12 +9,10 @@ import EditImportListModalContent from './EditImportListModalContent';
function createMapStateToProps() {
return createSelector(
(state) => state.settings.advancedSettings,
- (state) => state.settings.languageProfiles,
createProviderSettingsSelector('importLists'),
- (advancedSettings, languageProfiles, importList) => {
+ (advancedSettings, importList) => {
return {
advancedSettings,
- showLanguageProfile: languageProfiles.items.length > 1,
...importList
};
}
diff --git a/frontend/src/Settings/Profiles/Language/EditLanguageProfileModal.js b/frontend/src/Settings/Profiles/Language/EditLanguageProfileModal.js
deleted file mode 100644
index 8968f2b4b..000000000
--- a/frontend/src/Settings/Profiles/Language/EditLanguageProfileModal.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import PropTypes from 'prop-types';
-import React from 'react';
-import Modal from 'Components/Modal/Modal';
-import { sizes } from 'Helpers/Props';
-import EditLanguageProfileModalContentConnector from './EditLanguageProfileModalContentConnector';
-
-function EditLanguageProfileModal({ isOpen, onModalClose, ...otherProps }) {
- return (
-
-
-
- );
-}
-
-EditLanguageProfileModal.propTypes = {
- isOpen: PropTypes.bool.isRequired,
- onModalClose: PropTypes.func.isRequired
-};
-
-export default EditLanguageProfileModal;
diff --git a/frontend/src/Settings/Profiles/Language/EditLanguageProfileModalConnector.js b/frontend/src/Settings/Profiles/Language/EditLanguageProfileModalConnector.js
deleted file mode 100644
index 5443a9062..000000000
--- a/frontend/src/Settings/Profiles/Language/EditLanguageProfileModalConnector.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import PropTypes from 'prop-types';
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { clearPendingChanges } from 'Store/Actions/baseActions';
-import EditLanguageProfileModal from './EditLanguageProfileModal';
-
-function mapStateToProps() {
- return {};
-}
-
-const mapDispatchToProps = {
- clearPendingChanges
-};
-
-class EditLanguageProfileModalConnector extends Component {
-
- //
- // Listeners
-
- onModalClose = () => {
- this.props.clearPendingChanges({ section: 'settings.languageProfiles' });
- this.props.onModalClose();
- };
-
- //
- // Render
-
- render() {
- return (
-
- );
- }
-}
-
-EditLanguageProfileModalConnector.propTypes = {
- onModalClose: PropTypes.func.isRequired,
- clearPendingChanges: PropTypes.func.isRequired
-};
-
-export default connect(mapStateToProps, mapDispatchToProps)(EditLanguageProfileModalConnector);
diff --git a/frontend/src/Settings/Profiles/Language/EditLanguageProfileModalContent.css b/frontend/src/Settings/Profiles/Language/EditLanguageProfileModalContent.css
deleted file mode 100644
index 74dd1c8b7..000000000
--- a/frontend/src/Settings/Profiles/Language/EditLanguageProfileModalContent.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.deleteButtonContainer {
- margin-right: auto;
-}
diff --git a/frontend/src/Settings/Profiles/Language/EditLanguageProfileModalContent.js b/frontend/src/Settings/Profiles/Language/EditLanguageProfileModalContent.js
deleted file mode 100644
index e4360beba..000000000
--- a/frontend/src/Settings/Profiles/Language/EditLanguageProfileModalContent.js
+++ /dev/null
@@ -1,165 +0,0 @@
-import PropTypes from 'prop-types';
-import React from 'react';
-import Form from 'Components/Form/Form';
-import FormGroup from 'Components/Form/FormGroup';
-import FormInputGroup from 'Components/Form/FormInputGroup';
-import FormLabel from 'Components/Form/FormLabel';
-import Button from 'Components/Link/Button';
-import SpinnerErrorButton from 'Components/Link/SpinnerErrorButton';
-import LoadingIndicator from 'Components/Loading/LoadingIndicator';
-import ModalBody from 'Components/Modal/ModalBody';
-import ModalContent from 'Components/Modal/ModalContent';
-import ModalFooter from 'Components/Modal/ModalFooter';
-import ModalHeader from 'Components/Modal/ModalHeader';
-import { inputTypes, kinds } from 'Helpers/Props';
-import LanguageProfileItems from './LanguageProfileItems';
-import styles from './EditLanguageProfileModalContent.css';
-
-function EditLanguageProfileModalContent(props) {
- const {
- isFetching,
- error,
- isSaving,
- saveError,
- languages,
- item,
- isInUse,
- onInputChange,
- onCutoffChange,
- onSavePress,
- onModalClose,
- onDeleteLanguageProfilePress,
- ...otherProps
- } = props;
-
- const {
- id,
- name,
- upgradeAllowed,
- cutoff,
- languages: itemLanguages
- } = item;
-
- return (
-
-
- {id ? 'Edit Language Profile' : 'Add Language Profile'}
-
-
-
- {
- isFetching &&
-
- }
-
- {
- !isFetching && !!error &&
- Unable to add a new language profile, please try again.
- }
-
- {
- !isFetching && !error &&
-
- }
-
-
- {
- id &&
-
-
-
- }
-
-
-
-
- Save
-
-
-
- );
-}
-
-EditLanguageProfileModalContent.propTypes = {
- isFetching: PropTypes.bool.isRequired,
- error: PropTypes.object,
- isSaving: PropTypes.bool.isRequired,
- saveError: PropTypes.object,
- languages: PropTypes.arrayOf(PropTypes.object).isRequired,
- item: PropTypes.object.isRequired,
- isInUse: PropTypes.bool.isRequired,
- onInputChange: PropTypes.func.isRequired,
- onCutoffChange: PropTypes.func.isRequired,
- onSavePress: PropTypes.func.isRequired,
- onModalClose: PropTypes.func.isRequired,
- onDeleteLanguageProfilePress: PropTypes.func
-};
-
-export default EditLanguageProfileModalContent;
diff --git a/frontend/src/Settings/Profiles/Language/EditLanguageProfileModalContentConnector.js b/frontend/src/Settings/Profiles/Language/EditLanguageProfileModalContentConnector.js
deleted file mode 100644
index 911546c07..000000000
--- a/frontend/src/Settings/Profiles/Language/EditLanguageProfileModalContentConnector.js
+++ /dev/null
@@ -1,189 +0,0 @@
-import _ from 'lodash';
-import PropTypes from 'prop-types';
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { createSelector } from 'reselect';
-import { fetchLanguageProfileSchema, saveLanguageProfile, setLanguageProfileValue } from 'Store/Actions/settingsActions';
-import createProfileInUseSelector from 'Store/Selectors/createProfileInUseSelector';
-import createProviderSettingsSelector from 'Store/Selectors/createProviderSettingsSelector';
-import EditLanguageProfileModalContent from './EditLanguageProfileModalContent';
-
-function createLanguagesSelector() {
- return createSelector(
- createProviderSettingsSelector('languageProfiles'),
- (languageProfile) => {
- const languages = languageProfile.item.languages;
- if (!languages || !languages.value) {
- return [];
- }
-
- return _.reduceRight(languages.value, (result, { allowed, language }) => {
- if (allowed) {
- result.push({
- key: language.id,
- value: language.name
- });
- }
-
- return result;
- }, []);
- }
- );
-}
-
-function createMapStateToProps() {
- return createSelector(
- createProviderSettingsSelector('languageProfiles'),
- createLanguagesSelector(),
- createProfileInUseSelector('languageProfileId'),
- (languageProfile, languages, isInUse) => {
- return {
- languages,
- ...languageProfile,
- isInUse
- };
- }
- );
-}
-
-const mapDispatchToProps = {
- fetchLanguageProfileSchema,
- setLanguageProfileValue,
- saveLanguageProfile
-};
-
-class EditLanguageProfileModalContentConnector extends Component {
-
- //
- // Lifecycle
-
- constructor(props, context) {
- super(props, context);
-
- this.state = {
- dragIndex: null,
- dropIndex: null
- };
- }
-
- componentDidMount() {
- if (!this.props.id && !this.props.isPopulated) {
- this.props.fetchLanguageProfileSchema();
- }
- }
-
- componentDidUpdate(prevProps, prevState) {
- if (prevProps.isSaving && !this.props.isSaving && !this.props.saveError) {
- this.props.onModalClose();
- }
- }
-
- //
- // Listeners
-
- onInputChange = ({ name, value }) => {
- this.props.setLanguageProfileValue({ name, value });
- };
-
- onCutoffChange = ({ name, value }) => {
- const id = parseInt(value);
- const item = _.find(this.props.item.languages.value, (i) => i.language.id === id);
-
- this.props.setLanguageProfileValue({ name, value: item.language });
- };
-
- onSavePress = () => {
- this.props.saveLanguageProfile({ id: this.props.id });
- };
-
- onLanguageProfileItemAllowedChange = (id, allowed) => {
- const languageProfile = _.cloneDeep(this.props.item);
-
- const item = _.find(languageProfile.languages.value, (i) => i.language.id === id);
- item.allowed = allowed;
-
- this.props.setLanguageProfileValue({
- name: 'languages',
- value: languageProfile.languages.value
- });
-
- const cutoff = languageProfile.cutoff.value;
-
- // If the cutoff isn't allowed anymore or there isn't a cutoff set one
- if (!cutoff || !_.find(languageProfile.languages.value, (i) => i.language.id === cutoff.id).allowed) {
- const firstAllowed = _.find(languageProfile.languages.value, { allowed: true });
-
- this.props.setLanguageProfileValue({ name: 'cutoff', value: firstAllowed ? firstAllowed.language : null });
- }
- };
-
- onLanguageProfileItemDragMove = (dragIndex, dropIndex) => {
- if (this.state.dragIndex !== dragIndex || this.state.dropIndex !== dropIndex) {
- this.setState({
- dragIndex,
- dropIndex
- });
- }
- };
-
- onLanguageProfileItemDragEnd = ({ id }, didDrop) => {
- const {
- dragIndex,
- dropIndex
- } = this.state;
-
- if (didDrop && dropIndex !== null) {
- const languageProfile = _.cloneDeep(this.props.item);
-
- const languages = languageProfile.languages.value.splice(dragIndex, 1);
- languageProfile.languages.value.splice(dropIndex, 0, languages[0]);
-
- this.props.setLanguageProfileValue({
- name: 'languages',
- value: languageProfile.languages.value
- });
- }
-
- this.setState({
- dragIndex: null,
- dropIndex: null
- });
- };
-
- //
- // Render
-
- render() {
- if (_.isEmpty(this.props.item.languages) && !this.props.isFetching) {
- return null;
- }
-
- return (
-
- );
- }
-}
-
-EditLanguageProfileModalContentConnector.propTypes = {
- id: PropTypes.number,
- isFetching: PropTypes.bool.isRequired,
- isPopulated: PropTypes.bool.isRequired,
- isSaving: PropTypes.bool.isRequired,
- saveError: PropTypes.object,
- item: PropTypes.object.isRequired,
- setLanguageProfileValue: PropTypes.func.isRequired,
- fetchLanguageProfileSchema: PropTypes.func.isRequired,
- saveLanguageProfile: PropTypes.func.isRequired,
- onModalClose: PropTypes.func.isRequired
-};
-
-export default connect(createMapStateToProps, mapDispatchToProps)(EditLanguageProfileModalContentConnector);
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfile.css b/frontend/src/Settings/Profiles/Language/LanguageProfile.css
deleted file mode 100644
index da85dc483..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfile.css
+++ /dev/null
@@ -1,31 +0,0 @@
-.languageProfile {
- composes: card from '~Components/Card.css';
-
- width: 300px;
-}
-
-.nameContainer {
- display: flex;
- justify-content: space-between;
-}
-
-.name {
- @add-mixin truncate;
-
- margin-bottom: 20px;
- font-weight: 300;
- font-size: 24px;
-}
-
-.cloneButton {
- composes: button from '~Components/Link/IconButton.css';
-
- height: 36px;
-}
-
-.languages {
- display: flex;
- flex-wrap: wrap;
- margin-top: 5px;
- pointer-events: all;
-}
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfile.js b/frontend/src/Settings/Profiles/Language/LanguageProfile.js
deleted file mode 100644
index b353d37f4..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfile.js
+++ /dev/null
@@ -1,147 +0,0 @@
-import PropTypes from 'prop-types';
-import React, { Component } from 'react';
-import Card from 'Components/Card';
-import Label from 'Components/Label';
-import IconButton from 'Components/Link/IconButton';
-import ConfirmModal from 'Components/Modal/ConfirmModal';
-import { icons, kinds } from 'Helpers/Props';
-import EditLanguageProfileModalConnector from './EditLanguageProfileModalConnector';
-import styles from './LanguageProfile.css';
-
-class LanguageProfile extends Component {
-
- //
- // Lifecycle
-
- constructor(props, context) {
- super(props, context);
-
- this.state = {
- isEditLanguageProfileModalOpen: false,
- isDeleteLanguageProfileModalOpen: false
- };
- }
-
- //
- // Listeners
-
- onEditLanguageProfilePress = () => {
- this.setState({ isEditLanguageProfileModalOpen: true });
- };
-
- onEditLanguageProfileModalClose = () => {
- this.setState({ isEditLanguageProfileModalOpen: false });
- };
-
- onDeleteLanguageProfilePress = () => {
- this.setState({
- isEditLanguageProfileModalOpen: false,
- isDeleteLanguageProfileModalOpen: true
- });
- };
-
- onDeleteLanguageProfileModalClose = () => {
- this.setState({ isDeleteLanguageProfileModalOpen: false });
- };
-
- onConfirmDeleteLanguageProfile = () => {
- this.props.onConfirmDeleteLanguageProfile(this.props.id);
- };
-
- onCloneLanguageProfilePress = () => {
- const {
- id,
- onCloneLanguageProfilePress
- } = this.props;
-
- onCloneLanguageProfilePress(id);
- };
-
- //
- // Render
-
- render() {
- const {
- id,
- name,
- upgradeAllowed,
- cutoff,
- languages,
- isDeleting
- } = this.props;
-
- return (
-
-
-
-
- {
- languages.map((item) => {
- if (!item.allowed) {
- return null;
- }
-
- const isCutoff = upgradeAllowed && item.language.id === cutoff.id;
-
- return (
-
- );
- })
- }
-
-
-
-
-
-
- );
- }
-}
-
-LanguageProfile.propTypes = {
- id: PropTypes.number.isRequired,
- name: PropTypes.string.isRequired,
- upgradeAllowed: PropTypes.bool.isRequired,
- cutoff: PropTypes.object.isRequired,
- languages: PropTypes.arrayOf(PropTypes.object).isRequired,
- isDeleting: PropTypes.bool.isRequired,
- onConfirmDeleteLanguageProfile: PropTypes.func.isRequired,
- onCloneLanguageProfilePress: PropTypes.func.isRequired
-};
-
-export default LanguageProfile;
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfileItem.css b/frontend/src/Settings/Profiles/Language/LanguageProfileItem.css
deleted file mode 100644
index 090f5f09d..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfileItem.css
+++ /dev/null
@@ -1,44 +0,0 @@
-.languageProfileItem {
- display: flex;
- align-items: stretch;
- width: 100%;
- border: 1px solid #aaa;
- border-radius: 4px;
- background: var(--inputBackgroundColor);
-}
-
-.checkContainer {
- position: relative;
- margin-right: 4px;
- margin-bottom: 7px;
- margin-left: 8px;
-}
-
-.languageName {
- display: flex;
- flex-grow: 1;
- margin-bottom: 0;
- margin-left: 2px;
- font-weight: normal;
- line-height: 36px;
- cursor: pointer;
-}
-
-.dragHandle {
- display: flex;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
- margin-left: auto;
- width: $dragHandleWidth;
- text-align: center;
- cursor: grab;
-}
-
-.dragIcon {
- top: 0;
-}
-
-.isDragging {
- opacity: 0.25;
-}
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfileItem.js b/frontend/src/Settings/Profiles/Language/LanguageProfileItem.js
deleted file mode 100644
index 750b81f20..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfileItem.js
+++ /dev/null
@@ -1,83 +0,0 @@
-import classNames from 'classnames';
-import PropTypes from 'prop-types';
-import React, { Component } from 'react';
-import CheckInput from 'Components/Form/CheckInput';
-import Icon from 'Components/Icon';
-import { icons } from 'Helpers/Props';
-import styles from './LanguageProfileItem.css';
-
-class LanguageProfileItem extends Component {
-
- //
- // Listeners
-
- onAllowedChange = ({ value }) => {
- const {
- languageId,
- onLanguageProfileItemAllowedChange
- } = this.props;
-
- onLanguageProfileItemAllowedChange(languageId, value);
- };
-
- //
- // Render
-
- render() {
- const {
- name,
- allowed,
- isDragging,
- connectDragSource
- } = this.props;
-
- return (
-
-
-
- {
- connectDragSource(
-
-
-
- )
- }
-
- );
- }
-}
-
-LanguageProfileItem.propTypes = {
- languageId: PropTypes.number.isRequired,
- name: PropTypes.string.isRequired,
- allowed: PropTypes.bool.isRequired,
- sortIndex: PropTypes.number.isRequired,
- isDragging: PropTypes.bool.isRequired,
- connectDragSource: PropTypes.func,
- onLanguageProfileItemAllowedChange: PropTypes.func
-};
-
-LanguageProfileItem.defaultProps = {
- // The drag preview will not connect the drag handle.
- connectDragSource: (node) => node
-};
-
-export default LanguageProfileItem;
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfileItemDragPreview.css b/frontend/src/Settings/Profiles/Language/LanguageProfileItemDragPreview.css
deleted file mode 100644
index b927d9bce..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfileItemDragPreview.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.dragPreview {
- width: 380px;
- opacity: 0.75;
-}
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfileItemDragPreview.js b/frontend/src/Settings/Profiles/Language/LanguageProfileItemDragPreview.js
deleted file mode 100644
index c18b012fe..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfileItemDragPreview.js
+++ /dev/null
@@ -1,88 +0,0 @@
-import PropTypes from 'prop-types';
-import React, { Component } from 'react';
-import { DragLayer } from 'react-dnd';
-import DragPreviewLayer from 'Components/DragPreviewLayer';
-import { QUALITY_PROFILE_ITEM } from 'Helpers/dragTypes';
-import dimensions from 'Styles/Variables/dimensions.js';
-import LanguageProfileItem from './LanguageProfileItem';
-import styles from './LanguageProfileItemDragPreview.css';
-
-const formGroupSmallWidth = parseInt(dimensions.formGroupSmallWidth);
-const formLabelLargeWidth = parseInt(dimensions.formLabelLargeWidth);
-const formLabelRightMarginWidth = parseInt(dimensions.formLabelRightMarginWidth);
-const dragHandleWidth = parseInt(dimensions.dragHandleWidth);
-
-function collectDragLayer(monitor) {
- return {
- item: monitor.getItem(),
- itemType: monitor.getItemType(),
- currentOffset: monitor.getSourceClientOffset()
- };
-}
-
-class LanguageProfileItemDragPreview extends Component {
-
- //
- // Render
-
- render() {
- const {
- item,
- itemType,
- currentOffset
- } = this.props;
-
- if (!currentOffset || itemType !== QUALITY_PROFILE_ITEM) {
- return null;
- }
-
- // The offset is shifted because the drag handle is on the right edge of the
- // list item and the preview is wider than the drag handle.
-
- const { x, y } = currentOffset;
- const handleOffset = formGroupSmallWidth - formLabelLargeWidth - formLabelRightMarginWidth - dragHandleWidth;
- const transform = `translate3d(${x - handleOffset}px, ${y}px, 0)`;
-
- const style = {
- position: 'absolute',
- WebkitTransform: transform,
- msTransform: transform,
- transform
- };
-
- const {
- languageId,
- name,
- allowed,
- sortIndex
- } = item;
-
- return (
-
-
-
-
-
- );
- }
-}
-
-LanguageProfileItemDragPreview.propTypes = {
- item: PropTypes.object,
- itemType: PropTypes.string,
- currentOffset: PropTypes.shape({
- x: PropTypes.number.isRequired,
- y: PropTypes.number.isRequired
- })
-};
-
-export default DragLayer(collectDragLayer)(LanguageProfileItemDragPreview);
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfileItemDragSource.css b/frontend/src/Settings/Profiles/Language/LanguageProfileItemDragSource.css
deleted file mode 100644
index f59379129..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfileItemDragSource.css
+++ /dev/null
@@ -1,18 +0,0 @@
-.languageProfileItemDragSource {
- padding: 4px 0;
-}
-
-.languageProfileItemPlaceholder {
- width: 100%;
- height: 36px;
- border: 1px dotted #aaa;
- border-radius: 4px;
-}
-
-.languageProfileItemPlaceholderBefore {
- margin-bottom: 8px;
-}
-
-.languageProfileItemPlaceholderAfter {
- margin-top: 8px;
-}
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfileItemDragSource.js b/frontend/src/Settings/Profiles/Language/LanguageProfileItemDragSource.js
deleted file mode 100644
index 1c5d3e061..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfileItemDragSource.js
+++ /dev/null
@@ -1,157 +0,0 @@
-import classNames from 'classnames';
-import PropTypes from 'prop-types';
-import React, { Component } from 'react';
-import { DragSource, DropTarget } from 'react-dnd';
-import { findDOMNode } from 'react-dom';
-import { QUALITY_PROFILE_ITEM } from 'Helpers/dragTypes';
-import LanguageProfileItem from './LanguageProfileItem';
-import styles from './LanguageProfileItemDragSource.css';
-
-const languageProfileItemDragSource = {
- beginDrag({ languageId, name, allowed, sortIndex }) {
- return {
- languageId,
- name,
- allowed,
- sortIndex
- };
- },
-
- endDrag(props, monitor, component) {
- props.onLanguageProfileItemDragEnd(monitor.getItem(), monitor.didDrop());
- }
-};
-
-const languageProfileItemDropTarget = {
- hover(props, monitor, component) {
- const dragIndex = monitor.getItem().sortIndex;
- const hoverIndex = props.sortIndex;
-
- const hoverBoundingRect = findDOMNode(component).getBoundingClientRect();
- const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
- const clientOffset = monitor.getClientOffset();
- const hoverClientY = clientOffset.y - hoverBoundingRect.top;
-
- // Moving up, only trigger if drag position is above 50%
- if (dragIndex < hoverIndex && hoverClientY > hoverMiddleY) {
- return;
- }
-
- // Moving down, only trigger if drag position is below 50%
- if (dragIndex > hoverIndex && hoverClientY < hoverMiddleY) {
- return;
- }
-
- props.onLanguageProfileItemDragMove(dragIndex, hoverIndex);
- }
-};
-
-function collectDragSource(connect, monitor) {
- return {
- connectDragSource: connect.dragSource(),
- isDragging: monitor.isDragging()
- };
-}
-
-function collectDropTarget(connect, monitor) {
- return {
- connectDropTarget: connect.dropTarget(),
- isOver: monitor.isOver()
- };
-}
-
-class LanguageProfileItemDragSource extends Component {
-
- //
- // Render
-
- render() {
- const {
- languageId,
- name,
- allowed,
- sortIndex,
- isDragging,
- isDraggingUp,
- isDraggingDown,
- isOver,
- connectDragSource,
- connectDropTarget,
- onLanguageProfileItemAllowedChange
- } = this.props;
-
- const isBefore = !isDragging && isDraggingUp && isOver;
- const isAfter = !isDragging && isDraggingDown && isOver;
-
- // if (isDragging && !isOver) {
- // return null;
- // }
-
- return connectDropTarget(
-
- {
- isBefore &&
-
- }
-
-
-
- {
- isAfter &&
-
- }
-
- );
- }
-}
-
-LanguageProfileItemDragSource.propTypes = {
- languageId: PropTypes.number.isRequired,
- name: PropTypes.string.isRequired,
- allowed: PropTypes.bool.isRequired,
- sortIndex: PropTypes.number.isRequired,
- isDragging: PropTypes.bool,
- isDraggingUp: PropTypes.bool,
- isDraggingDown: PropTypes.bool,
- isOver: PropTypes.bool,
- connectDragSource: PropTypes.func,
- connectDropTarget: PropTypes.func,
- onLanguageProfileItemAllowedChange: PropTypes.func.isRequired,
- onLanguageProfileItemDragMove: PropTypes.func.isRequired,
- onLanguageProfileItemDragEnd: PropTypes.func.isRequired
-};
-
-export default DropTarget(
- QUALITY_PROFILE_ITEM,
- languageProfileItemDropTarget,
- collectDropTarget
-)(DragSource(
- QUALITY_PROFILE_ITEM,
- languageProfileItemDragSource,
- collectDragSource
-)(LanguageProfileItemDragSource));
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfileItems.css b/frontend/src/Settings/Profiles/Language/LanguageProfileItems.css
deleted file mode 100644
index 48b30f326..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfileItems.css
+++ /dev/null
@@ -1,6 +0,0 @@
-.languages {
- margin-top: 10px;
- /* TODO: This should consider the number of languages in the list */
- min-height: 550px;
- user-select: none;
-}
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfileItems.js b/frontend/src/Settings/Profiles/Language/LanguageProfileItems.js
deleted file mode 100644
index c8e1568d1..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfileItems.js
+++ /dev/null
@@ -1,103 +0,0 @@
-import PropTypes from 'prop-types';
-import React, { Component } from 'react';
-import FormGroup from 'Components/Form/FormGroup';
-import FormInputHelpText from 'Components/Form/FormInputHelpText';
-import FormLabel from 'Components/Form/FormLabel';
-import LanguageProfileItemDragPreview from './LanguageProfileItemDragPreview';
-import LanguageProfileItemDragSource from './LanguageProfileItemDragSource';
-import styles from './LanguageProfileItems.css';
-
-class LanguageProfileItems extends Component {
-
- //
- // Render
-
- render() {
- const {
- dragIndex,
- dropIndex,
- languageProfileItems,
- errors,
- warnings,
- ...otherProps
- } = this.props;
-
- const isDragging = dropIndex !== null;
- const isDraggingUp = isDragging && dropIndex > dragIndex;
- const isDraggingDown = isDragging && dropIndex < dragIndex;
-
- return (
-
- Languages
-
-
-
- {
- errors.map((error, index) => {
- return (
-
- );
- })
- }
-
- {
- warnings.map((warning, index) => {
- return (
-
- );
- })
- }
-
-
- {
- languageProfileItems.map(({ allowed, language }, index) => {
- return (
-
- );
- }).reverse()
- }
-
-
-
-
-
- );
- }
-}
-
-LanguageProfileItems.propTypes = {
- dragIndex: PropTypes.number,
- dropIndex: PropTypes.number,
- languageProfileItems: PropTypes.arrayOf(PropTypes.object).isRequired,
- errors: PropTypes.arrayOf(PropTypes.object),
- warnings: PropTypes.arrayOf(PropTypes.object)
-};
-
-LanguageProfileItems.defaultProps = {
- errors: [],
- warnings: []
-};
-
-export default LanguageProfileItems;
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfileNameConnector.js b/frontend/src/Settings/Profiles/Language/LanguageProfileNameConnector.js
deleted file mode 100644
index 61a7153b5..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfileNameConnector.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import PropTypes from 'prop-types';
-import React from 'react';
-import { connect } from 'react-redux';
-import { createSelector } from 'reselect';
-import createLanguageProfileSelector from 'Store/Selectors/createLanguageProfileSelector';
-
-function createMapStateToProps() {
- return createSelector(
- createLanguageProfileSelector(),
- (languageProfile) => {
- return {
- name: languageProfile.name
- };
- }
- );
-}
-
-function LanguageProfileNameConnector({ name, ...otherProps }) {
- return (
-
- {name}
-
- );
-}
-
-LanguageProfileNameConnector.propTypes = {
- languageProfileId: PropTypes.number.isRequired,
- name: PropTypes.string.isRequired
-};
-
-export default connect(createMapStateToProps)(LanguageProfileNameConnector);
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfiles.css b/frontend/src/Settings/Profiles/Language/LanguageProfiles.css
deleted file mode 100644
index 440adff4b..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfiles.css
+++ /dev/null
@@ -1,21 +0,0 @@
-.languageProfiles {
- display: flex;
- flex-wrap: wrap;
-}
-
-.addLanguageProfile {
- composes: languageProfile from '~./LanguageProfile.css';
-
- background-color: var(--cardAlternateBackgroundColor);
- color: var(--gray);
- text-align: center;
- font-size: 45px;
-}
-
-.center {
- display: inline-block;
- padding: 5px 20px 0;
- border: 1px solid var(--borderColor);
- border-radius: 4px;
- background-color: var(--cardCenterBackgroundColor);
-}
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfiles.js b/frontend/src/Settings/Profiles/Language/LanguageProfiles.js
deleted file mode 100644
index aef957049..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfiles.js
+++ /dev/null
@@ -1,107 +0,0 @@
-import PropTypes from 'prop-types';
-import React, { Component } from 'react';
-import Card from 'Components/Card';
-import FieldSet from 'Components/FieldSet';
-import Icon from 'Components/Icon';
-import PageSectionContent from 'Components/Page/PageSectionContent';
-import { icons } from 'Helpers/Props';
-import EditLanguageProfileModalConnector from './EditLanguageProfileModalConnector';
-import LanguageProfile from './LanguageProfile';
-import styles from './LanguageProfiles.css';
-
-class LanguageProfiles extends Component {
-
- //
- // Lifecycle
-
- constructor(props, context) {
- super(props, context);
-
- this.state = {
- isLanguageProfileModalOpen: false
- };
- }
-
- //
- // Listeners
-
- onCloneLanguageProfilePress = (id) => {
- this.props.onCloneLanguageProfilePress(id);
- this.setState({ isLanguageProfileModalOpen: true });
- };
-
- onEditLanguageProfilePress = () => {
- this.setState({ isLanguageProfileModalOpen: true });
- };
-
- onModalClose = () => {
- this.setState({ isLanguageProfileModalOpen: false });
- };
-
- //
- // Render
-
- render() {
- const {
- items,
- isDeleting,
- onConfirmDeleteLanguageProfile,
- onCloneLanguageProfilePress,
- ...otherProps
- } = this.props;
-
- return (
-
- );
- }
-}
-
-LanguageProfiles.propTypes = {
- advancedSettings: PropTypes.bool.isRequired,
- isFetching: PropTypes.bool.isRequired,
- error: PropTypes.object,
- items: PropTypes.arrayOf(PropTypes.object).isRequired,
- isDeleting: PropTypes.bool.isRequired,
- onConfirmDeleteLanguageProfile: PropTypes.func.isRequired,
- onCloneLanguageProfilePress: PropTypes.func.isRequired
-};
-
-export default LanguageProfiles;
diff --git a/frontend/src/Settings/Profiles/Language/LanguageProfilesConnector.js b/frontend/src/Settings/Profiles/Language/LanguageProfilesConnector.js
deleted file mode 100644
index 0b9d61d3f..000000000
--- a/frontend/src/Settings/Profiles/Language/LanguageProfilesConnector.js
+++ /dev/null
@@ -1,69 +0,0 @@
-import PropTypes from 'prop-types';
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { createSelector } from 'reselect';
-import { cloneLanguageProfile, deleteLanguageProfile, fetchLanguageProfiles } from 'Store/Actions/settingsActions';
-import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
-import sortByName from 'Utilities/Array/sortByName';
-import LanguageProfiles from './LanguageProfiles';
-
-function createMapStateToProps() {
- return createSelector(
- (state) => state.settings.advancedSettings,
- createSortedSectionSelector('settings.languageProfiles', sortByName),
- (advancedSettings, languageProfiles) => {
- return {
- advancedSettings,
- ...languageProfiles
- };
- }
- );
-}
-
-const mapDispatchToProps = {
- dispatchFetchLanguageProfiles: fetchLanguageProfiles,
- dispatchDeleteLanguageProfile: deleteLanguageProfile,
- dispatchCloneLanguageProfile: cloneLanguageProfile
-};
-
-class LanguageProfilesConnector extends Component {
-
- //
- // Lifecycle
-
- componentDidMount() {
- this.props.dispatchFetchLanguageProfiles();
- }
-
- //
- // Listeners
-
- onConfirmDeleteLanguageProfile = (id) => {
- this.props.dispatchDeleteLanguageProfile({ id });
- };
-
- onCloneLanguageProfilePress = (id) => {
- this.props.dispatchCloneLanguageProfile({ id });
- };
-
- //
- // Render
-
- render() {
- return (
-
- );
- }
-}
-
-LanguageProfilesConnector.propTypes = {
- dispatchFetchLanguageProfiles: PropTypes.func.isRequired,
- dispatchDeleteLanguageProfile: PropTypes.func.isRequired,
- dispatchCloneLanguageProfile: PropTypes.func.isRequired
-};
-
-export default connect(createMapStateToProps, mapDispatchToProps)(LanguageProfilesConnector);
diff --git a/frontend/src/Settings/Profiles/Profiles.js b/frontend/src/Settings/Profiles/Profiles.js
index 7196d9f0d..642466aaa 100644
--- a/frontend/src/Settings/Profiles/Profiles.js
+++ b/frontend/src/Settings/Profiles/Profiles.js
@@ -5,7 +5,6 @@ import PageContent from 'Components/Page/PageContent';
import PageContentBody from 'Components/Page/PageContentBody';
import SettingsToolbarConnector from 'Settings/SettingsToolbarConnector';
import DelayProfilesConnector from './Delay/DelayProfilesConnector';
-import LanguageProfilesConnector from './Language/LanguageProfilesConnector';
import QualityProfilesConnector from './Quality/QualityProfilesConnector';
import ReleaseProfilesConnector from './Release/ReleaseProfilesConnector';
@@ -25,7 +24,6 @@ class Profiles extends Component {
-
diff --git a/frontend/src/Settings/UI/UISettingsConnector.js b/frontend/src/Settings/UI/UISettingsConnector.js
index 7b7846415..66d03d226 100644
--- a/frontend/src/Settings/UI/UISettingsConnector.js
+++ b/frontend/src/Settings/UI/UISettingsConnector.js
@@ -3,7 +3,7 @@ import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { clearPendingChanges } from 'Store/Actions/baseActions';
-import { fetchLanguageProfileSchema, fetchUISettings, saveUISettings, setUISettingsValue } from 'Store/Actions/settingsActions';
+import { fetchUISettings, saveUISettings, setUISettingsValue } from 'Store/Actions/settingsActions';
import createLanguagesSelector from 'Store/Selectors/createLanguagesSelector';
import createSettingsSectionSelector from 'Store/Selectors/createSettingsSectionSelector';
import UISettings from './UISettings';
@@ -20,11 +20,11 @@ function createFilteredLanguagesSelector() {
}
const newItems = languages.items
- .filter((lang) => !FILTER_LANGUAGES.includes(lang.language.name))
+ .filter((lang) => !FILTER_LANGUAGES.includes(lang.name))
.map((item) => {
return {
- key: item.language.id,
- value: item.language.name
+ key: item.id,
+ value: item.name
};
});
@@ -58,8 +58,7 @@ const mapDispatchToProps = {
dispatchSetUISettingsValue: setUISettingsValue,
dispatchSaveUISettings: saveUISettings,
dispatchFetchUISettings: fetchUISettings,
- dispatchClearPendingChanges: clearPendingChanges,
- dispatchFetchLanguageProfileSchema: fetchLanguageProfileSchema
+ dispatchClearPendingChanges: clearPendingChanges
};
class UISettingsConnector extends Component {
@@ -69,16 +68,10 @@ class UISettingsConnector extends Component {
componentDidMount() {
const {
- isLanguagesPopulated,
- dispatchFetchUISettings,
- dispatchFetchLanguageProfileSchema
+ dispatchFetchUISettings
} = this.props;
dispatchFetchUISettings();
-
- if (!isLanguagesPopulated) {
- dispatchFetchLanguageProfileSchema();
- }
}
componentWillUnmount() {
@@ -115,8 +108,7 @@ UISettingsConnector.propTypes = {
dispatchSetUISettingsValue: PropTypes.func.isRequired,
dispatchSaveUISettings: PropTypes.func.isRequired,
dispatchFetchUISettings: PropTypes.func.isRequired,
- dispatchClearPendingChanges: PropTypes.func.isRequired,
- dispatchFetchLanguageProfileSchema: PropTypes.func.isRequired
+ dispatchClearPendingChanges: PropTypes.func.isRequired
};
export default connect(createMapStateToProps, mapDispatchToProps)(UISettingsConnector);
diff --git a/frontend/src/Store/Actions/Settings/languageProfiles.js b/frontend/src/Store/Actions/Settings/languageProfiles.js
deleted file mode 100644
index b407f1089..000000000
--- a/frontend/src/Store/Actions/Settings/languageProfiles.js
+++ /dev/null
@@ -1,97 +0,0 @@
-import { createAction } from 'redux-actions';
-import createFetchHandler from 'Store/Actions/Creators/createFetchHandler';
-import createFetchSchemaHandler from 'Store/Actions/Creators/createFetchSchemaHandler';
-import createRemoveItemHandler from 'Store/Actions/Creators/createRemoveItemHandler';
-import createSaveProviderHandler from 'Store/Actions/Creators/createSaveProviderHandler';
-import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
-import { createThunk } from 'Store/thunks';
-import getSectionState from 'Utilities/State/getSectionState';
-import updateSectionState from 'Utilities/State/updateSectionState';
-
-//
-// Variables
-
-const section = 'settings.languageProfiles';
-
-//
-// Actions Types
-
-export const FETCH_LANGUAGE_PROFILES = 'settings/languageProfiles/fetchLanguageProfiles';
-export const FETCH_LANGUAGE_PROFILE_SCHEMA = 'settings/languageProfiles/fetchLanguageProfileSchema';
-export const SAVE_LANGUAGE_PROFILE = 'settings/languageProfiles/saveLanguageProfile';
-export const DELETE_LANGUAGE_PROFILE = 'settings/languageProfiles/deleteLanguageProfile';
-export const SET_LANGUAGE_PROFILE_VALUE = 'settings/languageProfiles/setLanguageProfileValue';
-export const CLONE_LANGUAGE_PROFILE = 'settings/languageProfiles/cloneLanguageProfile';
-
-//
-// Action Creators
-
-export const fetchLanguageProfiles = createThunk(FETCH_LANGUAGE_PROFILES);
-export const fetchLanguageProfileSchema = createThunk(FETCH_LANGUAGE_PROFILE_SCHEMA);
-export const saveLanguageProfile = createThunk(SAVE_LANGUAGE_PROFILE);
-export const deleteLanguageProfile = createThunk(DELETE_LANGUAGE_PROFILE);
-
-export const setLanguageProfileValue = createAction(SET_LANGUAGE_PROFILE_VALUE, (payload) => {
- return {
- section,
- ...payload
- };
-});
-
-export const cloneLanguageProfile = createAction(CLONE_LANGUAGE_PROFILE);
-
-//
-// Details
-
-export default {
-
- //
- // State
-
- defaultState: {
- isFetching: false,
- isPopulated: false,
- error: null,
- isDeleting: false,
- deleteError: null,
- isSchemaFetching: false,
- isSchemaPopulated: false,
- schemaError: null,
- schema: {},
- isSaving: false,
- saveError: null,
- items: [],
- pendingChanges: {}
- },
-
- //
- // Action Handlers
-
- actionHandlers: {
- [FETCH_LANGUAGE_PROFILES]: createFetchHandler(section, '/languageprofile'),
- [FETCH_LANGUAGE_PROFILE_SCHEMA]: createFetchSchemaHandler(section, '/languageprofile/schema'),
- [SAVE_LANGUAGE_PROFILE]: createSaveProviderHandler(section, '/languageprofile'),
- [DELETE_LANGUAGE_PROFILE]: createRemoveItemHandler(section, '/languageprofile')
- },
-
- //
- // Reducers
-
- reducers: {
- [SET_LANGUAGE_PROFILE_VALUE]: createSetSettingValueReducer(section),
-
- [CLONE_LANGUAGE_PROFILE]: function(state, { payload }) {
- const id = payload.id;
- const newState = getSectionState(state, section);
- const item = newState.items.find((i) => i.id === id);
- const pendingChanges = { ...item, id: 0 };
- delete pendingChanges.id;
-
- pendingChanges.name = `${pendingChanges.name} - Copy`;
- newState.pendingChanges = pendingChanges;
-
- return updateSectionState(state, section, newState);
- }
- }
-
-};
diff --git a/frontend/src/Store/Actions/Settings/languages.js b/frontend/src/Store/Actions/Settings/languages.js
new file mode 100644
index 000000000..a0b62fc49
--- /dev/null
+++ b/frontend/src/Store/Actions/Settings/languages.js
@@ -0,0 +1,48 @@
+import createFetchHandler from 'Store/Actions/Creators/createFetchHandler';
+import { createThunk } from 'Store/thunks';
+
+//
+// Variables
+
+const section = 'settings.languages';
+
+//
+// Actions Types
+
+export const FETCH_LANGUAGES = 'settings/languages/fetchLanguages';
+
+//
+// Action Creators
+
+export const fetchLanguages = createThunk(FETCH_LANGUAGES);
+
+//
+// Details
+
+export default {
+
+ //
+ // State
+
+ defaultState: {
+ isFetching: false,
+ isPopulated: false,
+ error: null,
+ items: []
+ },
+
+ //
+ // Action Handlers
+
+ actionHandlers: {
+ [FETCH_LANGUAGES]: createFetchHandler(section, '/language')
+ },
+
+ //
+ // Reducers
+
+ reducers: {
+
+ }
+
+};
diff --git a/frontend/src/Store/Actions/addSeriesActions.js b/frontend/src/Store/Actions/addSeriesActions.js
index f07ba8fdf..d0399b22b 100644
--- a/frontend/src/Store/Actions/addSeriesActions.js
+++ b/frontend/src/Store/Actions/addSeriesActions.js
@@ -34,7 +34,6 @@ export const defaultState = {
rootFolderPath: '',
monitor: monitorOptions[0].key,
qualityProfileId: 0,
- languageProfileId: 0,
seriesType: seriesTypes.STANDARD,
seasonFolder: true,
searchForMissingEpisodes: false,
diff --git a/frontend/src/Store/Actions/blocklistActions.js b/frontend/src/Store/Actions/blocklistActions.js
index 5be0797cc..95c30d712 100644
--- a/frontend/src/Store/Actions/blocklistActions.js
+++ b/frontend/src/Store/Actions/blocklistActions.js
@@ -43,8 +43,8 @@ export const defaultState = {
isVisible: true
},
{
- name: 'language',
- label: 'Language',
+ name: 'languages',
+ label: 'Languages',
isVisible: false
},
{
diff --git a/frontend/src/Store/Actions/episodeActions.js b/frontend/src/Store/Actions/episodeActions.js
index d2b77a03a..0e6113247 100644
--- a/frontend/src/Store/Actions/episodeActions.js
+++ b/frontend/src/Store/Actions/episodeActions.js
@@ -60,8 +60,8 @@ export const defaultState = {
isVisible: true
},
{
- name: 'language',
- label: 'Language',
+ name: 'languages',
+ label: 'Languages',
isVisible: false
},
{
diff --git a/frontend/src/Store/Actions/episodeFileActions.js b/frontend/src/Store/Actions/episodeFileActions.js
index 0ce3d9762..7f0748967 100644
--- a/frontend/src/Store/Actions/episodeFileActions.js
+++ b/frontend/src/Store/Actions/episodeFileActions.js
@@ -162,7 +162,7 @@ export const actionHandlers = handleThunks({
props.qualityCutoffNotMet = episodeFile.qualityCutoffNotMet;
props.languageCutoffNotMet = episodeFile.languageCutoffNotMet;
- props.language = file.language;
+ props.languages = file.languages;
props.quality = file.quality;
props.releaseGroup = file.releaseGroup;
diff --git a/frontend/src/Store/Actions/historyActions.js b/frontend/src/Store/Actions/historyActions.js
index 85fe95208..5b6ef8851 100644
--- a/frontend/src/Store/Actions/historyActions.js
+++ b/frontend/src/Store/Actions/historyActions.js
@@ -52,8 +52,8 @@ export const defaultState = {
isVisible: true
},
{
- name: 'language',
- label: 'Language',
+ name: 'languages',
+ label: 'Languages',
isVisible: false
},
{
diff --git a/frontend/src/Store/Actions/interactiveImportActions.js b/frontend/src/Store/Actions/interactiveImportActions.js
index c55e891f8..a1eccef7d 100644
--- a/frontend/src/Store/Actions/interactiveImportActions.js
+++ b/frontend/src/Store/Actions/interactiveImportActions.js
@@ -177,7 +177,7 @@ export const actionHandlers = handleThunks({
seasonNumber: item.seasonNumber,
episodeIds: (item.episodes || []).map((e) => e.id),
quality: item.quality,
- language: item.language,
+ languages: item.languages,
releaseGroup: item.releaseGroup,
downloadId: item.downloadId
};
diff --git a/frontend/src/Store/Actions/queueActions.js b/frontend/src/Store/Actions/queueActions.js
index d5f89d2bc..aa351d152 100644
--- a/frontend/src/Store/Actions/queueActions.js
+++ b/frontend/src/Store/Actions/queueActions.js
@@ -87,8 +87,8 @@ export const defaultState = {
isVisible: false
},
{
- name: 'language',
- label: 'Language',
+ name: 'languages',
+ label: 'Languages',
isSortable: true,
isVisible: false
},
diff --git a/frontend/src/Store/Actions/seriesActions.js b/frontend/src/Store/Actions/seriesActions.js
index 813f65572..0f7a3ff33 100644
--- a/frontend/src/Store/Actions/seriesActions.js
+++ b/frontend/src/Store/Actions/seriesActions.js
@@ -204,12 +204,6 @@ export const filterBuilderProps = [
type: filterBuilderTypes.EXACT,
valueType: filterBuilderValueTypes.QUALITY_PROFILE
},
- {
- name: 'languageProfileId',
- label: 'Language Profile',
- type: filterBuilderTypes.EXACT,
- valueType: filterBuilderValueTypes.LANGUAGE_PROFILE
- },
{
name: 'nextAiring',
label: 'Next Airing',
diff --git a/frontend/src/Store/Actions/seriesEditorActions.js b/frontend/src/Store/Actions/seriesEditorActions.js
index ba976edd0..cfcd5e626 100644
--- a/frontend/src/Store/Actions/seriesEditorActions.js
+++ b/frontend/src/Store/Actions/seriesEditorActions.js
@@ -53,12 +53,6 @@ export const defaultState = {
isSortable: true,
isVisible: true
},
- {
- name: 'languageProfileId',
- label: 'Language Profile',
- isSortable: true,
- isVisible: true
- },
{
name: 'seriesType',
label: 'Type',
diff --git a/frontend/src/Store/Actions/seriesIndexActions.js b/frontend/src/Store/Actions/seriesIndexActions.js
index 711344d23..0e1c4d9e5 100644
--- a/frontend/src/Store/Actions/seriesIndexActions.js
+++ b/frontend/src/Store/Actions/seriesIndexActions.js
@@ -83,12 +83,6 @@ export const defaultState = {
isSortable: true,
isVisible: true
},
- {
- name: 'languageProfileId',
- label: 'Language Profile',
- isSortable: true,
- isVisible: false
- },
{
name: 'nextAiring',
label: 'Next Airing',
diff --git a/frontend/src/Store/Actions/settingsActions.js b/frontend/src/Store/Actions/settingsActions.js
index b33abfd69..54dbf1206 100644
--- a/frontend/src/Store/Actions/settingsActions.js
+++ b/frontend/src/Store/Actions/settingsActions.js
@@ -11,7 +11,7 @@ import importListExclusions from './Settings/importListExclusions';
import importLists from './Settings/importLists';
import indexerOptions from './Settings/indexerOptions';
import indexers from './Settings/indexers';
-import languageProfiles from './Settings/languageProfiles';
+import languages from './Settings/languages';
import mediaManagement from './Settings/mediaManagement';
import metadata from './Settings/metadata';
import naming from './Settings/naming';
@@ -33,7 +33,7 @@ export * from './Settings/importLists';
export * from './Settings/importListExclusions';
export * from './Settings/indexerOptions';
export * from './Settings/indexers';
-export * from './Settings/languageProfiles';
+export * from './Settings/languages';
export * from './Settings/mediaManagement';
export * from './Settings/metadata';
export * from './Settings/naming';
@@ -66,7 +66,7 @@ export const defaultState = {
importListExclusions: importListExclusions.defaultState,
indexerOptions: indexerOptions.defaultState,
indexers: indexers.defaultState,
- languageProfiles: languageProfiles.defaultState,
+ languages: languages.defaultState,
mediaManagement: mediaManagement.defaultState,
metadata: metadata.defaultState,
naming: naming.defaultState,
@@ -107,7 +107,7 @@ export const actionHandlers = handleThunks({
...importListExclusions.actionHandlers,
...indexerOptions.actionHandlers,
...indexers.actionHandlers,
- ...languageProfiles.actionHandlers,
+ ...languages.actionHandlers,
...mediaManagement.actionHandlers,
...metadata.actionHandlers,
...naming.actionHandlers,
@@ -139,7 +139,7 @@ export const reducers = createHandleActions({
...importListExclusions.reducers,
...indexerOptions.reducers,
...indexers.reducers,
- ...languageProfiles.reducers,
+ ...languages.reducers,
...mediaManagement.reducers,
...metadata.reducers,
...naming.reducers,
diff --git a/frontend/src/Store/Actions/wantedActions.js b/frontend/src/Store/Actions/wantedActions.js
index fae855f56..db0815c8c 100644
--- a/frontend/src/Store/Actions/wantedActions.js
+++ b/frontend/src/Store/Actions/wantedActions.js
@@ -122,8 +122,8 @@ export const defaultState = {
isVisible: true
},
{
- name: 'language',
- label: 'Language',
+ name: 'languages',
+ label: 'Languages',
isVisible: false
},
{
diff --git a/frontend/src/Store/Selectors/createLanguageProfileSelector.js b/frontend/src/Store/Selectors/createLanguageProfileSelector.js
deleted file mode 100644
index c32f85ada..000000000
--- a/frontend/src/Store/Selectors/createLanguageProfileSelector.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import { createSelector } from 'reselect';
-
-function createLanguageProfileSelector() {
- return createSelector(
- (state, { languageProfileId }) => languageProfileId,
- (state) => state.settings.languageProfiles.items,
- (languageProfileId, languageProfiles) => {
- return languageProfiles.find((profile) => {
- return profile.id === languageProfileId;
- });
- }
- );
-}
-
-export default createLanguageProfileSelector;
diff --git a/frontend/src/Store/Selectors/createLanguagesSelector.js b/frontend/src/Store/Selectors/createLanguagesSelector.js
index 53de7d696..47840933c 100644
--- a/frontend/src/Store/Selectors/createLanguagesSelector.js
+++ b/frontend/src/Store/Selectors/createLanguagesSelector.js
@@ -2,20 +2,23 @@ import { createSelector } from 'reselect';
function createLanguagesSelector() {
return createSelector(
- (state) => state.settings.languageProfiles,
- (languageProfiles) => {
+ (state) => state.settings.languages,
+ (languages) => {
const {
- isSchemaFetching: isFetching,
- isSchemaPopulated: isPopulated,
- schemaError: error,
- schema
- } = languageProfiles;
+ isFetching,
+ isPopulated,
+ error,
+ items
+ } = languages;
+
+ const filterItems = ['Any'];
+ const filteredLanguages = items.filter((lang) => !filterItems.includes(lang.name));
return {
isFetching,
isPopulated,
error,
- items: schema.languages ? [...schema.languages].reverse() : []
+ items: filteredLanguages
};
}
);
diff --git a/frontend/src/Store/Selectors/createSeriesLanguageProfileSelector.js b/frontend/src/Store/Selectors/createSeriesLanguageProfileSelector.js
deleted file mode 100644
index 94ebcc0ec..000000000
--- a/frontend/src/Store/Selectors/createSeriesLanguageProfileSelector.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import { createSelector } from 'reselect';
-import createSeriesSelector from './createSeriesSelector';
-
-function createSeriesLanguageProfileSelector() {
- return createSelector(
- (state) => state.settings.languageProfiles.items,
- createSeriesSelector(),
- (languageProfiles, series = {}) => {
- return languageProfiles.find((profile) => {
- return profile.id === series.languageProfileId;
- });
- }
- );
-}
-
-export default createSeriesLanguageProfileSelector;
diff --git a/frontend/src/Utilities/Series/getNewSeries.js b/frontend/src/Utilities/Series/getNewSeries.js
index 142819d38..6e4de0c74 100644
--- a/frontend/src/Utilities/Series/getNewSeries.js
+++ b/frontend/src/Utilities/Series/getNewSeries.js
@@ -4,7 +4,6 @@ function getNewSeries(series, payload) {
rootFolderPath,
monitor,
qualityProfileId,
- languageProfileId,
seriesType,
seasonFolder,
tags,
@@ -21,7 +20,6 @@ function getNewSeries(series, payload) {
series.addOptions = addOptions;
series.monitored = true;
series.qualityProfileId = qualityProfileId;
- series.languageProfileId = languageProfileId;
series.rootFolderPath = rootFolderPath;
series.seriesType = seriesType;
series.seasonFolder = seasonFolder;
diff --git a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.css b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.css
index d033cb221..55b33c37a 100644
--- a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.css
+++ b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.css
@@ -1,5 +1,5 @@
.episode,
-.language,
+.languages,
.status {
composes: cell from '~Components/Table/Cells/TableRowCell.css';
diff --git a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.js b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.js
index 277c4c329..7d98eaee3 100644
--- a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.js
+++ b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.js
@@ -106,11 +106,11 @@ function CutoffUnmetRow(props) {
);
}
- if (name === 'language') {
+ if (name === 'languages') {
return (
{ 1 },
Quality = new QualityModel(Quality.Bluray720p),
- Language = Core.Languages.Language.English,
+ Languages = new List { Language.English },
SourceTitle = "series.title.s01e01",
Date = DateTime.UtcNow
};
diff --git a/src/NzbDrone.Core.Test/Datastore/DatabaseRelationshipFixture.cs b/src/NzbDrone.Core.Test/Datastore/DatabaseRelationshipFixture.cs
index 4d540a032..4a1226e1d 100644
--- a/src/NzbDrone.Core.Test/Datastore/DatabaseRelationshipFixture.cs
+++ b/src/NzbDrone.Core.Test/Datastore/DatabaseRelationshipFixture.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System.Collections.Generic;
+using System.Linq;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
@@ -18,9 +19,8 @@ namespace NzbDrone.Core.Test.Datastore
public void one_to_one()
{
var episodeFile = Builder.CreateNew()
- .With(c => c.Language = Language.English)
+ .With(c => c.Languages = new List { Language.English })
.With(c => c.Quality = new QualityModel())
- .With(c => c.Language = Language.English)
.BuildNew();
Db.Insert(episodeFile);
@@ -61,7 +61,7 @@ namespace NzbDrone.Core.Test.Datastore
var quality = new QualityModel { Quality = Quality.Bluray720p, Revision = new Revision(version: 2) };
var history = Builder.CreateNew()
- .With(c => c.Language = Language.English)
+ .With(c => c.Languages = new List { Language.English })
.With(c => c.Id = 0)
.With(c => c.Quality = quality)
.Build();
@@ -78,7 +78,7 @@ namespace NzbDrone.Core.Test.Datastore
var history = Builder.CreateListOfSize(2)
.All()
.With(c => c.Id = 0)
- .With(c => c.Language = Language.English)
+ .With(c => c.Languages = new List { Language.English })
.Build().ToList();
history[0].Quality = new QualityModel(Quality.HDTV1080p, new Revision(version: 2));
diff --git a/src/NzbDrone.Core.Test/Datastore/Migration/161_fix_pending_releasesFixture.cs b/src/NzbDrone.Core.Test/Datastore/Migration/161_fix_pending_releasesFixture.cs
index a77097adb..aebca15ba 100644
--- a/src/NzbDrone.Core.Test/Datastore/Migration/161_fix_pending_releasesFixture.cs
+++ b/src/NzbDrone.Core.Test/Datastore/Migration/161_fix_pending_releasesFixture.cs
@@ -1,8 +1,11 @@
using System;
+using System.Collections.Generic;
using System.Linq;
using Dapper;
using FluentAssertions;
using NUnit.Framework;
+using NzbDrone.Core.Datastore;
+using NzbDrone.Core.Datastore.Converters;
using NzbDrone.Core.Datastore.Migration;
using NzbDrone.Core.Download.Pending;
using NzbDrone.Core.Languages;
@@ -18,6 +21,8 @@ namespace NzbDrone.Core.Test.Datastore.Migration
[Test]
public void should_fix_quality_for_pending_releases()
{
+ SqlMapper.AddTypeHandler(new EmbeddedDocumentConverter());
+
var db = WithDapperMigrationTestDb(c =>
{
c.Insert.IntoTable("PendingReleases").Row(new
@@ -77,9 +82,54 @@ namespace NzbDrone.Core.Test.Datastore.Migration
var json = db.Query("SELECT ParsedEpisodeInfo FROM PendingReleases").First();
- var pending = db.Query("SELECT ParsedEpisodeInfo FROM PendingReleases").First();
- pending.Quality.Quality.Should().Be(Quality.HDTV720p);
- pending.Language.Should().Be(Language.English);
+ var pending = db.Query("SELECT ParsedEpisodeInfo FROM PendingReleases").First();
+ pending.Quality.Quality.Should().Be(Quality.HDTV720p.Id);
+ pending.Language.Should().Be(Language.English.Id);
+ }
+
+ private class SeriesTitleInfo161
+ {
+ public string Title { get; set; }
+ public string TitleWithoutYear { get; set; }
+ public int Year { get; set; }
+ }
+
+ private class ParsedEpisodeInfo162
+ {
+ public string SeriesTitle { get; set; }
+ public SeriesTitleInfo161 SeriesTitleInfo { get; set; }
+ public QualityModel162 Quality { get; set; }
+ public int SeasonNumber { get; set; }
+ public List EpisodeNumbers { get; set; }
+ public List AbsoluteEpisodeNumbers { get; set; }
+ public List SpecialAbsoluteEpisodeNumbers { get; set; }
+ public int Language { get; set; }
+ public bool FullSeason { get; set; }
+ public bool IsPartialSeason { get; set; }
+ public bool IsMultiSeason { get; set; }
+ public bool IsSeasonExtra { get; set; }
+ public bool Speacial { get; set; }
+ public string ReleaseGroup { get; set; }
+ public string ReleaseHash { get; set; }
+ public int SeasonPart { get; set; }
+ public string ReleaseTokens { get; set; }
+ public bool IsDaily { get; set; }
+ public bool IsAbsoluteNumbering { get; set; }
+ public bool IsPossibleSpecialEpisode { get; set; }
+ public bool IsPossibleSceneSeasonSpecial { get; set; }
+ }
+
+ private class QualityModel162
+ {
+ public int Quality { get; set; }
+ public Revision162 Revision { get; set; }
+ }
+
+ private class Revision162
+ {
+ public int Version { get; set; }
+ public int Real { get; set; }
+ public bool IsRepack { get; set; }
}
}
}
diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/CutoffSpecificationFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/CutoffSpecificationFixture.cs
index df8828cd5..dbb0e77ca 100644
--- a/src/NzbDrone.Core.Test/DecisionEngineTests/CutoffSpecificationFixture.cs
+++ b/src/NzbDrone.Core.Test/DecisionEngineTests/CutoffSpecificationFixture.cs
@@ -13,7 +13,6 @@ using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Profiles;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.CustomFormats;
@@ -54,16 +53,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Console.WriteLine(profile.ToJson());
}
- private void GivenLanguageProfile(LanguageProfile profile)
- {
- _remoteMovie.Series.LanguageProfile = profile;
-
- Console.WriteLine(profile.ToJson());
- }
-
private void GivenFileQuality(QualityModel quality, Language language)
{
- _remoteMovie.Episodes.First().EpisodeFile = Builder.CreateNew().With(x => x.Quality = quality).With(x => x.Language = language).Build();
+ _remoteMovie.Episodes.First().EpisodeFile = Builder.CreateNew().With(x => x.Quality = quality).With(x => x.Languages = new List { language }).Build();
}
private void GivenNewQuality(QualityModel quality)
@@ -100,13 +92,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
UpgradeAllowed = true
});
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- });
-
GivenFileQuality(new QualityModel(Quality.DVD, new Revision(version: 2)), Language.English);
Subject.IsSatisfiedBy(_remoteMovie, null).Accepted.Should().BeTrue();
}
@@ -121,13 +106,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
UpgradeAllowed = true
});
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- });
-
GivenFileQuality(new QualityModel(Quality.HDTV720p, new Revision(version: 2)), Language.English);
Subject.IsSatisfiedBy(_remoteMovie, null).Accepted.Should().BeFalse();
}
@@ -142,13 +120,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
UpgradeAllowed = true
});
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- });
-
GivenFileQuality(new QualityModel(Quality.Bluray1080p, new Revision(version: 2)), Language.English);
Subject.IsSatisfiedBy(_remoteMovie, null).Accepted.Should().BeFalse();
}
@@ -163,13 +134,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
UpgradeAllowed = true
});
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- });
-
GivenFileQuality(new QualityModel(Quality.HDTV720p, new Revision(version: 1)), Language.English);
GivenNewQuality(new QualityModel(Quality.HDTV720p, new Revision(version: 2)));
Subject.IsSatisfiedBy(_remoteMovie, null).Accepted.Should().BeTrue();
@@ -185,40 +149,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
UpgradeAllowed = true
});
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- });
-
GivenFileQuality(new QualityModel(Quality.HDTV720p, new Revision(version: 2)), Language.English);
GivenNewQuality(new QualityModel(Quality.Bluray1080p, new Revision(version: 2)));
Subject.IsSatisfiedBy(_remoteMovie, null).Accepted.Should().BeFalse();
}
- [Test]
- public void should_return_true_if_quality_cutoff_is_met_and_quality_is_higher_but_language_is_not_met()
- {
- GivenProfile(new QualityProfile
- {
- Cutoff = Quality.HDTV720p.Id,
- Items = Qualities.QualityFixture.GetDefaultQualities(),
- UpgradeAllowed = true
- });
-
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(),
- Cutoff = Language.Spanish,
- UpgradeAllowed = true
- });
-
- GivenFileQuality(new QualityModel(Quality.HDTV720p, new Revision(version: 2)), Language.English);
- GivenNewQuality(new QualityModel(Quality.Bluray1080p, new Revision(version: 2)));
- Subject.IsSatisfiedBy(_remoteMovie, null).Accepted.Should().BeTrue();
- }
-
[Test]
public void should_return_false_if_quality_cutoff_is_met_and_quality_is_higher_but_language_is_met()
{
@@ -229,13 +164,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
UpgradeAllowed = true
});
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(),
- Cutoff = Language.Spanish,
- UpgradeAllowed = true
- });
-
GivenFileQuality(new QualityModel(Quality.HDTV720p, new Revision(version: 2)), Language.Spanish);
GivenNewQuality(new QualityModel(Quality.Bluray1080p, new Revision(version: 2)));
Subject.IsSatisfiedBy(_remoteMovie, null).Accepted.Should().BeFalse();
@@ -251,13 +179,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
UpgradeAllowed = true
});
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(),
- Cutoff = Language.Spanish,
- UpgradeAllowed = true
- });
-
GivenFileQuality(new QualityModel(Quality.HDTV720p, new Revision(version: 2)), Language.French);
GivenNewQuality(new QualityModel(Quality.Bluray1080p, new Revision(version: 2)));
Subject.IsSatisfiedBy(_remoteMovie, null).Accepted.Should().BeFalse();
@@ -273,13 +194,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
UpgradeAllowed = true
});
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(),
- Cutoff = Language.Spanish,
- UpgradeAllowed = true
- });
-
GivenFileQuality(new QualityModel(Quality.SDTV, new Revision(version: 2)), Language.French);
GivenNewQuality(new QualityModel(Quality.Bluray1080p, new Revision(version: 2)));
Subject.IsSatisfiedBy(_remoteMovie, null).Accepted.Should().BeTrue();
@@ -295,13 +209,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
UpgradeAllowed = true
});
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(),
- Cutoff = Language.Spanish,
- UpgradeAllowed = true
- });
-
GivenFileQuality(new QualityModel(Quality.SDTV, new Revision(version: 2)), Language.French);
Subject.IsSatisfiedBy(_remoteMovie, null).Accepted.Should().BeTrue();
}
@@ -318,13 +225,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
UpgradeAllowed = true
});
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- });
-
GivenFileQuality(new QualityModel(Quality.HDTV720p), Language.English);
GivenNewQuality(new QualityModel(Quality.Bluray1080p));
@@ -346,13 +246,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
UpgradeAllowed = true
});
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- });
-
GivenFileQuality(new QualityModel(Quality.WEBDL1080p, new Revision(version: 1)), Language.English);
GivenNewQuality(new QualityModel(Quality.WEBDL1080p, new Revision(version: 2)));
@@ -369,13 +262,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
UpgradeAllowed = false
});
- GivenLanguageProfile(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- });
-
GivenFileQuality(new QualityModel(Quality.WEBDL1080p), Language.English);
GivenNewQuality(new QualityModel(Quality.Bluray1080p));
diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/LanguageSpecificationFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/LanguageSpecificationFixture.cs
deleted file mode 100644
index 821a8842e..000000000
--- a/src/NzbDrone.Core.Test/DecisionEngineTests/LanguageSpecificationFixture.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-using FluentAssertions;
-using NUnit.Framework;
-using NzbDrone.Core.Datastore;
-using NzbDrone.Core.DecisionEngine.Specifications;
-using NzbDrone.Core.Languages;
-using NzbDrone.Core.Parser.Model;
-using NzbDrone.Core.Profiles.Languages;
-using NzbDrone.Core.Test.Framework;
-using NzbDrone.Core.Test.Languages;
-using NzbDrone.Core.Tv;
-
-namespace NzbDrone.Core.Test.DecisionEngineTests
-{
- [TestFixture]
-
- public class LanguageSpecificationFixture : CoreTest
- {
- private RemoteEpisode _remoteEpisode;
-
- [SetUp]
- public void Setup()
- {
- LanguageProfile profile = new LazyLoaded(new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English, Language.Spanish),
- Cutoff = Language.Spanish
- });
-
- _remoteEpisode = new RemoteEpisode
- {
- ParsedEpisodeInfo = new ParsedEpisodeInfo
- {
- Language = Language.English
- },
- Series = new Series
- {
- LanguageProfile = profile
- }
- };
- }
-
- private void WithEnglishRelease()
- {
- _remoteEpisode.ParsedEpisodeInfo.Language = Language.English;
- }
-
- private void WithSpanishRelease()
- {
- _remoteEpisode.ParsedEpisodeInfo.Language = Language.Spanish;
- }
-
- private void WithFrenchRelease()
- {
- _remoteEpisode.ParsedEpisodeInfo.Language = Language.French;
- }
-
- private void WithGermanRelease()
- {
- _remoteEpisode.ParsedEpisodeInfo.Language = Language.German;
- }
-
- [Test]
- public void should_return_true_if_language_is_english()
- {
- WithEnglishRelease();
-
- Mocker.Resolve().IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeTrue();
- }
-
- [Test]
- public void should_return_false_if_language_is_german()
- {
- WithGermanRelease();
-
- Mocker.Resolve().IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse();
- }
-
- [Test]
- public void should_return_false_if_language_is_french()
- {
- WithFrenchRelease();
-
- Mocker.Resolve().IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse();
- }
-
- [Test]
- public void should_return_true_if_language_is_spanish()
- {
- WithSpanishRelease();
-
- Mocker.Resolve().IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeTrue();
- }
- }
-}
diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/PrioritizeDownloadDecisionFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/PrioritizeDownloadDecisionFixture.cs
index f7129eabf..47998ae21 100644
--- a/src/NzbDrone.Core.Test/DecisionEngineTests/PrioritizeDownloadDecisionFixture.cs
+++ b/src/NzbDrone.Core.Test/DecisionEngineTests/PrioritizeDownloadDecisionFixture.cs
@@ -12,7 +12,6 @@ using NzbDrone.Core.Indexers;
using NzbDrone.Core.Languages;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Profiles.Delay;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
@@ -43,7 +42,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
var remoteEpisode = new RemoteEpisode();
remoteEpisode.ParsedEpisodeInfo = new ParsedEpisodeInfo();
remoteEpisode.ParsedEpisodeInfo.Quality = quality;
- remoteEpisode.ParsedEpisodeInfo.Language = language;
+ remoteEpisode.ParsedEpisodeInfo.Languages = new List { language };
remoteEpisode.Episodes = new List();
remoteEpisode.Episodes.AddRange(episodes);
@@ -59,11 +58,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
Items = Qualities.QualityFixture.GetDefaultQualities()
})
- .With(l => l.LanguageProfile = new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(),
- Cutoff = Language.Spanish
- })
.Build();
return remoteEpisode;
@@ -434,23 +428,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
((TorrentInfo)qualifiedReports.First().RemoteEpisode.Release).Should().Be(torrentInfo1);
}
- [Test]
- public void should_order_by_language()
- {
- var remoteEpisode1 = GivenRemoteEpisode(new List { GivenEpisode(1) }, new QualityModel(Quality.HDTV720p), Language.English);
- var remoteEpisode2 = GivenRemoteEpisode(new List { GivenEpisode(1) }, new QualityModel(Quality.HDTV720p), Language.French);
- var remoteEpisode3 = GivenRemoteEpisode(new List { GivenEpisode(1) }, new QualityModel(Quality.HDTV720p), Language.German);
-
- var decisions = new List();
- decisions.Add(new DownloadDecision(remoteEpisode1));
- decisions.Add(new DownloadDecision(remoteEpisode2));
- decisions.Add(new DownloadDecision(remoteEpisode3));
-
- var qualifiedReports = Subject.PrioritizeDecisions(decisions);
- qualifiedReports.First().RemoteEpisode.ParsedEpisodeInfo.Language.Should().Be(Language.French);
- qualifiedReports.Last().RemoteEpisode.ParsedEpisodeInfo.Language.Should().Be(Language.German);
- }
-
[Test]
public void should_put_higher_quality_before_lower_always()
{
diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/QueueSpecificationFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/QueueSpecificationFixture.cs
index b00ed8026..16dd56be4 100644
--- a/src/NzbDrone.Core.Test/DecisionEngineTests/QueueSpecificationFixture.cs
+++ b/src/NzbDrone.Core.Test/DecisionEngineTests/QueueSpecificationFixture.cs
@@ -10,7 +10,6 @@ using NzbDrone.Core.Download.TrackedDownloads;
using NzbDrone.Core.Languages;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Queue;
@@ -47,12 +46,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
FormatItems = CustomFormatsFixture.GetSampleFormatItems(),
MinFormatScore = 0
})
- .With(l => l.LanguageProfile = new LanguageProfile
- {
- Languages = Languages.LanguageFixture.GetDefaultLanguages(),
- UpgradeAllowed = true,
- Cutoff = Language.Spanish
- })
.Build();
_episode = Builder.CreateNew()
@@ -76,7 +69,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
_remoteEpisode = Builder.CreateNew()
.With(r => r.Series = _series)
.With(r => r.Episodes = new List { _episode })
- .With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.DVD), Language = Language.Spanish })
+ .With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.DVD), Languages = new List { Language.Spanish } })
.With(r => r.CustomFormats = new List())
.Build();
@@ -144,7 +137,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.DVD),
- Language = Language.Spanish
+ Languages = new List { Language.Spanish }
})
.With(r => r.CustomFormats = new List())
.With(r => r.Release = _releaseInfo)
@@ -159,7 +152,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
public void should_return_true_when_quality_in_queue_is_lower()
{
_series.QualityProfile.Value.Cutoff = Quality.Bluray1080p.Id;
- _series.LanguageProfile.Value.Cutoff = Language.Spanish;
var remoteEpisode = Builder.CreateNew()
.With(r => r.Series = _series)
@@ -167,7 +159,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.SDTV),
- Language = Language.Spanish
+ Languages = new List { Language.Spanish }
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = new List())
@@ -181,7 +173,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
public void should_return_true_when_quality_in_queue_is_lower_but_language_is_higher()
{
_series.QualityProfile.Value.Cutoff = Quality.Bluray1080p.Id;
- _series.LanguageProfile.Value.Cutoff = Language.Spanish;
var remoteEpisode = Builder.CreateNew()
.With(r => r.Series = _series)
@@ -189,7 +180,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.SDTV),
- Language = Language.English
+ Languages = new List { Language.English }
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = new List())
@@ -236,7 +227,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.DVD),
- Language = Language.Spanish,
+ Languages = new List { Language.Spanish },
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = lowFormat)
@@ -255,7 +246,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.DVD),
- Language = Language.Spanish,
+ Languages = new List { Language.Spanish },
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = new List())
@@ -265,47 +256,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse();
}
- [Test]
- public void should_return_true_when_qualities_are_the_same_but_language_is_better()
- {
- var remoteEpisode = Builder.CreateNew()
- .With(r => r.Series = _series)
- .With(r => r.Episodes = new List { _episode })
- .With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
- {
- Quality = new QualityModel(Quality.DVD),
- Language = Language.English,
- })
- .With(r => r.Release = _releaseInfo)
- .With(r => r.CustomFormats = new List())
- .Build();
-
- GivenQueue(new List { remoteEpisode });
- Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeTrue();
- }
-
- [Test]
- public void should_return_true_when_quality_is_better_language_is_better_and_upgrade_allowed_is_false_for_quality_profile()
- {
- _series.QualityProfile.Value.Cutoff = Quality.Bluray1080p.Id;
- _series.QualityProfile.Value.UpgradeAllowed = false;
-
- var remoteEpisode = Builder.CreateNew()
- .With(r => r.Series = _series)
- .With(r => r.Episodes = new List { _episode })
- .With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
- {
- Quality = new QualityModel(Quality.SDTV),
- Language = Language.English
- })
- .With(r => r.Release = _releaseInfo)
- .With(r => r.CustomFormats = new List())
- .Build();
-
- GivenQueue(new List { remoteEpisode });
- Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeTrue();
- }
-
[Test]
public void should_return_false_when_quality_in_queue_is_better()
{
@@ -317,7 +267,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.HDTV720p),
- Language = Language.English
+ Languages = new List { Language.English }
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = new List())
@@ -336,7 +286,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.HDTV720p),
- Language = Language.English
+ Languages = new List { Language.English }
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = new List())
@@ -355,7 +305,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.HDTV720p),
- Language = Language.English
+ Languages = new List { Language.English }
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = new List())
@@ -376,7 +326,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.HDTV720p),
- Language = Language.English
+ Languages = new List { Language.English }
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = new List())
@@ -400,7 +350,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Quality =
new QualityModel(
Quality.HDTV720p),
- Language = Language.English
+ Languages = new List { Language.English }
})
.With(r => r.Release = _releaseInfo)
.TheFirst(1)
@@ -425,7 +375,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.HDTV720p),
- Language = Language.Spanish
+ Languages = new List { Language.Spanish }
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = new List())
@@ -439,15 +389,13 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_return_false_when_quality_are_the_same_language_is_better_and_upgrade_allowed_is_false_for_language_profile()
{
- _series.LanguageProfile.Value.UpgradeAllowed = false;
-
var remoteEpisode = Builder.CreateNew()
.With(r => r.Series = _series)
.With(r => r.Episodes = new List { _episode })
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.DVD),
- Language = Language.English
+ Languages = new List { Language.English }
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = new List())
@@ -469,7 +417,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.Bluray1080p),
- Language = Language.Spanish
+ Languages = new List { Language.Spanish }
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = new List())
@@ -490,7 +438,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.With(r => r.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
Quality = new QualityModel(Quality.DVD),
- Language = Language.Spanish
+ Languages = new List { Language.Spanish }
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = new List())
diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/RssSync/DelaySpecificationFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/RssSync/DelaySpecificationFixture.cs
index c75c301a9..11a6c3bbb 100644
--- a/src/NzbDrone.Core.Test/DecisionEngineTests/RssSync/DelaySpecificationFixture.cs
+++ b/src/NzbDrone.Core.Test/DecisionEngineTests/RssSync/DelaySpecificationFixture.cs
@@ -15,7 +15,6 @@ using NzbDrone.Core.Languages;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Profiles.Delay;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
@@ -27,7 +26,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
public class DelaySpecificationFixture : CoreTest
{
private QualityProfile _profile;
- private LanguageProfile _langProfile;
private DelayProfile _delayProfile;
private RemoteEpisode _remoteEpisode;
@@ -37,16 +35,12 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
_profile = Builder.CreateNew()
.Build();
- _langProfile = Builder.CreateNew()
- .Build();
-
_delayProfile = Builder.CreateNew()
.With(d => d.PreferredProtocol = DownloadProtocol.Usenet)
.Build();
var series = Builder.CreateNew()
.With(s => s.QualityProfile = _profile)
- .With(s => s.LanguageProfile = _langProfile)
.Build();
_remoteEpisode = Builder.CreateNew()
@@ -60,9 +54,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
_profile.Cutoff = Quality.WEBDL720p.Id;
- _langProfile.Cutoff = Language.Spanish;
- _langProfile.Languages = Languages.LanguageFixture.GetDefaultLanguages();
-
_remoteEpisode.ParsedEpisodeInfo = new ParsedEpisodeInfo();
_remoteEpisode.Release = new ReleaseInfo();
_remoteEpisode.Release.DownloadProtocol = DownloadProtocol.Usenet;
@@ -86,7 +77,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
_remoteEpisode.Episodes.First().EpisodeFile = new EpisodeFile
{
Quality = quality,
- Language = language,
+ Languages = new List { language },
SceneName = "Series.Title.S01E01.720p.HDTV.x264-Sonarr"
};
}
@@ -94,7 +85,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
private void GivenUpgradeForExistingFile()
{
Mocker.GetMock()
- .Setup(s => s.IsUpgradable(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>(), It.IsAny(), It.IsAny(), It.IsAny>()))
+ .Setup(s => s.IsUpgradable(It.IsAny(), It.IsAny(), It.IsAny>(), It.IsAny(), It.IsAny>()))
.Returns(true);
}
@@ -127,7 +118,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
public void should_be_false_when_quality_and_language_is_last_allowed_in_profile_and_bypass_disabled()
{
_remoteEpisode.ParsedEpisodeInfo.Quality = new QualityModel(Quality.Bluray720p);
- _remoteEpisode.ParsedEpisodeInfo.Language = Language.French;
+ _remoteEpisode.ParsedEpisodeInfo.Languages = new List { Language.French };
Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeTrue();
}
@@ -138,7 +129,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
_delayProfile.BypassIfHighestQuality = true;
_remoteEpisode.ParsedEpisodeInfo.Quality = new QualityModel(Quality.Bluray720p);
- _remoteEpisode.ParsedEpisodeInfo.Language = Language.French;
+ _remoteEpisode.ParsedEpisodeInfo.Languages = new List { Language.French };
Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeTrue();
}
diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/RssSync/HistorySpecificationFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/RssSync/HistorySpecificationFixture.cs
index 7a78f9e6d..054da3649 100644
--- a/src/NzbDrone.Core.Test/DecisionEngineTests/RssSync/HistorySpecificationFixture.cs
+++ b/src/NzbDrone.Core.Test/DecisionEngineTests/RssSync/HistorySpecificationFixture.cs
@@ -12,7 +12,6 @@ using NzbDrone.Core.History;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Languages;
using NzbDrone.Core.Parser.Model;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.CustomFormats;
@@ -61,18 +60,12 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
MinFormatScore = 0,
Items = Qualities.QualityFixture.GetDefaultQualities()
})
- .With(l => l.LanguageProfile = new LanguageProfile
- {
- UpgradeAllowed = true,
- Cutoff = Language.Spanish,
- Languages = LanguageFixture.GetDefaultLanguages()
- })
.Build();
_parseResultMulti = new RemoteEpisode
{
Series = _fakeSeries,
- ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.DVD, new Revision(version: 2)), Language = Language.English },
+ ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.DVD, new Revision(version: 2)), Languages = new List { Language.English } },
Episodes = doubleEpisodeList,
CustomFormats = new List()
};
@@ -80,7 +73,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
_parseResultSingle = new RemoteEpisode
{
Series = _fakeSeries,
- ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.DVD, new Revision(version: 2)), Language = Language.English },
+ ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.DVD, new Revision(version: 2)), Languages = new List { Language.English } },
Episodes = singleEpisodeList,
CustomFormats = new List()
};
@@ -101,7 +94,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
private void GivenMostRecentForEpisode(int episodeId, string downloadId, Tuple quality, DateTime date, EpisodeHistoryEventType eventType)
{
Mocker.GetMock().Setup(s => s.MostRecentForEpisode(episodeId))
- .Returns(new EpisodeHistory { DownloadId = downloadId, Quality = quality.Item1, Date = date, EventType = eventType, Language = quality.Item2 });
+ .Returns(new EpisodeHistory { DownloadId = downloadId, Quality = quality.Item1, Date = date, EventType = eventType, Languages = new List { quality.Item2 } });
}
private void GivenCdhDisabled()
@@ -196,19 +189,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
}
- [Test]
- public void should_be_upgradable_if_episode_is_of_same_quality_as_existing_but_new_has_better_language()
- {
- _fakeSeries.QualityProfile = new QualityProfile { Cutoff = Quality.WEBDL1080p.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
- _parseResultSingle.ParsedEpisodeInfo.Quality = new QualityModel(Quality.WEBDL1080p, new Revision(version: 1));
- _parseResultSingle.ParsedEpisodeInfo.Language = Language.Spanish;
- _upgradableQuality = new Tuple(new QualityModel(Quality.WEBDL1080p, new Revision(version: 1)), Language.English);
-
- GivenMostRecentForEpisode(FIRST_EPISODE_ID, string.Empty, _upgradableQuality, DateTime.UtcNow, EpisodeHistoryEventType.Grabbed);
-
- _upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeTrue();
- }
-
[Test]
public void should_not_be_upgradable_if_cutoff_already_met()
{
diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/UpgradeAllowedSpecificationFixture .cs b/src/NzbDrone.Core.Test/DecisionEngineTests/UpgradeAllowedSpecificationFixture .cs
index aa98be479..315636e32 100644
--- a/src/NzbDrone.Core.Test/DecisionEngineTests/UpgradeAllowedSpecificationFixture .cs
+++ b/src/NzbDrone.Core.Test/DecisionEngineTests/UpgradeAllowedSpecificationFixture .cs
@@ -2,7 +2,6 @@ using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.Languages;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
@@ -13,29 +12,6 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[TestFixture]
public class UpgradeAllowedSpecificationFixture : CoreTest
{
- [Test]
- public void should_return_false_when_quality_are_the_same_language_is_better_and_upgrade_allowed_is_false_for_language_profile()
- {
- Subject.IsUpgradeAllowed(
- new QualityProfile
- {
- Cutoff = Quality.Bluray1080p.Id,
- Items = Qualities.QualityFixture.GetDefaultQualities(),
- UpgradeAllowed = true
- },
- new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English, Language.French),
- Cutoff = Language.French,
- UpgradeAllowed = false
- },
- new QualityModel(Quality.DVD),
- Language.English,
- new QualityModel(Quality.DVD),
- Language.French)
- .Should().BeFalse();
- }
-
[Test]
public void should_return_false_when_quality_is_better_languages_are_the_same_and_upgrade_allowed_is_false_for_quality_profile()
{
@@ -46,16 +22,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = false
},
- new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- },
new QualityModel(Quality.DVD),
- Language.English,
- new QualityModel(Quality.Bluray1080p),
- Language.English)
+ new QualityModel(Quality.Bluray1080p))
.Should().BeFalse();
}
@@ -69,16 +37,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = true
},
- new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English, Language.French),
- Cutoff = Language.French,
- UpgradeAllowed = true
- },
new QualityModel(Quality.DVD),
- Language.English,
- new QualityModel(Quality.DVD),
- Language.French)
+ new QualityModel(Quality.DVD))
.Should().BeTrue();
}
@@ -92,16 +52,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = true
},
- new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English, Language.French),
- Cutoff = Language.French,
- UpgradeAllowed = true
- },
new QualityModel(Quality.DVD),
- Language.English,
- new QualityModel(Quality.DVD),
- Language.English)
+ new QualityModel(Quality.DVD))
.Should().BeTrue();
}
@@ -115,16 +67,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = true
},
- new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English, Language.French),
- Cutoff = Language.French,
- UpgradeAllowed = false
- },
new QualityModel(Quality.DVD),
- Language.English,
- new QualityModel(Quality.DVD),
- Language.English)
+ new QualityModel(Quality.DVD))
.Should().BeTrue();
}
@@ -138,16 +82,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = true
},
- new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English, Language.French),
- Cutoff = Language.French,
- UpgradeAllowed = true
- },
new QualityModel(Quality.DVD),
- Language.French,
- new QualityModel(Quality.DVD),
- Language.English)
+ new QualityModel(Quality.DVD))
.Should().BeTrue();
}
@@ -161,16 +97,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = true
},
- new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English, Language.French),
- Cutoff = Language.French,
- UpgradeAllowed = false
- },
new QualityModel(Quality.DVD),
- Language.French,
- new QualityModel(Quality.DVD),
- Language.English)
+ new QualityModel(Quality.DVD))
.Should().BeTrue();
}
@@ -184,16 +112,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = true
},
- new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- },
new QualityModel(Quality.DVD),
- Language.English,
- new QualityModel(Quality.Bluray1080p),
- Language.English)
+ new QualityModel(Quality.Bluray1080p))
.Should().BeTrue();
}
@@ -207,16 +127,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = true
},
- new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- },
new QualityModel(Quality.DVD),
- Language.English,
- new QualityModel(Quality.DVD),
- Language.English)
+ new QualityModel(Quality.DVD))
.Should().BeTrue();
}
@@ -230,16 +142,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = false
},
- new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- },
new QualityModel(Quality.DVD),
- Language.English,
- new QualityModel(Quality.DVD),
- Language.English)
+ new QualityModel(Quality.DVD))
.Should().BeTrue();
}
@@ -253,16 +157,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = true
},
- new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- },
new QualityModel(Quality.DVD),
- Language.English,
- new QualityModel(Quality.SDTV),
- Language.English)
+ new QualityModel(Quality.SDTV))
.Should().BeTrue();
}
@@ -276,16 +172,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
UpgradeAllowed = false
},
- new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(Language.English),
- Cutoff = Language.English,
- UpgradeAllowed = true
- },
new QualityModel(Quality.DVD),
- Language.English,
- new QualityModel(Quality.SDTV),
- Language.English)
+ new QualityModel(Quality.SDTV))
.Should().BeTrue();
}
}
diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/UpgradeDiskSpecificationFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/UpgradeDiskSpecificationFixture.cs
index 5e52407da..f75915b69 100644
--- a/src/NzbDrone.Core.Test/DecisionEngineTests/UpgradeDiskSpecificationFixture.cs
+++ b/src/NzbDrone.Core.Test/DecisionEngineTests/UpgradeDiskSpecificationFixture.cs
@@ -10,7 +10,6 @@ using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.Languages;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Parser.Model;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.CustomFormats;
@@ -38,14 +37,12 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
CustomFormatsFixture.GivenCustomFormats();
- _firstFile = new EpisodeFile { Quality = new QualityModel(Quality.Bluray1080p, new Revision(version: 2)), DateAdded = DateTime.Now, Language = Language.English };
- _secondFile = new EpisodeFile { Quality = new QualityModel(Quality.Bluray1080p, new Revision(version: 2)), DateAdded = DateTime.Now, Language = Language.English };
+ _firstFile = new EpisodeFile { Quality = new QualityModel(Quality.Bluray1080p, new Revision(version: 2)), DateAdded = DateTime.Now, Languages = new List { Language.English } };
+ _secondFile = new EpisodeFile { Quality = new QualityModel(Quality.Bluray1080p, new Revision(version: 2)), DateAdded = DateTime.Now, Languages = new List { Language.English } };
var singleEpisodeList = new List { new Episode { EpisodeFile = _firstFile, EpisodeFileId = 1 }, new Episode { EpisodeFile = null } };
var doubleEpisodeList = new List { new Episode { EpisodeFile = _firstFile, EpisodeFileId = 1 }, new Episode { EpisodeFile = _secondFile, EpisodeFileId = 1 }, new Episode { EpisodeFile = null } };
- var languages = Languages.LanguageFixture.GetDefaultLanguages(Language.English, Language.Spanish);
-
var fakeSeries = Builder.CreateNew()
.With(c => c.QualityProfile = new QualityProfile
{
@@ -55,18 +52,12 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
FormatItems = CustomFormatsFixture.GetSampleFormatItems("None"),
MinFormatScore = 0,
})
- .With(l => l.LanguageProfile = new LanguageProfile
- {
- UpgradeAllowed = true,
- Cutoff = Language.Spanish,
- Languages = languages
- })
.Build();
_parseResultMulti = new RemoteEpisode
{
Series = fakeSeries,
- ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.DVD, new Revision(version: 2)), Language = Language.English },
+ ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.DVD, new Revision(version: 2)), Languages = new List { Language.English } },
Episodes = doubleEpisodeList,
CustomFormats = new List()
};
@@ -74,7 +65,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
_parseResultSingle = new RemoteEpisode
{
Series = fakeSeries,
- ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.DVD, new Revision(version: 2)), Language = Language.English },
+ ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.DVD, new Revision(version: 2)), Languages = new List { Language.English } },
Episodes = singleEpisodeList,
CustomFormats = new List()
};
diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/UpgradeSpecificationFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/UpgradeSpecificationFixture.cs
index d79bfe5c3..579cbc2b3 100644
--- a/src/NzbDrone.Core.Test/DecisionEngineTests/UpgradeSpecificationFixture.cs
+++ b/src/NzbDrone.Core.Test/DecisionEngineTests/UpgradeSpecificationFixture.cs
@@ -5,7 +5,6 @@ using NzbDrone.Core.Configuration;
using NzbDrone.Core.CustomFormats;
using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.Languages;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
@@ -57,53 +56,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities()
};
- var langProfile = new LanguageProfile
- {
- UpgradeAllowed = true,
- Languages = LanguageFixture.GetDefaultLanguages(),
- Cutoff = Language.English
- };
-
Subject.IsUpgradable(
profile,
- langProfile,
new QualityModel(current, new Revision(version: currentVersion)),
- Language.English,
new List(),
new QualityModel(newQuality, new Revision(version: newVersion)),
- Language.English,
- new List())
- .Should().Be(expected);
- }
-
- [Test]
- [TestCaseSource("IsUpgradeTestCasesLanguages")]
- public void IsUpgradeTestLanguage(Quality current, int currentVersion, Language currentLanguage, Quality newQuality, int newVersion, Language newLanguage, Quality cutoff, Language languageCutoff, bool expected)
- {
- GivenAutoDownloadPropers(ProperDownloadTypes.PreferAndUpgrade);
-
- var profile = new QualityProfile
- {
- UpgradeAllowed = true,
- Items = Qualities.QualityFixture.GetDefaultQualities(),
- Cutoff = cutoff.Id,
- };
-
- var langProfile = new LanguageProfile
- {
- UpgradeAllowed = true,
- Languages = LanguageFixture.GetDefaultLanguages(),
- Cutoff = languageCutoff
- };
-
- Subject.IsUpgradable(
- profile,
- langProfile,
- new QualityModel(current, new Revision(version: currentVersion)),
- currentLanguage,
- new List(),
- new QualityModel(newQuality, new Revision(version: newVersion)),
- newLanguage,
new List())
.Should().Be(expected);
}
@@ -118,20 +75,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
};
- var langProfile = new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(),
- Cutoff = Language.English
- };
-
Subject.IsUpgradable(
profile,
- langProfile,
new QualityModel(Quality.DVD, new Revision(version: 1)),
- Language.English,
new List(),
new QualityModel(Quality.DVD, new Revision(version: 2)),
- Language.English,
new List())
.Should().BeTrue();
}
@@ -146,20 +94,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
};
- var langProfile = new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(),
- Cutoff = Language.English
- };
-
Subject.IsUpgradable(
profile,
- langProfile,
new QualityModel(Quality.DVD, new Revision(version: 1)),
- Language.English,
new List(),
new QualityModel(Quality.DVD, new Revision(version: 2)),
- Language.English,
new List())
.Should().BeFalse();
}
@@ -172,20 +111,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Items = Qualities.QualityFixture.GetDefaultQualities(),
};
- var langProfile = new LanguageProfile
- {
- Languages = LanguageFixture.GetDefaultLanguages(),
- Cutoff = Language.English
- };
-
Subject.IsUpgradable(
profile,
- langProfile,
new QualityModel(Quality.HDTV720p, new Revision(version: 1)),
- Language.English,
new List(),
new QualityModel(Quality.HDTV720p, new Revision(version: 1)),
- Language.English,
new List())
.Should().BeFalse();
}
diff --git a/src/NzbDrone.Core.Test/HistoryTests/HistoryRepositoryFixture.cs b/src/NzbDrone.Core.Test/HistoryTests/HistoryRepositoryFixture.cs
index 4e6815243..79bbfc323 100644
--- a/src/NzbDrone.Core.Test/HistoryTests/HistoryRepositoryFixture.cs
+++ b/src/NzbDrone.Core.Test/HistoryTests/HistoryRepositoryFixture.cs
@@ -1,4 +1,5 @@
-using FizzWare.NBuilder;
+using System.Collections.Generic;
+using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.History;
@@ -15,7 +16,7 @@ namespace NzbDrone.Core.Test.HistoryTests
public void should_read_write_dictionary()
{
var history = Builder.CreateNew()
- .With(c => c.Language = Language.English)
+ .With(c => c.Languages = new List { Language.English })
.With(c => c.Quality = new QualityModel())
.BuildNew();
@@ -31,14 +32,14 @@ namespace NzbDrone.Core.Test.HistoryTests
public void should_get_download_history()
{
var historyBluray = Builder.CreateNew()
- .With(c => c.Language = Language.English)
+ .With(c => c.Languages = new List { Language.English })
.With(c => c.Quality = new QualityModel(Quality.Bluray1080p))
.With(c => c.SeriesId = 12)
.With(c => c.EventType = EpisodeHistoryEventType.Grabbed)
.BuildNew();
var historyDvd = Builder.CreateNew()
- .With(c => c.Language = Language.English)
+ .With(c => c.Languages = new List { Language.English })
.With(c => c.Quality = new QualityModel(Quality.DVD))
.With(c => c.SeriesId = 12)
.With(c => c.EventType = EpisodeHistoryEventType.Grabbed)
diff --git a/src/NzbDrone.Core.Test/HistoryTests/HistoryServiceFixture.cs b/src/NzbDrone.Core.Test/HistoryTests/HistoryServiceFixture.cs
index e73cb901d..e74861f2f 100644
--- a/src/NzbDrone.Core.Test/HistoryTests/HistoryServiceFixture.cs
+++ b/src/NzbDrone.Core.Test/HistoryTests/HistoryServiceFixture.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.IO;
using System.Linq;
using FizzWare.NBuilder;
@@ -11,7 +11,6 @@ using NzbDrone.Core.Languages;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Parser.Model;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
@@ -24,7 +23,6 @@ namespace NzbDrone.Core.Test.HistoryTests
{
private QualityProfile _profile;
private QualityProfile _profileCustom;
- private LanguageProfile _languageProfile;
[SetUp]
public void Setup()
@@ -40,12 +38,6 @@ namespace NzbDrone.Core.Test.HistoryTests
Cutoff = Quality.WEBDL720p.Id,
Items = QualityFixture.GetDefaultQualities(Quality.DVD),
};
-
- _languageProfile = new LanguageProfile
- {
- Cutoff = Language.Spanish,
- Languages = Languages.LanguageFixture.GetDefaultLanguages()
- };
}
[Test]
diff --git a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlocklistFixture.cs b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlocklistFixture.cs
index a572bd2fb..c6318b57a 100644
--- a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlocklistFixture.cs
+++ b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlocklistFixture.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
@@ -18,7 +18,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
public void should_delete_orphaned_blocklist_items()
{
var blocklist = Builder.CreateNew()
- .With(h => h.Language = Language.English)
+ .With(h => h.Languages = new List { Language.English })
.With(h => h.EpisodeIds = new List())
.With(h => h.Quality = new QualityModel())
.BuildNew();
@@ -36,7 +36,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
Db.Insert(series);
var blocklist = Builder.CreateNew()
- .With(h => h.Language = Language.English)
+ .With(h => h.Languages = new List { Language.English })
.With(h => h.EpisodeIds = new List())
.With(h => h.Quality = new QualityModel())
.With(b => b.SeriesId = series.Id)
diff --git a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedEpisodeFilesFixture.cs b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedEpisodeFilesFixture.cs
index 9a23183c3..93ba6e339 100644
--- a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedEpisodeFilesFixture.cs
+++ b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedEpisodeFilesFixture.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System.Collections.Generic;
+using System.Linq;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
@@ -18,7 +19,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
public void should_delete_orphaned_episode_files()
{
var episodeFile = Builder.CreateNew()
- .With(h => h.Language = Language.English)
+ .With(h => h.Languages = new List { Language.English })
.With(h => h.Quality = new QualityModel())
.BuildNew();
@@ -32,7 +33,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
{
var episodeFiles = Builder.CreateListOfSize(2)
.All()
- .With(h => h.Language = Language.English)
+ .With(h => h.Languages = new List { Language.English })
.With(h => h.Quality = new QualityModel())
.BuildListOfNew();
diff --git a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedHistoryItemsFixture.cs b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedHistoryItemsFixture.cs
index ee93c41b1..92035eb9d 100644
--- a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedHistoryItemsFixture.cs
+++ b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedHistoryItemsFixture.cs
@@ -1,4 +1,5 @@
-using FizzWare.NBuilder;
+using System.Collections.Generic;
+using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.History;
@@ -42,7 +43,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
GivenEpisode();
var history = Builder.CreateNew()
- .With(h => h.Language = Language.English)
+ .With(h => h.Languages = new List { Language.English })
.With(h => h.Quality = new QualityModel())
.With(h => h.EpisodeId = _episode.Id)
.BuildNew();
@@ -58,7 +59,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
GivenSeries();
var history = Builder.CreateNew()
- .With(h => h.Language = Language.English)
+ .With(h => h.Languages = new List { Language.English })
.With(h => h.Quality = new QualityModel())
.With(h => h.SeriesId = _series.Id)
.BuildNew();
@@ -76,7 +77,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
var history = Builder.CreateListOfSize(2)
.All()
- .With(h => h.Language = Language.English)
+ .With(h => h.Languages = new List { Language.English })
.With(h => h.Quality = new QualityModel())
.With(h => h.EpisodeId = _episode.Id)
.TheFirst(1)
@@ -98,7 +99,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
var history = Builder.CreateListOfSize(2)
.All()
- .With(h => h.Language = Language.English)
+ .With(h => h.Languages = new List { Language.English })
.With(h => h.Quality = new QualityModel())
.With(h => h.SeriesId = _series.Id)
.TheFirst(1)
diff --git a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedMetadataFilesFixture.cs b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedMetadataFilesFixture.cs
index f776c98b5..80abd8eb5 100644
--- a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedMetadataFilesFixture.cs
+++ b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedMetadataFilesFixture.cs
@@ -1,4 +1,5 @@
-using FizzWare.NBuilder;
+using System.Collections.Generic;
+using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Extras.Metadata;
@@ -71,7 +72,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
var episodeFile = Builder.CreateNew()
.With(h => h.Quality = new QualityModel())
- .With(h => h.Language = Language.English)
+ .With(h => h.Languages = new List { Language.English })
.BuildNew();
Db.Insert(series);
diff --git a/src/NzbDrone.Core.Test/Languages/LanguageFixture.cs b/src/NzbDrone.Core.Test/Languages/LanguageFixture.cs
index 90b61ef92..8a27cba4e 100644
--- a/src/NzbDrone.Core.Test/Languages/LanguageFixture.cs
+++ b/src/NzbDrone.Core.Test/Languages/LanguageFixture.cs
@@ -1,9 +1,8 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Languages;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.Languages
@@ -78,27 +77,5 @@ namespace NzbDrone.Core.Test.Languages
var i = (int)source;
i.Should().Be(expected);
}
-
- public static List GetDefaultLanguages(params Language[] allowed)
- {
- var languages = new List
- {
- Language.English,
- Language.Spanish,
- Language.French
- };
-
- if (allowed.Length == 0)
- {
- allowed = languages.ToArray();
- }
-
- var items = languages
- .Except(allowed)
- .Concat(allowed)
- .Select(v => new LanguageProfileItem { Language = v, Allowed = allowed.Contains(v) }).ToList();
-
- return items;
- }
}
}
diff --git a/src/NzbDrone.Core.Test/Languages/LanguageProfileRepositoryFixture.cs b/src/NzbDrone.Core.Test/Languages/LanguageProfileRepositoryFixture.cs
deleted file mode 100644
index cff03b447..000000000
--- a/src/NzbDrone.Core.Test/Languages/LanguageProfileRepositoryFixture.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System.Linq;
-using FluentAssertions;
-using NUnit.Framework;
-using NzbDrone.Core.Languages;
-using NzbDrone.Core.Profiles.Languages;
-using NzbDrone.Core.Test.Framework;
-
-namespace NzbDrone.Core.Test.Languages
-{
- [TestFixture]
- public class LanguageProfileRepositoryFixture : DbTest
- {
- [Test]
- public void should_be_able_to_read_and_write()
- {
- var profile = new LanguageProfile
- {
- Languages = Language.All.OrderByDescending(l => l.Name).Select(l => new LanguageProfileItem { Language = l, Allowed = l == Language.English }).ToList(),
- Name = "TestProfile",
- Cutoff = Language.English
- };
-
- Subject.Insert(profile);
-
- StoredModel.Name.Should().Be(profile.Name);
- StoredModel.Cutoff.Should().Be(profile.Cutoff);
-
- StoredModel.Languages.Should().Equal(profile.Languages, (a, b) => a.Language == b.Language && a.Allowed == b.Allowed);
- }
- }
-}
diff --git a/src/NzbDrone.Core.Test/Languages/LanguageProfileServiceFixture.cs b/src/NzbDrone.Core.Test/Languages/LanguageProfileServiceFixture.cs
deleted file mode 100644
index 0d63f98da..000000000
--- a/src/NzbDrone.Core.Test/Languages/LanguageProfileServiceFixture.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using FizzWare.NBuilder;
-using Moq;
-using NUnit.Framework;
-using NzbDrone.Core.ImportLists;
-using NzbDrone.Core.Lifecycle;
-using NzbDrone.Core.Profiles.Languages;
-using NzbDrone.Core.Test.Framework;
-using NzbDrone.Core.Tv;
-
-namespace NzbDrone.Core.Test.Languages
-{
- [TestFixture]
-
- public class LanguageProfileServiceFixture : CoreTest
- {
- [SetUp]
- public void Setup()
- {
- Mocker.GetMock()
- .Setup(s => s.All())
- .Returns(new List());
- }
-
- [Test]
- public void init_should_add_default_profiles()
- {
- Subject.Handle(new ApplicationStartedEvent());
-
- Mocker.GetMock()
- .Verify(v => v.Insert(It.IsAny()), Times.Once());
- }
-
- [Test]
-
- //This confirms that new profiles are added only if no other profiles exists.
- //We don't want to keep adding them back if a user deleted them on purpose.
- public void Init_should_skip_if_any_profiles_already_exist()
- {
- Mocker.GetMock()
- .Setup(s => s.All())
- .Returns(Builder.CreateListOfSize(2).Build().ToList());
-
- Subject.Handle(new ApplicationStartedEvent());
-
- Mocker.GetMock()
- .Verify(v => v.Insert(It.IsAny()), Times.Never());
- }
-
- [Test]
- public void should_not_be_able_to_delete_profile_if_assigned_to_series()
- {
- var seriesList = Builder.CreateListOfSize(3)
- .Random(1)
- .With(c => c.LanguageProfileId = 2)
- .Build().ToList();
-
- Mocker.GetMock().Setup(c => c.GetAllSeries()).Returns(seriesList);
-
- Assert.Throws(() => Subject.Delete(2));
-
- Mocker.GetMock().Verify(c => c.Delete(It.IsAny()), Times.Never());
- }
-
- [Test]
- public void should_delete_profile_if_not_assigned_to_series()
- {
- var seriesList = Builder.CreateListOfSize(3)
- .All()
- .With(c => c.LanguageProfileId = 2)
- .Build().ToList();
-
- Mocker.GetMock().Setup(c => c.GetAllSeries()).Returns(seriesList);
-
- Subject.Delete(1);
-
- Mocker.GetMock().Verify(c => c.Delete(1), Times.Once());
- }
-
- [Test]
- public void should_not_be_able_to_delete_profile_if_assigned_to_import_list()
- {
- var seriesList = Builder.CreateListOfSize(3)
- .Random(1)
- .With(c => c.LanguageProfileId = 2)
- .Build().ToList();
-
- var importLists = Builder.CreateListOfSize(3)
- .Random(1)
- .With(c => c.LanguageProfileId = 1)
- .Build().ToList();
-
- Mocker.GetMock().Setup(c => c.GetAllSeries()).Returns(seriesList);
-
- Mocker.GetMock()
- .Setup(s => s.All())
- .Returns(importLists);
-
- Assert.Throws(() => Subject.Delete(1));
-
- Mocker.GetMock().Verify(c => c.Delete(It.IsAny()), Times.Never());
- }
- }
-}
diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Aggregation/Aggregators/AggregateLanguageFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Aggregation/Aggregators/AggregateLanguageFixture.cs
index 72a35f8e5..833b76b42 100644
--- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Aggregation/Aggregators/AggregateLanguageFixture.cs
+++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Aggregation/Aggregators/AggregateLanguageFixture.cs
@@ -1,9 +1,13 @@
+using System.Collections.Generic;
using System.Linq;
using FizzWare.NBuilder;
using FluentAssertions;
+using Moq;
using NUnit.Framework;
+using NzbDrone.Core.Download;
using NzbDrone.Core.Languages;
using NzbDrone.Core.MediaFiles.EpisodeImport.Aggregation.Aggregators;
+using NzbDrone.Core.MediaFiles.EpisodeImport.Aggregation.Aggregators.Augmenters.Language;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv;
@@ -30,68 +34,152 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Aggregation.Aggregators
.Build();
}
- private ParsedEpisodeInfo GetParsedEpisodeInfo(Language language, string releaseTitle)
+ private void GivenAugmenters(List fileNameLanguages, List folderNameLanguages, List clientLanguages, List mediaInfoLanguages)
+ {
+ var fileNameAugmenter = new Mock();
+ var folderNameAugmenter = new Mock();
+ var clientInfoAugmenter = new Mock();
+ var mediaInfoAugmenter = new Mock();
+
+ fileNameAugmenter.Setup(s => s.AugmentLanguage(It.IsAny(), It.IsAny()))
+ .Returns(new AugmentLanguageResult(fileNameLanguages, Confidence.Filename));
+
+ folderNameAugmenter.Setup(s => s.AugmentLanguage(It.IsAny(), It.IsAny()))
+ .Returns(new AugmentLanguageResult(folderNameLanguages, Confidence.Foldername));
+
+ clientInfoAugmenter.Setup(s => s.AugmentLanguage(It.IsAny(), It.IsAny()))
+ .Returns(new AugmentLanguageResult(clientLanguages, Confidence.DownloadClientItem));
+
+ mediaInfoAugmenter.Setup(s => s.AugmentLanguage(It.IsAny(), It.IsAny()))
+ .Returns(new AugmentLanguageResult(mediaInfoLanguages, Confidence.MediaInfo));
+
+ var mocks = new List> { fileNameAugmenter, folderNameAugmenter, clientInfoAugmenter, mediaInfoAugmenter };
+
+ Mocker.SetConstant>(mocks.Select(c => c.Object));
+ }
+
+ private ParsedEpisodeInfo GetParsedEpisodeInfo(List languages, string releaseTitle)
{
return new ParsedEpisodeInfo
{
- Language = language,
+ Languages = languages,
ReleaseTitle = releaseTitle
};
}
+ [Test]
+ public void should_return_default_if_no_info_is_known()
+ {
+ var result = Subject.Aggregate(_localEpisode, null);
+
+ result.Languages.Should().Contain(Language.English);
+ }
+
[Test]
public void should_return_file_language_when_only_file_info_is_known()
{
- _localEpisode.FileEpisodeInfo = GetParsedEpisodeInfo(Language.English, _simpleReleaseTitle);
+ _localEpisode.FileEpisodeInfo = GetParsedEpisodeInfo(new List { Language.French }, _simpleReleaseTitle);
- Subject.Aggregate(_localEpisode, null).Language.Should().Be(_localEpisode.FileEpisodeInfo.Language);
+ GivenAugmenters(new List { Language.French },
+ null,
+ null,
+ null);
+
+ Subject.Aggregate(_localEpisode, null).Languages.Should().Equal(_localEpisode.FileEpisodeInfo.Languages);
}
[Test]
public void should_return_folder_language_when_folder_info_is_known()
{
- _localEpisode.FolderEpisodeInfo = GetParsedEpisodeInfo(Language.English, _simpleReleaseTitle);
- _localEpisode.FileEpisodeInfo = GetParsedEpisodeInfo(Language.English, _simpleReleaseTitle);
+ _localEpisode.FolderEpisodeInfo = GetParsedEpisodeInfo(new List { Language.German }, _simpleReleaseTitle);
+ _localEpisode.FileEpisodeInfo = GetParsedEpisodeInfo(new List { Language.French }, _simpleReleaseTitle);
- Subject.Aggregate(_localEpisode, null).Language.Should().Be(_localEpisode.FolderEpisodeInfo.Language);
+ GivenAugmenters(new List { Language.French },
+ new List { Language.German },
+ null,
+ null);
+
+ Subject.Aggregate(_localEpisode, null).Languages.Should().Equal(_localEpisode.FolderEpisodeInfo.Languages);
}
[Test]
public void should_return_download_client_item_language_when_download_client_item_info_is_known()
{
- _localEpisode.DownloadClientEpisodeInfo = GetParsedEpisodeInfo(Language.English, _simpleReleaseTitle);
- _localEpisode.FolderEpisodeInfo = GetParsedEpisodeInfo(Language.English, _simpleReleaseTitle);
- _localEpisode.FileEpisodeInfo = GetParsedEpisodeInfo(Language.English, _simpleReleaseTitle);
+ _localEpisode.DownloadClientEpisodeInfo = GetParsedEpisodeInfo(new List { Language.Spanish }, _simpleReleaseTitle);
+ _localEpisode.FolderEpisodeInfo = GetParsedEpisodeInfo(new List { Language.German }, _simpleReleaseTitle);
+ _localEpisode.FileEpisodeInfo = GetParsedEpisodeInfo(new List { Language.French }, _simpleReleaseTitle);
- Subject.Aggregate(_localEpisode, null).Language.Should().Be(_localEpisode.DownloadClientEpisodeInfo.Language);
+ GivenAugmenters(new List { Language.French },
+ new List { Language.German },
+ new List { Language.Spanish },
+ null);
+
+ Subject.Aggregate(_localEpisode, null).Languages.Should().Equal(_localEpisode.DownloadClientEpisodeInfo.Languages);
}
[Test]
public void should_return_file_language_when_file_language_is_higher_than_others()
{
- _localEpisode.DownloadClientEpisodeInfo = GetParsedEpisodeInfo(Language.English, _simpleReleaseTitle);
- _localEpisode.FolderEpisodeInfo = GetParsedEpisodeInfo(Language.English, _simpleReleaseTitle);
- _localEpisode.FileEpisodeInfo = GetParsedEpisodeInfo(Language.French, _simpleReleaseTitle);
+ _localEpisode.DownloadClientEpisodeInfo = GetParsedEpisodeInfo(new List { Language.English }, _simpleReleaseTitle);
+ _localEpisode.FolderEpisodeInfo = GetParsedEpisodeInfo(new List { Language.English }, _simpleReleaseTitle);
+ _localEpisode.FileEpisodeInfo = GetParsedEpisodeInfo(new List { Language.French }, _simpleReleaseTitle);
- Subject.Aggregate(_localEpisode, null).Language.Should().Be(_localEpisode.FileEpisodeInfo.Language);
+ GivenAugmenters(new List { Language.French },
+ new List { Language.English },
+ new List { Language.English },
+ null);
+
+ Subject.Aggregate(_localEpisode, null).Languages.Should().Contain(_localEpisode.FileEpisodeInfo.Languages);
+ }
+
+ [Test]
+ public void should_return_multi_language()
+ {
+ GivenAugmenters(new List { Language.English },
+ new List { Language.French, Language.German },
+ new List { Language.English },
+ null);
+
+ Subject.Aggregate(_localEpisode, null).Languages.Should().Equal(new List { Language.French, Language.German });
+ }
+
+ [Test]
+ public void should_use_mediainfo_over_others()
+ {
+ GivenAugmenters(new List { Language.Unknown },
+ new List { Language.French, Language.German },
+ new List { Language.Unknown },
+ new List { Language.Japanese, Language.English });
+
+ Subject.Aggregate(_localEpisode, null).Languages.Should().Equal(new List { Language.Japanese, Language.English });
}
[Test]
public void should_return_english_if_parsed_language_is_in_episode_title_and_release_title_contains_episode_title()
{
_localEpisode.Episodes.First().Title = "The Swedish Job";
- _localEpisode.FileEpisodeInfo = GetParsedEpisodeInfo(Language.Swedish, "Series.Title.S01E01.The.Swedish.Job.720p.WEB-DL-RlsGrp");
+ _localEpisode.FileEpisodeInfo = GetParsedEpisodeInfo(new List { Language.Swedish }, "Series.Title.S01E01.The.Swedish.Job.720p.WEB-DL-RlsGrp");
- Subject.Aggregate(_localEpisode, null).Language.Should().Be(Language.English);
+ GivenAugmenters(new List { },
+ null,
+ null,
+ null);
+
+ Subject.Aggregate(_localEpisode, null).Languages.Should().Contain(Language.English);
}
[Test]
public void should_return_parsed_if_parsed_language_is_not_episode_title_and_release_title_contains_episode_title()
{
_localEpisode.Episodes.First().Title = "The Swedish Job";
- _localEpisode.FileEpisodeInfo = GetParsedEpisodeInfo(Language.French, "Series.Title.S01E01.The.Swedish.Job.720p.WEB-DL-RlsGrp");
+ _localEpisode.FileEpisodeInfo = GetParsedEpisodeInfo(new List { Language.French }, "Series.Title.S01E01.The.Swedish.Job.720p.WEB-DL-RlsGrp");
- Subject.Aggregate(_localEpisode, null).Language.Should().Be(_localEpisode.FileEpisodeInfo.Language);
+ GivenAugmenters(new List { Language.French },
+ null,
+ null,
+ null);
+
+ Subject.Aggregate(_localEpisode, null).Languages.Should().Contain(_localEpisode.FileEpisodeInfo.Languages);
}
}
}
diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/GetSceneNameFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/GetSceneNameFixture.cs
index 704218fbe..7b3001030 100644
--- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/GetSceneNameFixture.cs
+++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/GetSceneNameFixture.cs
@@ -8,7 +8,6 @@ using NzbDrone.Core.Languages;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.EpisodeImport;
using NzbDrone.Core.Parser.Model;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
@@ -29,11 +28,6 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
{
var series = Builder.CreateNew()
.With(e => e.QualityProfile = new QualityProfile { Items = Qualities.QualityFixture.GetDefaultQualities() })
- .With(l => l.LanguageProfile = new LanguageProfile
- {
- Cutoff = Language.Spanish,
- Languages = Languages.LanguageFixture.GetDefaultLanguages()
- })
.With(s => s.Path = @"C:\Test\TV\Series Title".AsOsAgnostic())
.Build();
diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportApprovedEpisodesFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportApprovedEpisodesFixture.cs
index 44d7cdfd0..910580fca 100644
--- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportApprovedEpisodesFixture.cs
+++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportApprovedEpisodesFixture.cs
@@ -14,7 +14,6 @@ using NzbDrone.Core.MediaFiles.EpisodeImport;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Parser.Model;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
@@ -41,11 +40,6 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
var series = Builder.CreateNew()
.With(e => e.QualityProfile = new QualityProfile { Items = Qualities.QualityFixture.GetDefaultQualities() })
- .With(l => l.LanguageProfile = new LanguageProfile
- {
- Cutoff = Language.Spanish,
- Languages = Languages.LanguageFixture.GetDefaultLanguages()
- })
.With(s => s.Path = @"C:\Test\TV\30 Rock".AsOsAgnostic())
.Build();
diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs
index f613a0937..7fddbd1fe 100644
--- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs
+++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs
@@ -11,7 +11,6 @@ using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.EpisodeImport;
using NzbDrone.Core.MediaFiles.EpisodeImport.Aggregation;
using NzbDrone.Core.Parser.Model;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
@@ -58,7 +57,6 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
_series = Builder.CreateNew()
.With(e => e.Path = @"C:\Test\Series".AsOsAgnostic())
.With(e => e.QualityProfile = new QualityProfile { Items = Qualities.QualityFixture.GetDefaultQualities() })
- .With(e => e.LanguageProfile = new LanguageProfile { Languages = Languages.LanguageFixture.GetDefaultLanguages() })
.Build();
_quality = new QualityModel(Quality.DVD);
@@ -67,7 +65,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
{
Series = _series,
Quality = _quality,
- Language = Language.Spanish,
+ Languages = new List { Language.Spanish },
Episodes = new List { new Episode() },
Path = @"C:\Test\Unsorted\The.Office.S03E115.DVDRip.Spanish.XviD-OSiTV.avi"
};
diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/UpgradeSpecificationFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/UpgradeSpecificationFixture.cs
index fbab5bcd5..1bc867448 100644
--- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/UpgradeSpecificationFixture.cs
+++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/UpgradeSpecificationFixture.cs
@@ -12,7 +12,6 @@ using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.EpisodeImport.Specifications;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
-using NzbDrone.Core.Profiles.Languages;
using NzbDrone.Core.Profiles.Qualities;
using NzbDrone.Core.Profiles.Releases;
using NzbDrone.Core.Qualities;
@@ -37,18 +36,13 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
{
Items = Qualities.QualityFixture.GetDefaultQualities(),
})
- .With(l => l.LanguageProfile = new LanguageProfile
- {
- Languages = Languages.LanguageFixture.GetDefaultLanguages(),
- Cutoff = Language.Spanish,
- })
.Build();
_localEpisode = new LocalEpisode
{
Path = @"C:\Test\30 Rock\30.rock.s01e01.avi",
Quality = new QualityModel(Quality.HDTV720p, new Revision(version: 1)),
- Language = Language.Spanish,
+ Languages = new List { Language.Spanish },
Series = _series
};
}
@@ -89,7 +83,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
new EpisodeFile
{
Quality = new QualityModel(Quality.SDTV, new Revision(version: 1)),
- Language = Language.Spanish
+ Languages = new List { Language.Spanish }
}))
.Build()
.ToList();
@@ -107,7 +101,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
new EpisodeFile
{
Quality = new QualityModel(Quality.HDTV720p, new Revision(version: 1)),
- Language = Language.English
+ Languages = new List { Language.English }
}))
.Build()
.ToList();
@@ -115,24 +109,6 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
- [Test]
- public void should_return_true_if_language_upgrade_for_existing_episodeFile_and_quality_is_same_but_lower_revision()
- {
- _localEpisode.Episodes = Builder.CreateListOfSize(1)
- .All()
- .With(e => e.EpisodeFileId = 1)
- .With(e => e.EpisodeFile = new LazyLoaded(
- new EpisodeFile
- {
- Quality = new QualityModel(Quality.HDTV720p, new Revision(version: 2)),
- Language = Language.English
- }))
- .Build()
- .ToList();
-
- Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
- }
-
[Test]
public void should_return_false_if_language_upgrade_for_existing_episodeFile_and_quality_is_worse()
{
@@ -143,7 +119,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
new EpisodeFile
{
Quality = new QualityModel(Quality.Bluray1080p, new Revision(version: 1)),
- Language = Language.English
+ Languages = new List { Language.English }
}))
.Build()
.ToList();
@@ -178,7 +154,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
new EpisodeFile
{
Quality = new QualityModel(Quality.HDTV720p, new Revision(version: 1)),
- Language = Language.English
+ Languages = new List { Language.English }
}))
.Build()
.ToList();
@@ -196,7 +172,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
new EpisodeFile
{
Quality = new QualityModel(Quality.Bluray1080p, new Revision(version: 1)),
- Language = Language.English
+ Languages = new List { Language.English }
}))
.Build()
.ToList();
@@ -276,7 +252,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
new EpisodeFile
{
Quality = new QualityModel(Quality.HDTV720p, new Revision(version: 2)),
- Language = Language.Spanish
+ Languages = new List { Language.Spanish }
}))
.Build()
.ToList();
@@ -314,7 +290,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
new EpisodeFile
{
Quality = new QualityModel(Quality.Bluray1080p),
- Language = Language.Spanish
+ Languages = new List { Language.Spanish }
}))
.Build()
.ToList();
@@ -348,7 +324,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
new EpisodeFile
{
Quality = new QualityModel(Quality.Bluray1080p),
- Language = Language.French
+ Languages = new List { Language.French }
}))
.Build()
.ToList();
@@ -382,7 +358,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
new EpisodeFile
{
Quality = new QualityModel(Quality.Bluray1080p),
- Language = Language.English
+ Languages = new List { Language.English }
}))
.Build()
.ToList();
diff --git a/src/NzbDrone.Core.Test/MediaFiles/MediaFileRepositoryFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/MediaFileRepositoryFixture.cs
index 0475f074e..9f7b33e6b 100644
--- a/src/NzbDrone.Core.Test/MediaFiles/MediaFileRepositoryFixture.cs
+++ b/src/NzbDrone.Core.Test/MediaFiles/MediaFileRepositoryFixture.cs
@@ -1,3 +1,4 @@
+using System.Collections.Generic;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
@@ -17,7 +18,7 @@ namespace NzbDrone.Core.Test.MediaFiles
var files = Builder.CreateListOfSize(10)
.All()
.With(c => c.Id = 0)
- .With(c => c.Language = Language.English)
+ .With(c => c.Languages = new List { Language.English })
.With(c => c.Quality = new QualityModel(Quality.Bluray720p))
.Random(4)
.With(s => s.SeriesId = 12)
diff --git a/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs
index 1462ec672..f4743754b 100644
--- a/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs
+++ b/src/NzbDrone.Core.Test/ParserTests/LanguageParserFixture.cs
@@ -1,3 +1,4 @@
+using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Languages;
@@ -23,8 +24,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Title.the.Spanish.Series.S02E06.Field.of.Cloth.of.Gold.1080p.AMZN.WEBRip.DDP5.1.x264-NTb")]
public void should_parse_language_english(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Should().Be(Language.English);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Should().Be(Language.English);
}
[TestCase("Series Title - S01E01 - Pilot.sub")]
@@ -59,8 +60,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Title.S01.720p.TRUEFRENCH.WEB-DL.AAC2.0.H.264-BTN")]
public void should_parse_language_french(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.French.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.French.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Spanish.HDTV.XviD-LOL")]
@@ -68,8 +69,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Series Title - Temporada 2 [HDTV 720p][Cap.206][AC3 5.1 Español Castellano]")]
public void should_parse_language_spanish(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Spanish.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Spanish.Id);
}
[TestCase("Title.the.Series.2009.S01E14.German.HDTV.XviD-LOL")]
@@ -78,45 +79,45 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Series.Title.S01E03.Ger.Dub.AAC.1080p.WebDL.x264-TKP21")]
public void should_parse_language_german(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.German.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.German.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Italian.HDTV.XviD-LOL")]
[TestCase("Title.the.Series.1x19.ita.720p.bdmux.x264-novarip")]
public void should_parse_language_italian(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Italian.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Italian.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Danish.HDTV.XviD-LOL")]
public void should_parse_language_danish(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Danish.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Danish.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Dutch.HDTV.XviD-LOL")]
public void should_parse_language_dutch(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Dutch.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Dutch.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Japanese.HDTV.XviD-LOL")]
public void should_parse_language_japanese(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Japanese.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Japanese.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Icelandic.HDTV.XviD-LOL")]
[TestCase("Title.the.Series.S01E03.1080p.WEB-DL.DD5.1.H.264-SbR Icelandic")]
public void should_parse_language_icelandic(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Icelandic.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Icelandic.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Chinese.HDTV.XviD-LOL")]
@@ -134,23 +135,23 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("[喵萌奶茶屋&LoliHouse] 拳愿阿修罗 / Kengan Ashura - 17 [WebRip 1080p HEVC-10bit AAC][中日双语字幕]")]
public void should_parse_language_chinese(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Chinese.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Chinese.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Korean.HDTV.XviD-LOL")]
public void should_parse_language_korean(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Korean.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Korean.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Russian.HDTV.XviD-LOL")]
[TestCase("Title.the.Series.S01E01.1080p.WEB-DL.Rus.Eng.TVKlondike")]
public void should_parse_language_russian(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Russian.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Russian.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Polish.HDTV.XviD-LOL")]
@@ -165,64 +166,64 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Title.the.Series.2009.S01E14.DUB-PL.HDTV.XviD-LOL")]
public void should_parse_language_polish(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Polish.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Polish.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Vietnamese.HDTV.XviD-LOL")]
public void should_parse_language_vietnamese(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Vietnamese.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Vietnamese.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Swedish.HDTV.XviD-LOL")]
public void should_parse_language_swedish(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Swedish.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Swedish.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Norwegian.HDTV.XviD-LOL")]
public void should_parse_language_norwegian(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Norwegian.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Norwegian.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Finnish.HDTV.XviD-LOL")]
public void should_parse_language_finnish(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Finnish.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Finnish.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Turkish.HDTV.XviD-LOL")]
public void should_parse_language_turkish(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Turkish.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Turkish.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Portuguese.HDTV.XviD-LOL")]
public void should_parse_language_portuguese(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Portuguese.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Portuguese.Id);
}
[TestCase("Title.the.Series.S01E01.FLEMISH.HDTV.x264-BRiGAND")]
public void should_parse_language_flemish(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Flemish.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Flemish.Id);
}
[TestCase("Title.the.Series.S03E13.Greek.PDTV.XviD-Ouzo")]
public void should_parse_language_greek(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Greek.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Greek.Id);
}
[TestCase("Title.the.Series.2009.S01E14.HDTV.XviD.HUNDUB-LOL")]
@@ -230,44 +231,44 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Title.the.Series.2009.S01E14.HDTV.XviD.HUN-LOL")]
public void should_parse_language_hungarian(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Hungarian.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Hungarian.Id);
}
[TestCase("Title.the.Series.S01-03.DVDRip.HebDub")]
public void should_parse_language_hebrew(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Hebrew.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Hebrew.Id);
}
[TestCase("Title.the.Series.S05E01.WEBRip.x264.AC3.LT.EN-CNN")]
public void should_parse_language_lithuanian(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Lithuanian.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Lithuanian.Id);
}
[TestCase("Title.the.Series.S07E11.WEB Rip.XviD.Louige-CZ.EN.5.1")]
public void should_parse_language_czech(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Czech.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Czech.Id);
}
[TestCase("Series Title.S01.ARABIC.COMPLETE.720p.NF.WEBRip.x264-PTV")]
public void should_parse_language_arabic(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Arabic.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Arabic.Id);
}
[TestCase("The Shadow Series S01 E01-08 WebRip Dual Audio [Hindi 5.1 + English 5.1] 720p x264 AAC ESub")]
[TestCase("The Final Sonarr (2020) S04 Complete 720p NF WEBRip [Hindi+English] Dual audio")]
public void should_parse_language_hindi(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Hindi.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Hindi.Id);
}
[TestCase("Title.the.Series.2009.S01E14.Bulgarian.HDTV.XviD-LOL")]
@@ -275,8 +276,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Title.the.Series.2009.S01E14.BG.AUDIO.HDTV.XviD-LOL")]
public void should_parse_language_bulgarian(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Bulgarian.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Bulgarian.Id);
}
[TestCase("Series Title S01E01 Malayalam.1080p.WebRip.AVC.5.1-Rjaa")]
@@ -284,8 +285,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Series.Title.S01E01.DVDRip.1CD.Malayalam.Xvid.MP3 @Mastitorrents")]
public void should_parse_language_malayalam(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Malayalam.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Malayalam.Id);
}
[TestCase("Гало(Сезон 1, серії 1-5) / SeriesTitle(Season 1, episodes 1-5) (2022) WEBRip-AVC Ukr/Eng")]
@@ -293,8 +294,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Книга Боби Фетта(Сезон 1) / Series Title(Season 1) (2021) WEB-DLRip Ukr/Eng")]
public void should_parse_language_ukrainian(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Id.Should().Be(Language.Ukrainian.Id);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Id.Should().Be(Language.Ukrainian.Id);
}
[TestCase("Title.the.Russian.Series.S01E07.Cold.Action.HDTV.XviD-Droned")]
@@ -304,8 +305,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Title The Spanish S02E02 Flodden 720p AMZN WEB-DL DDP5 1 H 264-NTb")]
public void should_not_parse_series_or_episode_title(string postTitle)
{
- var result = LanguageParser.ParseLanguage(postTitle);
- result.Name.Should().Be(Language.English.Name);
+ var result = LanguageParser.ParseLanguages(postTitle);
+ result.First().Name.Should().Be(Language.English.Name);
}
}
}
diff --git a/src/NzbDrone.Core.Test/Profiles/QualityProfileServiceFixture.cs b/src/NzbDrone.Core.Test/Profiles/QualityProfileServiceFixture.cs
index f04b45a9c..9dc0ec291 100644
--- a/src/NzbDrone.Core.Test/Profiles/QualityProfileServiceFixture.cs
+++ b/src/NzbDrone.Core.Test/Profiles/QualityProfileServiceFixture.cs
@@ -101,7 +101,6 @@ namespace NzbDrone.Core.Test.Profiles
var importLists = Builder.CreateListOfSize(3)
.Random(1)
- .With(c => c.LanguageProfileId = 1)
.Build().ToList();
Mocker.GetMock().Setup(c => c.Get(profile.Id)).Returns(profile);
diff --git a/src/NzbDrone.Core.Test/SeriesStatsTests/SeriesStatisticsFixture.cs b/src/NzbDrone.Core.Test/SeriesStatsTests/SeriesStatisticsFixture.cs
index 7d447ea6b..980107237 100644
--- a/src/NzbDrone.Core.Test/SeriesStatsTests/SeriesStatisticsFixture.cs
+++ b/src/NzbDrone.Core.Test/SeriesStatsTests/SeriesStatisticsFixture.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Linq;
using FizzWare.NBuilder;
using FluentAssertions;
@@ -38,7 +39,7 @@ namespace NzbDrone.Core.Test.SeriesStatsTests
_episodeFile = Builder