@@ -157,7 +157,7 @@ class Blacklist extends Component {
{
!isFetching && !!error &&
- {translate('UnableToLoadBlacklist')}
+ {translate('UnableToLoadBlocklist')}
}
@@ -183,7 +183,7 @@ class Blacklist extends Component {
{
items.map((item) => {
return (
- state.blocklist,
+ createCommandExecutingSelector(commandNames.CLEAR_BLOCKLIST),
+ (blocklist, isClearingBlocklistExecuting) => {
+ return {
+ isClearingBlocklistExecuting,
+ ...blocklist
+ };
+ }
+ );
+}
+
+const mapDispatchToProps = {
+ ...blocklistActions,
+ executeCommand
+};
+
+class BlocklistConnector extends Component {
+
+ //
+ // Lifecycle
+
+ componentDidMount() {
+ const {
+ useCurrentPage,
+ fetchBlocklist,
+ gotoBlocklistFirstPage
+ } = this.props;
+
+ registerPagePopulator(this.repopulate);
+
+ if (useCurrentPage) {
+ fetchBlocklist();
+ } else {
+ gotoBlocklistFirstPage();
+ }
+ }
+
+ componentDidUpdate(prevProps) {
+ if (prevProps.isClearingBlocklistExecuting && !this.props.isClearingBlocklistExecuting) {
+ this.props.gotoBlocklistFirstPage();
+ }
+ }
+
+ componentWillUnmount() {
+ this.props.clearBlocklist();
+ unregisterPagePopulator(this.repopulate);
+ }
+
+ //
+ // Control
+
+ repopulate = () => {
+ this.props.fetchBlocklist();
+ }
+ //
+ // Listeners
+
+ onFirstPagePress = () => {
+ this.props.gotoBlocklistFirstPage();
+ }
+
+ onPreviousPagePress = () => {
+ this.props.gotoBlocklistPreviousPage();
+ }
+
+ onNextPagePress = () => {
+ this.props.gotoBlocklistNextPage();
+ }
+
+ onLastPagePress = () => {
+ this.props.gotoBlocklistLastPage();
+ }
+
+ onPageSelect = (page) => {
+ this.props.gotoBlocklistPage({ page });
+ }
+
+ onRemoveSelected = (ids) => {
+ this.props.removeBlocklistItems({ ids });
+ }
+
+ onSortPress = (sortKey) => {
+ this.props.setBlocklistSort({ sortKey });
+ }
+
+ onTableOptionChange = (payload) => {
+ this.props.setBlocklistTableOption(payload);
+
+ if (payload.pageSize) {
+ this.props.gotoBlocklistFirstPage();
+ }
+ }
+
+ onClearBlocklistPress = () => {
+ this.props.executeCommand({ name: commandNames.CLEAR_BLOCKLIST });
+ }
+
+ //
+ // Render
+
+ render() {
+ return (
+
+ );
+ }
+}
+
+BlocklistConnector.propTypes = {
+ useCurrentPage: PropTypes.bool.isRequired,
+ isClearingBlocklistExecuting: PropTypes.bool.isRequired,
+ items: PropTypes.arrayOf(PropTypes.object).isRequired,
+ fetchBlocklist: PropTypes.func.isRequired,
+ gotoBlocklistFirstPage: PropTypes.func.isRequired,
+ gotoBlocklistPreviousPage: PropTypes.func.isRequired,
+ gotoBlocklistNextPage: PropTypes.func.isRequired,
+ gotoBlocklistLastPage: PropTypes.func.isRequired,
+ gotoBlocklistPage: PropTypes.func.isRequired,
+ removeBlocklistItems: PropTypes.func.isRequired,
+ setBlocklistSort: PropTypes.func.isRequired,
+ setBlocklistTableOption: PropTypes.func.isRequired,
+ clearBlocklist: PropTypes.func.isRequired,
+ executeCommand: PropTypes.func.isRequired
+};
+
+export default withCurrentPage(
+ connect(createMapStateToProps, mapDispatchToProps)(BlocklistConnector)
+);
diff --git a/frontend/src/Activity/Blacklist/BlacklistDetailsModal.js b/frontend/src/Activity/Blocklist/BlocklistDetailsModal.js
similarity index 94%
rename from frontend/src/Activity/Blacklist/BlacklistDetailsModal.js
rename to frontend/src/Activity/Blocklist/BlocklistDetailsModal.js
index 9b8cf07c8..5f8b98d3d 100644
--- a/frontend/src/Activity/Blacklist/BlacklistDetailsModal.js
+++ b/frontend/src/Activity/Blocklist/BlocklistDetailsModal.js
@@ -10,7 +10,7 @@ import ModalFooter from 'Components/Modal/ModalFooter';
import ModalHeader from 'Components/Modal/ModalHeader';
import translate from 'Utilities/String/translate';
-class BlacklistDetailsModal extends Component {
+class BlocklistDetailsModal extends Component {
//
// Render
@@ -78,7 +78,7 @@ class BlacklistDetailsModal extends Component {
}
}
-BlacklistDetailsModal.propTypes = {
+BlocklistDetailsModal.propTypes = {
isOpen: PropTypes.bool.isRequired,
sourceTitle: PropTypes.string.isRequired,
protocol: PropTypes.string.isRequired,
@@ -87,4 +87,4 @@ BlacklistDetailsModal.propTypes = {
onModalClose: PropTypes.func.isRequired
};
-export default BlacklistDetailsModal;
+export default BlocklistDetailsModal;
diff --git a/frontend/src/Activity/Blacklist/BlacklistRow.css b/frontend/src/Activity/Blocklist/BlocklistRow.css
similarity index 100%
rename from frontend/src/Activity/Blacklist/BlacklistRow.css
rename to frontend/src/Activity/Blocklist/BlocklistRow.css
diff --git a/frontend/src/Activity/Blacklist/BlacklistRow.js b/frontend/src/Activity/Blocklist/BlocklistRow.js
similarity index 94%
rename from frontend/src/Activity/Blacklist/BlacklistRow.js
rename to frontend/src/Activity/Blocklist/BlocklistRow.js
index 1eb45360d..65d6a2310 100644
--- a/frontend/src/Activity/Blacklist/BlacklistRow.js
+++ b/frontend/src/Activity/Blocklist/BlocklistRow.js
@@ -11,10 +11,10 @@ import MovieLanguage from 'Movie/MovieLanguage';
import MovieQuality from 'Movie/MovieQuality';
import MovieTitleLink from 'Movie/MovieTitleLink';
import translate from 'Utilities/String/translate';
-import BlacklistDetailsModal from './BlacklistDetailsModal';
-import styles from './BlacklistRow.css';
+import BlocklistDetailsModal from './BlocklistDetailsModal';
+import styles from './BlocklistRow.css';
-class BlacklistRow extends Component {
+class BlocklistRow extends Component {
//
// Lifecycle
@@ -166,7 +166,7 @@ class BlacklistRow extends Component {
/>
{
+ onRemoveQueueItemModalConfirmed = (blocklist) => {
const {
onRemoveQueueItemPress,
onQueueRowModalOpenOrClose
} = this.props;
onQueueRowModalOpenOrClose(false);
- onRemoveQueueItemPress(blacklist);
+ onRemoveQueueItemPress(blocklist);
this.setState({ isRemoveQueueItemModalOpen: false });
}
diff --git a/frontend/src/Activity/Queue/RemoveQueueItemModal.js b/frontend/src/Activity/Queue/RemoveQueueItemModal.js
index c77248c11..fb039eb8e 100644
--- a/frontend/src/Activity/Queue/RemoveQueueItemModal.js
+++ b/frontend/src/Activity/Queue/RemoveQueueItemModal.js
@@ -22,7 +22,7 @@ class RemoveQueueItemModal extends Component {
this.state = {
remove: true,
- blacklist: false
+ blocklist: false
};
}
@@ -32,7 +32,7 @@ class RemoveQueueItemModal extends Component {
resetState = function() {
this.setState({
remove: true,
- blacklist: false
+ blocklist: false
});
}
@@ -43,8 +43,8 @@ class RemoveQueueItemModal extends Component {
this.setState({ remove: value });
}
- onBlacklistChange = ({ value }) => {
- this.setState({ blacklist: value });
+ onBlocklistChange = ({ value }) => {
+ this.setState({ blocklist: value });
}
onRemoveConfirmed = () => {
@@ -69,7 +69,7 @@ class RemoveQueueItemModal extends Component {
canIgnore
} = this.props;
- const { remove, blacklist } = this.state;
+ const { remove, blocklist } = this.state;
return (
- {translate('BlacklistRelease')}
+ {translate('BlocklistRelease')}
diff --git a/frontend/src/Activity/Queue/RemoveQueueItemsModal.js b/frontend/src/Activity/Queue/RemoveQueueItemsModal.js
index aeea42dfc..e75456f4c 100644
--- a/frontend/src/Activity/Queue/RemoveQueueItemsModal.js
+++ b/frontend/src/Activity/Queue/RemoveQueueItemsModal.js
@@ -23,7 +23,7 @@ class RemoveQueueItemsModal extends Component {
this.state = {
remove: true,
- blacklist: false
+ blocklist: false
};
}
@@ -33,7 +33,7 @@ class RemoveQueueItemsModal extends Component {
resetState = function() {
this.setState({
remove: true,
- blacklist: false
+ blocklist: false
});
}
@@ -44,8 +44,8 @@ class RemoveQueueItemsModal extends Component {
this.setState({ remove: value });
}
- onBlacklistChange = ({ value }) => {
- this.setState({ blacklist: value });
+ onBlocklistChange = ({ value }) => {
+ this.setState({ blocklist: value });
}
onRemoveConfirmed = () => {
@@ -70,7 +70,7 @@ class RemoveQueueItemsModal extends Component {
canIgnore
} = this.props;
- const { remove, blacklist } = this.state;
+ const { remove, blocklist } = this.state;
return (
- Blacklist Release{selectedCount > 1 ? 's' : ''}
+ Blocklist Release{selectedCount > 1 ? 's' : ''}
diff --git a/frontend/src/App/AppRoutes.js b/frontend/src/App/AppRoutes.js
index 0cea72088..6ad82854c 100644
--- a/frontend/src/App/AppRoutes.js
+++ b/frontend/src/App/AppRoutes.js
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import { Redirect, Route } from 'react-router-dom';
-import BlacklistConnector from 'Activity/Blacklist/BlacklistConnector';
+import BlocklistConnector from 'Activity/Blocklist/BlocklistConnector';
import HistoryConnector from 'Activity/History/HistoryConnector';
import QueueConnector from 'Activity/Queue/QueueConnector';
import AddNewMovieConnector from 'AddMovie/AddNewMovie/AddNewMovieConnector';
@@ -111,8 +111,8 @@ function AppRoutes(props) {
/>
{/*
diff --git a/frontend/src/Commands/commandNames.js b/frontend/src/Commands/commandNames.js
index 25ac29640..b91bf665c 100644
--- a/frontend/src/Commands/commandNames.js
+++ b/frontend/src/Commands/commandNames.js
@@ -1,7 +1,7 @@
export const APPLICATION_UPDATE = 'ApplicationUpdate';
export const BACKUP = 'Backup';
export const REFRESH_MONITORED_DOWNLOADS = 'RefreshMonitoredDownloads';
-export const CLEAR_BLACKLIST = 'ClearBlacklist';
+export const CLEAR_BLOCKLIST = 'ClearBlocklist';
export const CLEAR_LOGS = 'ClearLog';
export const CUTOFF_UNMET_MOVIES_SEARCH = 'CutoffUnmetMoviesSearch';
export const DELETE_LOG_FILES = 'DeleteLogFiles';
diff --git a/frontend/src/Components/Page/Sidebar/PageSidebar.js b/frontend/src/Components/Page/Sidebar/PageSidebar.js
index 606253312..b886b9ba1 100644
--- a/frontend/src/Components/Page/Sidebar/PageSidebar.js
+++ b/frontend/src/Components/Page/Sidebar/PageSidebar.js
@@ -61,8 +61,8 @@ const links = [
to: '/activity/history'
},
{
- title: translate('Blacklist'),
- to: '/activity/blacklist'
+ title: translate('Blocklist'),
+ to: '/activity/blocklist'
}
]
},
diff --git a/frontend/src/Helpers/Props/icons.js b/frontend/src/Helpers/Props/icons.js
index a3db55564..2e867329e 100644
--- a/frontend/src/Helpers/Props/icons.js
+++ b/frontend/src/Helpers/Props/icons.js
@@ -225,4 +225,4 @@ export const UNSAVED_SETTING = farDotCircle;
export const VIEW = fasEye;
export const WARNING = fasExclamationTriangle;
export const WIKI = fasBookReader;
-export const BLACKLIST = fasBan;
+export const BLOCKLIST = fasBan;
diff --git a/frontend/src/InteractiveSearch/InteractiveSearchRow.css b/frontend/src/InteractiveSearch/InteractiveSearchRow.css
index 4c1ef59c0..6545102ca 100644
--- a/frontend/src/InteractiveSearch/InteractiveSearchRow.css
+++ b/frontend/src/InteractiveSearch/InteractiveSearchRow.css
@@ -67,6 +67,6 @@
width: 75px;
}
-.blacklist {
+.blocklist {
margin-left: 5px;
}
diff --git a/frontend/src/InteractiveSearch/InteractiveSearchRow.js b/frontend/src/InteractiveSearch/InteractiveSearchRow.js
index 51a9033ce..e653bc5df 100644
--- a/frontend/src/InteractiveSearch/InteractiveSearchRow.js
+++ b/frontend/src/InteractiveSearch/InteractiveSearchRow.js
@@ -127,7 +127,7 @@ class InteractiveSearchRow extends Component {
grabError,
historyGrabbedData,
historyFailedData,
- blacklistData
+ blocklistData
} = this.props;
return (
@@ -221,12 +221,12 @@ class InteractiveSearchRow extends Component {
}
{
- blacklistData?.date &&
+ blocklistData?.date &&
}
@@ -341,7 +341,7 @@ InteractiveSearchRow.propTypes = {
onGrabPress: PropTypes.func.isRequired,
historyFailedData: PropTypes.object,
historyGrabbedData: PropTypes.object,
- blacklistData: PropTypes.object
+ blocklistData: PropTypes.object
};
InteractiveSearchRow.defaultProps = {
diff --git a/frontend/src/InteractiveSearch/InteractiveSearchRowConnector.js b/frontend/src/InteractiveSearch/InteractiveSearchRowConnector.js
index a8d6c6702..22ebccd3d 100644
--- a/frontend/src/InteractiveSearch/InteractiveSearchRowConnector.js
+++ b/frontend/src/InteractiveSearch/InteractiveSearchRowConnector.js
@@ -8,22 +8,22 @@ function createMapStateToProps() {
return createSelector(
(state, { guid }) => guid,
(state) => state.movieHistory.items,
- (state) => state.movieBlacklist.items,
- (guid, movieHistory, movieBlacklist) => {
+ (state) => state.movieBlocklist.items,
+ (guid, movieHistory, movieBlocklist) => {
- let blacklistData = {};
+ let blocklistData = {};
let historyFailedData = {};
const historyGrabbedData = movieHistory.find((movie) => movie.eventType === 'grabbed' && movie.data.guid === guid);
if (historyGrabbedData) {
historyFailedData = movieHistory.find((movie) => movie.eventType === 'downloadFailed' && movie.sourceTitle === historyGrabbedData.sourceTitle);
- blacklistData = movieBlacklist.find((item) => item.sourceTitle === historyGrabbedData.sourceTitle);
+ blocklistData = movieBlocklist.find((item) => item.sourceTitle === historyGrabbedData.sourceTitle);
}
return {
historyGrabbedData,
historyFailedData,
- blacklistData
+ blocklistData
};
}
);
@@ -38,7 +38,7 @@ class InteractiveSearchRowConnector extends Component {
const {
historyGrabbedData,
historyFailedData,
- blacklistData,
+ blocklistData,
...otherProps
} = this.props;
@@ -46,7 +46,7 @@ class InteractiveSearchRowConnector extends Component {
);
@@ -56,7 +56,7 @@ class InteractiveSearchRowConnector extends Component {
InteractiveSearchRowConnector.propTypes = {
historyGrabbedData: PropTypes.object,
historyFailedData: PropTypes.object,
- blacklistData: PropTypes.object
+ blocklistData: PropTypes.object
};
export default connect(createMapStateToProps)(InteractiveSearchRowConnector);
diff --git a/frontend/src/Movie/Details/MovieDetailsConnector.js b/frontend/src/Movie/Details/MovieDetailsConnector.js
index f2c51788b..127167f5d 100644
--- a/frontend/src/Movie/Details/MovieDetailsConnector.js
+++ b/frontend/src/Movie/Details/MovieDetailsConnector.js
@@ -8,7 +8,7 @@ import * as commandNames from 'Commands/commandNames';
import { executeCommand } from 'Store/Actions/commandActions';
import { clearExtraFiles, fetchExtraFiles } from 'Store/Actions/extraFileActions';
import { toggleMovieMonitored } from 'Store/Actions/movieActions';
-import { clearMovieBlacklist, fetchMovieBlacklist } from 'Store/Actions/movieBlacklistActions';
+import { clearMovieBlocklist, fetchMovieBlocklist } from 'Store/Actions/movieBlocklistActions';
import { clearMovieCredits, fetchMovieCredits } from 'Store/Actions/movieCreditsActions';
import { clearMovieFiles, fetchMovieFiles } from 'Store/Actions/movieFileActions';
import { clearMovieHistory, fetchMovieHistory } from 'Store/Actions/movieHistoryActions';
@@ -222,11 +222,11 @@ function createMapDispatchToProps(dispatch, props) {
onGoToMovie(titleSlug) {
dispatch(push(`${window.Radarr.urlBase}/movie/${titleSlug}`));
},
- dispatchFetchMovieBlacklist({ movieId }) {
- dispatch(fetchMovieBlacklist({ movieId }));
+ dispatchFetchMovieBlocklist({ movieId }) {
+ dispatch(fetchMovieBlocklist({ movieId }));
},
- dispatchClearMovieBlacklist() {
- dispatch(clearMovieBlacklist());
+ dispatchClearMovieBlocklist() {
+ dispatch(clearMovieBlocklist());
}
};
}
@@ -280,7 +280,7 @@ class MovieDetailsConnector extends Component {
const movieId = this.props.id;
this.props.dispatchFetchMovieFiles({ movieId });
- this.props.dispatchFetchMovieBlacklist({ movieId });
+ this.props.dispatchFetchMovieBlocklist({ movieId });
this.props.dispatchFetchMovieHistory({ movieId });
this.props.dispatchFetchExtraFiles({ movieId });
this.props.dispatchFetchMovieCredits({ movieId });
@@ -290,7 +290,7 @@ class MovieDetailsConnector extends Component {
unpopulate = () => {
this.props.dispatchCancelFetchReleases();
- this.props.dispatchClearMovieBlacklist();
+ this.props.dispatchClearMovieBlocklist();
this.props.dispatchClearMovieFiles();
this.props.dispatchClearMovieHistory();
this.props.dispatchClearExtraFiles();
@@ -362,8 +362,8 @@ MovieDetailsConnector.propTypes = {
dispatchClearQueueDetails: PropTypes.func.isRequired,
dispatchFetchImportListSchema: PropTypes.func.isRequired,
dispatchExecuteCommand: PropTypes.func.isRequired,
- dispatchFetchMovieBlacklist: PropTypes.func.isRequired,
- dispatchClearMovieBlacklist: PropTypes.func.isRequired,
+ dispatchFetchMovieBlocklist: PropTypes.func.isRequired,
+ dispatchClearMovieBlocklist: PropTypes.func.isRequired,
onGoToMovie: PropTypes.func.isRequired
};
diff --git a/frontend/src/Settings/CustomFormats/CustomFormats/ExportCustomFormatModalContentConnector.js b/frontend/src/Settings/CustomFormats/CustomFormats/ExportCustomFormatModalContentConnector.js
index f762f44e7..521d83d41 100644
--- a/frontend/src/Settings/CustomFormats/CustomFormats/ExportCustomFormatModalContentConnector.js
+++ b/frontend/src/Settings/CustomFormats/CustomFormats/ExportCustomFormatModalContentConnector.js
@@ -6,10 +6,10 @@ import { fetchCustomFormatSpecifications } from 'Store/Actions/settingsActions';
import createProviderSettingsSelector from 'Store/Selectors/createProviderSettingsSelector';
import ExportCustomFormatModalContent from './ExportCustomFormatModalContent';
-const blacklistedProperties = ['id', 'implementationName', 'infoLink'];
+const omittedProperties = ['id', 'implementationName', 'infoLink'];
function replacer(key, value) {
- if (blacklistedProperties.includes(key)) {
+ if (omittedProperties.includes(key)) {
return undefined;
}
diff --git a/frontend/src/Store/Actions/Creators/createHandleActions.js b/frontend/src/Store/Actions/Creators/createHandleActions.js
index 2f1954559..817cfda24 100644
--- a/frontend/src/Store/Actions/Creators/createHandleActions.js
+++ b/frontend/src/Store/Actions/Creators/createHandleActions.js
@@ -10,7 +10,7 @@ import {
import getSectionState from 'Utilities/State/getSectionState';
import updateSectionState from 'Utilities/State/updateSectionState';
-const blacklistedProperties = [
+const omittedProperties = [
'section',
'id'
];
@@ -31,7 +31,7 @@ export default function createHandleActions(handlers, defaultState, section) {
if (section === baseSection) {
const newState = Object.assign(getSectionState(state, payloadSection),
- _.omit(payload, blacklistedProperties));
+ _.omit(payload, omittedProperties));
return updateSectionState(state, payloadSection, newState);
}
diff --git a/frontend/src/Store/Actions/blacklistActions.js b/frontend/src/Store/Actions/blocklistActions.js
similarity index 61%
rename from frontend/src/Store/Actions/blacklistActions.js
rename to frontend/src/Store/Actions/blocklistActions.js
index 51e9330e7..35a08efe5 100644
--- a/frontend/src/Store/Actions/blacklistActions.js
+++ b/frontend/src/Store/Actions/blocklistActions.js
@@ -15,7 +15,7 @@ import createSetTableOptionReducer from './Creators/Reducers/createSetTableOptio
//
// Variables
-export const section = 'blacklist';
+export const section = 'blocklist';
//
// State
@@ -83,41 +83,41 @@ export const defaultState = {
};
export const persistState = [
- 'blacklist.pageSize',
- 'blacklist.sortKey',
- 'blacklist.sortDirection',
- 'blacklist.columns'
+ 'blocklist.pageSize',
+ 'blocklist.sortKey',
+ 'blocklist.sortDirection',
+ 'blocklist.columns'
];
//
// Action Types
-export const FETCH_BLACKLIST = 'blacklist/fetchBlacklist';
-export const GOTO_FIRST_BLACKLIST_PAGE = 'blacklist/gotoBlacklistFirstPage';
-export const GOTO_PREVIOUS_BLACKLIST_PAGE = 'blacklist/gotoBlacklistPreviousPage';
-export const GOTO_NEXT_BLACKLIST_PAGE = 'blacklist/gotoBlacklistNextPage';
-export const GOTO_LAST_BLACKLIST_PAGE = 'blacklist/gotoBlacklistLastPage';
-export const GOTO_BLACKLIST_PAGE = 'blacklist/gotoBlacklistPage';
-export const SET_BLACKLIST_SORT = 'blacklist/setBlacklistSort';
-export const SET_BLACKLIST_TABLE_OPTION = 'blacklist/setBlacklistTableOption';
-export const REMOVE_BLACKLIST_ITEM = 'blacklist/removeBlacklistItem';
-export const REMOVE_BLACKLIST_ITEMS = 'blacklist/removeBlacklistItems';
-export const CLEAR_BLACKLIST = 'blacklist/clearBlacklist';
+export const FETCH_BLOCKLIST = 'blocklist/fetchBlocklist';
+export const GOTO_FIRST_BLOCKLIST_PAGE = 'blocklist/gotoBlocklistFirstPage';
+export const GOTO_PREVIOUS_BLOCKLIST_PAGE = 'blocklist/gotoBlocklistPreviousPage';
+export const GOTO_NEXT_BLOCKLIST_PAGE = 'blocklist/gotoBlocklistNextPage';
+export const GOTO_LAST_BLOCKLIST_PAGE = 'blocklist/gotoBlocklistLastPage';
+export const GOTO_BLOCKLIST_PAGE = 'blocklist/gotoBlocklistPage';
+export const SET_BLOCKLIST_SORT = 'blocklist/setBlocklistSort';
+export const SET_BLOCKLIST_TABLE_OPTION = 'blocklist/setBlocklistTableOption';
+export const REMOVE_BLOCKLIST_ITEM = 'blocklist/removeBlocklistItem';
+export const REMOVE_BLOCKLIST_ITEMS = 'blocklist/removeBlocklistItems';
+export const CLEAR_BLOCKLIST = 'blocklist/clearBlocklist';
//
// Action Creators
-export const fetchBlacklist = createThunk(FETCH_BLACKLIST);
-export const gotoBlacklistFirstPage = createThunk(GOTO_FIRST_BLACKLIST_PAGE);
-export const gotoBlacklistPreviousPage = createThunk(GOTO_PREVIOUS_BLACKLIST_PAGE);
-export const gotoBlacklistNextPage = createThunk(GOTO_NEXT_BLACKLIST_PAGE);
-export const gotoBlacklistLastPage = createThunk(GOTO_LAST_BLACKLIST_PAGE);
-export const gotoBlacklistPage = createThunk(GOTO_BLACKLIST_PAGE);
-export const setBlacklistSort = createThunk(SET_BLACKLIST_SORT);
-export const setBlacklistTableOption = createAction(SET_BLACKLIST_TABLE_OPTION);
-export const removeBlacklistItem = createThunk(REMOVE_BLACKLIST_ITEM);
-export const removeBlacklistItems = createThunk(REMOVE_BLACKLIST_ITEMS);
-export const clearBlacklist = createAction(CLEAR_BLACKLIST);
+export const fetchBlocklist = createThunk(FETCH_BLOCKLIST);
+export const gotoBlocklistFirstPage = createThunk(GOTO_FIRST_BLOCKLIST_PAGE);
+export const gotoBlocklistPreviousPage = createThunk(GOTO_PREVIOUS_BLOCKLIST_PAGE);
+export const gotoBlocklistNextPage = createThunk(GOTO_NEXT_BLOCKLIST_PAGE);
+export const gotoBlocklistLastPage = createThunk(GOTO_LAST_BLOCKLIST_PAGE);
+export const gotoBlocklistPage = createThunk(GOTO_BLOCKLIST_PAGE);
+export const setBlocklistSort = createThunk(SET_BLOCKLIST_SORT);
+export const setBlocklistTableOption = createAction(SET_BLOCKLIST_TABLE_OPTION);
+export const removeBlocklistItem = createThunk(REMOVE_BLOCKLIST_ITEM);
+export const removeBlocklistItems = createThunk(REMOVE_BLOCKLIST_ITEMS);
+export const clearBlocklist = createAction(CLEAR_BLOCKLIST);
//
// Action Handlers
@@ -125,21 +125,21 @@ export const clearBlacklist = createAction(CLEAR_BLACKLIST);
export const actionHandlers = handleThunks({
...createServerSideCollectionHandlers(
section,
- '/blacklist',
- fetchBlacklist,
+ '/blocklist',
+ fetchBlocklist,
{
- [serverSideCollectionHandlers.FETCH]: FETCH_BLACKLIST,
- [serverSideCollectionHandlers.FIRST_PAGE]: GOTO_FIRST_BLACKLIST_PAGE,
- [serverSideCollectionHandlers.PREVIOUS_PAGE]: GOTO_PREVIOUS_BLACKLIST_PAGE,
- [serverSideCollectionHandlers.NEXT_PAGE]: GOTO_NEXT_BLACKLIST_PAGE,
- [serverSideCollectionHandlers.LAST_PAGE]: GOTO_LAST_BLACKLIST_PAGE,
- [serverSideCollectionHandlers.EXACT_PAGE]: GOTO_BLACKLIST_PAGE,
- [serverSideCollectionHandlers.SORT]: SET_BLACKLIST_SORT
+ [serverSideCollectionHandlers.FETCH]: FETCH_BLOCKLIST,
+ [serverSideCollectionHandlers.FIRST_PAGE]: GOTO_FIRST_BLOCKLIST_PAGE,
+ [serverSideCollectionHandlers.PREVIOUS_PAGE]: GOTO_PREVIOUS_BLOCKLIST_PAGE,
+ [serverSideCollectionHandlers.NEXT_PAGE]: GOTO_NEXT_BLOCKLIST_PAGE,
+ [serverSideCollectionHandlers.LAST_PAGE]: GOTO_LAST_BLOCKLIST_PAGE,
+ [serverSideCollectionHandlers.EXACT_PAGE]: GOTO_BLOCKLIST_PAGE,
+ [serverSideCollectionHandlers.SORT]: SET_BLOCKLIST_SORT
}),
- [REMOVE_BLACKLIST_ITEM]: createRemoveItemHandler(section, '/blacklist'),
+ [REMOVE_BLOCKLIST_ITEM]: createRemoveItemHandler(section, '/blocklist'),
- [REMOVE_BLACKLIST_ITEMS]: function(getState, payload, dispatch) {
+ [REMOVE_BLOCKLIST_ITEMS]: function(getState, payload, dispatch) {
const {
ids
} = payload;
@@ -157,7 +157,7 @@ export const actionHandlers = handleThunks({
]));
const promise = createAjaxRequest({
- url: '/blacklist/bulk',
+ url: '/blocklist/bulk',
method: 'DELETE',
dataType: 'json',
data: JSON.stringify({ ids })
@@ -165,7 +165,7 @@ export const actionHandlers = handleThunks({
promise.done((data) => {
// Don't use batchActions with thunks
- dispatch(fetchBlacklist());
+ dispatch(fetchBlocklist());
dispatch(set({ section, isRemoving: false }));
});
@@ -191,9 +191,9 @@ export const actionHandlers = handleThunks({
export const reducers = createHandleActions({
- [SET_BLACKLIST_TABLE_OPTION]: createSetTableOptionReducer(section),
+ [SET_BLOCKLIST_TABLE_OPTION]: createSetTableOptionReducer(section),
- [CLEAR_BLACKLIST]: createClearReducer(section, {
+ [CLEAR_BLOCKLIST]: createClearReducer(section, {
isFetching: false,
isPopulated: false,
error: null,
diff --git a/frontend/src/Store/Actions/index.js b/frontend/src/Store/Actions/index.js
index 21c6123a3..a9c3c5e35 100644
--- a/frontend/src/Store/Actions/index.js
+++ b/frontend/src/Store/Actions/index.js
@@ -1,6 +1,6 @@
import * as addMovie from './addMovieActions';
import * as app from './appActions';
-import * as blacklist from './blacklistActions';
+import * as blocklist from './blocklistActions';
import * as calendar from './calendarActions';
import * as captcha from './captchaActions';
import * as commands from './commandActions';
@@ -11,7 +11,7 @@ import * as history from './historyActions';
import * as importMovie from './importMovieActions';
import * as interactiveImportActions from './interactiveImportActions';
import * as movies from './movieActions';
-import * as movieBlacklist from './movieBlacklistActions';
+import * as movieBlocklist from './movieBlocklistActions';
import * as movieCredits from './movieCreditsActions';
import * as movieFiles from './movieFileActions';
import * as movieHistory from './movieHistoryActions';
@@ -30,7 +30,7 @@ import * as tags from './tagActions';
export default [
addMovie,
app,
- blacklist,
+ blocklist,
calendar,
captcha,
commands,
@@ -49,7 +49,7 @@ export default [
releases,
rootFolders,
movies,
- movieBlacklist,
+ movieBlocklist,
movieHistory,
movieIndex,
movieCredits,
diff --git a/frontend/src/Store/Actions/movieBlacklistActions.js b/frontend/src/Store/Actions/movieBlocklistActions.js
similarity index 73%
rename from frontend/src/Store/Actions/movieBlacklistActions.js
rename to frontend/src/Store/Actions/movieBlocklistActions.js
index 08c3c2baf..dd0a92ce9 100644
--- a/frontend/src/Store/Actions/movieBlacklistActions.js
+++ b/frontend/src/Store/Actions/movieBlocklistActions.js
@@ -8,7 +8,7 @@ import createHandleActions from './Creators/createHandleActions';
//
// Variables
-export const section = 'movieBlacklist';
+export const section = 'movieBlocklist';
//
// State
@@ -23,25 +23,25 @@ export const defaultState = {
//
// Actions Types
-export const FETCH_MOVIE_BLACKLIST = 'movieBlacklist/fetchMovieBlacklist';
-export const CLEAR_MOVIE_BLACKLIST = 'movieBlacklist/clearMovieBlacklist';
+export const FETCH_MOVIE_BLOCKLIST = 'movieBlocklist/fetchMovieBlocklist';
+export const CLEAR_MOVIE_BLOCKLIST = 'movieBlocklist/clearMovieBlocklist';
//
// Action Creators
-export const fetchMovieBlacklist = createThunk(FETCH_MOVIE_BLACKLIST);
-export const clearMovieBlacklist = createAction(CLEAR_MOVIE_BLACKLIST);
+export const fetchMovieBlocklist = createThunk(FETCH_MOVIE_BLOCKLIST);
+export const clearMovieBlocklist = createAction(CLEAR_MOVIE_BLOCKLIST);
//
// Action Handlers
export const actionHandlers = handleThunks({
- [FETCH_MOVIE_BLACKLIST]: function(getState, payload, dispatch) {
+ [FETCH_MOVIE_BLOCKLIST]: function(getState, payload, dispatch) {
dispatch(set({ section, isFetching: true }));
const promise = createAjaxRequest({
- url: '/blacklist/movie',
+ url: '/blocklist/movie',
data: payload
}).request;
@@ -74,7 +74,7 @@ export const actionHandlers = handleThunks({
export const reducers = createHandleActions({
- [CLEAR_MOVIE_BLACKLIST]: (state) => {
+ [CLEAR_MOVIE_BLOCKLIST]: (state) => {
return Object.assign({}, state, defaultState);
}
diff --git a/frontend/src/Store/Actions/queueActions.js b/frontend/src/Store/Actions/queueActions.js
index d8ec7679d..0108aa466 100644
--- a/frontend/src/Store/Actions/queueActions.js
+++ b/frontend/src/Store/Actions/queueActions.js
@@ -354,13 +354,13 @@ export const actionHandlers = handleThunks({
const {
id,
remove,
- blacklist
+ blocklist
} = payload;
dispatch(updateItem({ section: paged, id, isRemoving: true }));
const promise = createAjaxRequest({
- url: `/queue/${id}?removeFromClient=${remove}&blacklist=${blacklist}`,
+ url: `/queue/${id}?removeFromClient=${remove}&blocklist=${blocklist}`,
method: 'DELETE'
}).request;
@@ -377,7 +377,7 @@ export const actionHandlers = handleThunks({
const {
ids,
remove,
- blacklist
+ blocklist
} = payload;
dispatch(batchActions([
@@ -393,7 +393,7 @@ export const actionHandlers = handleThunks({
]));
const promise = createAjaxRequest({
- url: `/queue/bulk?removeFromClient=${remove}&blacklist=${blacklist}`,
+ url: `/queue/bulk?removeFromClient=${remove}&blocklist=${blocklist}`,
method: 'DELETE',
dataType: 'json',
data: JSON.stringify({ ids })
diff --git a/frontend/src/Store/Middleware/createPersistState.js b/frontend/src/Store/Middleware/createPersistState.js
index fb1e8d3df..6e94c84e5 100644
--- a/frontend/src/Store/Middleware/createPersistState.js
+++ b/frontend/src/Store/Middleware/createPersistState.js
@@ -1,6 +1,7 @@
import _ from 'lodash';
import persistState from 'redux-localstorage';
import actions from 'Store/Actions';
+import migrate from 'Store/Migrators/migrate';
const columnPaths = [];
@@ -98,6 +99,7 @@ const config = {
export default function createPersistState() {
// Migrate existing local storage before proceeding
const persistedState = JSON.parse(localStorage.getItem(config.key));
+ migrate(persistedState);
localStorage.setItem(config.key, serialize(persistedState));
return persistState(paths, config);
diff --git a/frontend/src/Store/Migrators/migrate.js b/frontend/src/Store/Migrators/migrate.js
new file mode 100644
index 000000000..e6012b871
--- /dev/null
+++ b/frontend/src/Store/Migrators/migrate.js
@@ -0,0 +1,5 @@
+import migrateBlacklistToBlocklist from './migrateBlacklistToBlocklist';
+
+export default function migrate(persistedState) {
+ migrateBlacklistToBlocklist(persistedState);
+}
diff --git a/frontend/src/Store/Migrators/migrateBlacklistToBlocklist.js b/frontend/src/Store/Migrators/migrateBlacklistToBlocklist.js
new file mode 100644
index 000000000..3fc7a889e
--- /dev/null
+++ b/frontend/src/Store/Migrators/migrateBlacklistToBlocklist.js
@@ -0,0 +1,12 @@
+import _, { get } from 'lodash';
+
+export default function migrateBlacklistToBlocklist(persistedState) {
+ const blocklist = get(persistedState, 'blacklist');
+
+ if (!blocklist) {
+ return;
+ }
+
+ persistedState.blocklist = blocklist;
+ _.remove(persistedState, 'blacklist');
+}
diff --git a/src/NzbDrone.Automation.Test/MainPagesTest.cs b/src/NzbDrone.Automation.Test/MainPagesTest.cs
index 713a7144c..3cb35b31a 100644
--- a/src/NzbDrone.Automation.Test/MainPagesTest.cs
+++ b/src/NzbDrone.Automation.Test/MainPagesTest.cs
@@ -52,7 +52,7 @@ namespace NzbDrone.Automation.Test
_page.Find(By.LinkText("Queue")).Should().NotBeNull();
_page.Find(By.LinkText("History")).Should().NotBeNull();
- _page.Find(By.LinkText("Blacklist")).Should().NotBeNull();
+ _page.Find(By.LinkText("Blocklist")).Should().NotBeNull();
}
[Test]
diff --git a/src/NzbDrone.Core.Test/Blacklisting/BlacklistRepositoryFixture.cs b/src/NzbDrone.Core.Test/Blocklisting/BlocklistRepositoryFixture.cs
similarity index 65%
rename from src/NzbDrone.Core.Test/Blacklisting/BlacklistRepositoryFixture.cs
rename to src/NzbDrone.Core.Test/Blocklisting/BlocklistRepositoryFixture.cs
index 49912d890..9da8586c0 100644
--- a/src/NzbDrone.Core.Test/Blacklisting/BlacklistRepositoryFixture.cs
+++ b/src/NzbDrone.Core.Test/Blocklisting/BlocklistRepositoryFixture.cs
@@ -4,25 +4,25 @@ using System.Linq;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
-using NzbDrone.Core.Blacklisting;
+using NzbDrone.Core.Blocklisting;
using NzbDrone.Core.Languages;
using NzbDrone.Core.Movies;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
-namespace NzbDrone.Core.Test.Blacklisting
+namespace NzbDrone.Core.Test.Blocklisting
{
[TestFixture]
- public class BlacklistRepositoryFixture : DbTest
+ public class BlocklistRepositoryFixture : DbTest
{
- private Blacklist _blacklist;
+ private Blocklist _blocklist;
private Movie _movie1;
private Movie _movie2;
[SetUp]
public void Setup()
{
- _blacklist = new Blacklist
+ _blocklist = new Blocklist
{
MovieId = 1234,
Quality = new QualityModel(),
@@ -43,30 +43,30 @@ namespace NzbDrone.Core.Test.Blacklisting
[Test]
public void should_be_able_to_write_to_database()
{
- Subject.Insert(_blacklist);
+ Subject.Insert(_blocklist);
Subject.All().Should().HaveCount(1);
}
[Test]
public void should_should_have_movie_id()
{
- Subject.Insert(_blacklist);
+ Subject.Insert(_blocklist);
- Subject.All().First().MovieId.Should().Be(_blacklist.MovieId);
+ Subject.All().First().MovieId.Should().Be(_blocklist.MovieId);
}
[Test]
- public void should_check_for_blacklisted_title_case_insensative()
+ public void should_check_for_blocklisted_title_case_insensative()
{
- Subject.Insert(_blacklist);
+ Subject.Insert(_blocklist);
- Subject.BlacklistedByTitle(_blacklist.MovieId, _blacklist.SourceTitle.ToUpperInvariant()).Should().HaveCount(1);
+ Subject.BlocklistedByTitle(_blocklist.MovieId, _blocklist.SourceTitle.ToUpperInvariant()).Should().HaveCount(1);
}
[Test]
- public void should_delete_blacklists_by_movieId()
+ public void should_delete_blocklists_by_movieId()
{
- var blacklistItems = Builder.CreateListOfSize(5)
+ var blocklistItems = Builder.CreateListOfSize(5)
.TheFirst(1)
.With(c => c.MovieId = _movie2.Id)
.TheRest()
@@ -77,15 +77,15 @@ namespace NzbDrone.Core.Test.Blacklisting
.With(c => c.Id = 0)
.BuildListOfNew();
- Db.InsertMany(blacklistItems);
+ Db.InsertMany(blocklistItems);
Subject.DeleteForMovies(new List { _movie1.Id });
- var removedMovieBlacklists = Subject.BlacklistedByMovie(_movie1.Id);
- var nonRemovedMovieBlacklists = Subject.BlacklistedByMovie(_movie2.Id);
+ var removedMovieBlocklists = Subject.BlocklistedByMovie(_movie1.Id);
+ var nonRemovedMovieBlocklists = Subject.BlocklistedByMovie(_movie2.Id);
- removedMovieBlacklists.Should().HaveCount(0);
- nonRemovedMovieBlacklists.Should().HaveCount(1);
+ removedMovieBlocklists.Should().HaveCount(0);
+ nonRemovedMovieBlocklists.Should().HaveCount(1);
}
}
}
diff --git a/src/NzbDrone.Core.Test/Blacklisting/BlacklistServiceFixture.cs b/src/NzbDrone.Core.Test/Blocklisting/BlocklistServiceFixture.cs
similarity index 78%
rename from src/NzbDrone.Core.Test/Blacklisting/BlacklistServiceFixture.cs
rename to src/NzbDrone.Core.Test/Blocklisting/BlocklistServiceFixture.cs
index dfe82adff..f7d7bfda7 100644
--- a/src/NzbDrone.Core.Test/Blacklisting/BlacklistServiceFixture.cs
+++ b/src/NzbDrone.Core.Test/Blocklisting/BlocklistServiceFixture.cs
@@ -1,15 +1,15 @@
using System;
using Moq;
using NUnit.Framework;
-using NzbDrone.Core.Blacklisting;
+using NzbDrone.Core.Blocklisting;
using NzbDrone.Core.Download;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
-namespace NzbDrone.Core.Test.Blacklisting
+namespace NzbDrone.Core.Test.Blocklisting
{
[TestFixture]
- public class BlacklistServiceFixture : CoreTest
+ public class BlocklistServiceFixture : CoreTest
{
private DownloadFailedEvent _event;
@@ -37,8 +37,8 @@ namespace NzbDrone.Core.Test.Blacklisting
{
Subject.Handle(_event);
- Mocker.GetMock()
- .Verify(v => v.Insert(It.Is(b => b.MovieId == _event.MovieId)), Times.Once());
+ Mocker.GetMock()
+ .Verify(v => v.Insert(It.Is(b => b.MovieId == _event.MovieId)), Times.Once());
}
[Test]
@@ -49,8 +49,8 @@ namespace NzbDrone.Core.Test.Blacklisting
_event.Data.Remove("size");
_event.Data.Remove("protocol");
- Mocker.GetMock()
- .Verify(v => v.Insert(It.Is(b => b.MovieId == _event.MovieId)), Times.Once());
+ Mocker.GetMock()
+ .Verify(v => v.Insert(It.Is(b => b.MovieId == _event.MovieId)), Times.Once());
}
}
}
diff --git a/src/NzbDrone.Core.Test/Files/Indexers/TorrentRss/ImmortalSeed.xml b/src/NzbDrone.Core.Test/Files/Indexers/TorrentRss/ImmortalSeed.xml
index 801acdaea..f3438962a 100644
--- a/src/NzbDrone.Core.Test/Files/Indexers/TorrentRss/ImmortalSeed.xml
+++ b/src/NzbDrone.Core.Test/Files/Indexers/TorrentRss/ImmortalSeed.xml
@@ -663,4 +663,4 @@
2015-02-05 22:38:43
-
\ No newline at end of file
+
diff --git a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlacklistFixture.cs b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlocklistFixture.cs
similarity index 76%
rename from src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlacklistFixture.cs
rename to src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlocklistFixture.cs
index b9bd4d4be..4c17d1c18 100644
--- a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlacklistFixture.cs
+++ b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlocklistFixture.cs
@@ -2,7 +2,7 @@ using System.Collections.Generic;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
-using NzbDrone.Core.Blacklisting;
+using NzbDrone.Core.Blocklisting;
using NzbDrone.Core.Housekeeping.Housekeepers;
using NzbDrone.Core.Languages;
using NzbDrone.Core.Movies;
@@ -12,37 +12,37 @@ using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
{
[TestFixture]
- public class CleanupOrphanedBlacklistFixture : DbTest
+ public class CleanupOrphanedBlocklistFixture : DbTest
{
[Test]
- public void should_delete_orphaned_blacklist_items()
+ public void should_delete_orphaned_blocklist_items()
{
- var blacklist = Builder.CreateNew()
+ var blocklist = Builder.CreateNew()
.With(h => h.MovieId = default)
.With(h => h.Quality = new QualityModel())
.With(h => h.Languages = new List())
.BuildNew();
- Db.Insert(blacklist);
+ Db.Insert(blocklist);
Subject.Clean();
AllStoredModels.Should().BeEmpty();
}
[Test]
- public void should_not_delete_unorphaned_blacklist_items()
+ public void should_not_delete_unorphaned_blocklist_items()
{
var movie = Builder.CreateNew().BuildNew();
Db.Insert(movie);
- var blacklist = Builder.CreateNew()
+ var blocklist = Builder.CreateNew()
.With(h => h.MovieId = default)
.With(h => h.Quality = new QualityModel())
.With(h => h.Languages = new List())
.With(b => b.MovieId = movie.Id)
.BuildNew();
- Db.Insert(blacklist);
+ Db.Insert(blocklist);
Subject.Clean();
AllStoredModels.Should().HaveCount(1);
diff --git a/src/NzbDrone.Core.Test/MetadataSource/SearchMovieComparerFixture.cs b/src/NzbDrone.Core.Test/MetadataSource/SearchMovieComparerFixture.cs
index 568470eb9..4a316c202 100644
--- a/src/NzbDrone.Core.Test/MetadataSource/SearchMovieComparerFixture.cs
+++ b/src/NzbDrone.Core.Test/MetadataSource/SearchMovieComparerFixture.cs
@@ -47,25 +47,25 @@ namespace NzbDrone.Core.Test.MetadataSource
}
[Test]
- public void should_prefer_blacklist_over_the_blacklist_when_searching_for_blacklist()
+ public void should_prefer_blocklist_over_the_blocklist_when_searching_for_blocklist()
{
- WithSeries("The Blacklist");
- WithSeries("Blacklist");
+ WithSeries("The Blocklist");
+ WithSeries("Blocklist");
- _series.Sort(new SearchMovieComparer("blacklist"));
+ _series.Sort(new SearchMovieComparer("blocklist"));
- _series.First().Title.Should().Be("Blacklist");
+ _series.First().Title.Should().Be("Blocklist");
}
[Test]
- public void should_prefer_the_blacklist_over_blacklist_when_searching_for_the_blacklist()
+ public void should_prefer_the_blocklist_over_blocklist_when_searching_for_the_blocklist()
{
- WithSeries("Blacklist");
- WithSeries("The Blacklist");
+ WithSeries("Blocklist");
+ WithSeries("The Blocklist");
- _series.Sort(new SearchMovieComparer("the blacklist"));
+ _series.Sort(new SearchMovieComparer("the blocklist"));
- _series.First().Title.Should().Be("The Blacklist");
+ _series.First().Title.Should().Be("The Blocklist");
}
}
}
diff --git a/src/NzbDrone.Core/Blacklisting/Blacklist.cs b/src/NzbDrone.Core/Blocklisting/Blocklist.cs
similarity index 91%
rename from src/NzbDrone.Core/Blacklisting/Blacklist.cs
rename to src/NzbDrone.Core/Blocklisting/Blocklist.cs
index 2a3496cce..2a1cbfd35 100644
--- a/src/NzbDrone.Core/Blacklisting/Blacklist.cs
+++ b/src/NzbDrone.Core/Blocklisting/Blocklist.cs
@@ -7,9 +7,9 @@ using NzbDrone.Core.Movies;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Qualities;
-namespace NzbDrone.Core.Blacklisting
+namespace NzbDrone.Core.Blocklisting
{
- public class Blacklist : ModelBase
+ public class Blocklist : ModelBase
{
public int MovieId { get; set; }
public Movie Movie { get; set; }
diff --git a/src/NzbDrone.Core/Blacklisting/BlacklistRepository.cs b/src/NzbDrone.Core/Blocklisting/BlocklistRepository.cs
similarity index 56%
rename from src/NzbDrone.Core/Blacklisting/BlacklistRepository.cs
rename to src/NzbDrone.Core/Blocklisting/BlocklistRepository.cs
index a5b623f0c..3cfc921b4 100644
--- a/src/NzbDrone.Core/Blacklisting/BlacklistRepository.cs
+++ b/src/NzbDrone.Core/Blocklisting/BlocklistRepository.cs
@@ -3,34 +3,34 @@ using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Movies;
-namespace NzbDrone.Core.Blacklisting
+namespace NzbDrone.Core.Blocklisting
{
- public interface IBlacklistRepository : IBasicRepository
+ public interface IBlocklistRepository : IBasicRepository
{
- List BlacklistedByTitle(int movieId, string sourceTitle);
- List BlacklistedByTorrentInfoHash(int movieId, string torrentInfoHash);
- List BlacklistedByMovie(int movieId);
+ List BlocklistedByTitle(int movieId, string sourceTitle);
+ List BlocklistedByTorrentInfoHash(int movieId, string torrentInfoHash);
+ List BlocklistedByMovie(int movieId);
void DeleteForMovies(List movieIds);
}
- public class BlacklistRepository : BasicRepository, IBlacklistRepository
+ public class BlocklistRepository : BasicRepository, IBlocklistRepository
{
- public BlacklistRepository(IMainDatabase database, IEventAggregator eventAggregator)
+ public BlocklistRepository(IMainDatabase database, IEventAggregator eventAggregator)
: base(database, eventAggregator)
{
}
- public List BlacklistedByTitle(int movieId, string sourceTitle)
+ public List BlocklistedByTitle(int movieId, string sourceTitle)
{
return Query(x => x.MovieId == movieId && x.SourceTitle.Contains(sourceTitle));
}
- public List BlacklistedByTorrentInfoHash(int movieId, string torrentInfoHash)
+ public List BlocklistedByTorrentInfoHash(int movieId, string torrentInfoHash)
{
return Query(x => x.MovieId == movieId && x.TorrentInfoHash.Contains(torrentInfoHash));
}
- public List BlacklistedByMovie(int movieId)
+ public List BlocklistedByMovie(int movieId)
{
return Query(x => x.MovieId == movieId);
}
@@ -40,8 +40,8 @@ namespace NzbDrone.Core.Blacklisting
Delete(x => movieIds.Contains(x.MovieId));
}
- protected override SqlBuilder PagedBuilder() => new SqlBuilder().Join((b, m) => b.MovieId == m.Id);
- protected override IEnumerable PagedQuery(SqlBuilder sql) => _database.QueryJoined(sql, (bl, movie) =>
+ protected override SqlBuilder PagedBuilder() => new SqlBuilder().Join((b, m) => b.MovieId == m.Id);
+ protected override IEnumerable PagedQuery(SqlBuilder sql) => _database.QueryJoined(sql, (bl, movie) =>
{
bl.Movie = movie;
return bl;
diff --git a/src/NzbDrone.Core/Blacklisting/BlacklistService.cs b/src/NzbDrone.Core/Blocklisting/BlocklistService.cs
similarity index 66%
rename from src/NzbDrone.Core/Blacklisting/BlacklistService.cs
rename to src/NzbDrone.Core/Blocklisting/BlocklistService.cs
index 5f9676468..0a32b2bfe 100644
--- a/src/NzbDrone.Core/Blacklisting/BlacklistService.cs
+++ b/src/NzbDrone.Core/Blocklisting/BlocklistService.cs
@@ -10,33 +10,33 @@ using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Movies.Events;
using NzbDrone.Core.Parser.Model;
-namespace NzbDrone.Core.Blacklisting
+namespace NzbDrone.Core.Blocklisting
{
- public interface IBlacklistService
+ public interface IBlocklistService
{
- bool Blacklisted(int movieId, ReleaseInfo release);
- PagingSpec Paged(PagingSpec pagingSpec);
- List GetByMovieId(int movieId);
+ bool Blocklisted(int movieId, ReleaseInfo release);
+ PagingSpec Paged(PagingSpec pagingSpec);
+ List GetByMovieId(int movieId);
void Delete(int id);
void Delete(List ids);
}
- public class BlacklistService : IBlacklistService,
+ public class BlocklistService : IBlocklistService,
- IExecute,
+ IExecute,
IHandle,
IHandleAsync
{
- private readonly IBlacklistRepository _blacklistRepository;
+ private readonly IBlocklistRepository _blocklistRepository;
- public BlacklistService(IBlacklistRepository blacklistRepository)
+ public BlocklistService(IBlocklistRepository blocklistRepository)
{
- _blacklistRepository = blacklistRepository;
+ _blocklistRepository = blocklistRepository;
}
- public bool Blacklisted(int movieId, ReleaseInfo release)
+ public bool Blocklisted(int movieId, ReleaseInfo release)
{
- var blacklistedByTitle = _blacklistRepository.BlacklistedByTitle(movieId, release.Title);
+ var blocklistedByTitle = _blocklistRepository.BlocklistedByTitle(movieId, release.Title);
if (release.DownloadProtocol == DownloadProtocol.Torrent)
{
@@ -49,40 +49,40 @@ namespace NzbDrone.Core.Blacklisting
if (torrentInfo.InfoHash.IsNullOrWhiteSpace())
{
- return blacklistedByTitle.Where(b => b.Protocol == DownloadProtocol.Torrent)
+ return blocklistedByTitle.Where(b => b.Protocol == DownloadProtocol.Torrent)
.Any(b => SameTorrent(b, torrentInfo));
}
- var blacklistedByTorrentInfohash = _blacklistRepository.BlacklistedByTorrentInfoHash(movieId, torrentInfo.InfoHash);
+ var blocklistedByTorrentInfohash = _blocklistRepository.BlocklistedByTorrentInfoHash(movieId, torrentInfo.InfoHash);
- return blacklistedByTorrentInfohash.Any(b => SameTorrent(b, torrentInfo));
+ return blocklistedByTorrentInfohash.Any(b => SameTorrent(b, torrentInfo));
}
- return blacklistedByTitle.Where(b => b.Protocol == DownloadProtocol.Usenet)
+ return blocklistedByTitle.Where(b => b.Protocol == DownloadProtocol.Usenet)
.Any(b => SameNzb(b, release));
}
- public PagingSpec Paged(PagingSpec pagingSpec)
+ public PagingSpec Paged(PagingSpec pagingSpec)
{
- return _blacklistRepository.GetPaged(pagingSpec);
+ return _blocklistRepository.GetPaged(pagingSpec);
}
- public List GetByMovieId(int movieId)
+ public List GetByMovieId(int movieId)
{
- return _blacklistRepository.BlacklistedByMovie(movieId);
+ return _blocklistRepository.BlocklistedByMovie(movieId);
}
public void Delete(int id)
{
- _blacklistRepository.Delete(id);
+ _blocklistRepository.Delete(id);
}
public void Delete(List ids)
{
- _blacklistRepository.DeleteMany(ids);
+ _blocklistRepository.DeleteMany(ids);
}
- private bool SameNzb(Blacklist item, ReleaseInfo release)
+ private bool SameNzb(Blocklist item, ReleaseInfo release)
{
if (item.PublishedDate == release.PublishDate)
{
@@ -99,7 +99,7 @@ namespace NzbDrone.Core.Blacklisting
return false;
}
- private bool SameTorrent(Blacklist item, TorrentInfo release)
+ private bool SameTorrent(Blocklist item, TorrentInfo release)
{
if (release.InfoHash.IsNotNullOrWhiteSpace())
{
@@ -109,7 +109,7 @@ namespace NzbDrone.Core.Blacklisting
return item.Indexer.Equals(release.Indexer, StringComparison.InvariantCultureIgnoreCase);
}
- private bool HasSameIndexer(Blacklist item, string indexer)
+ private bool HasSameIndexer(Blocklist item, string indexer)
{
if (item.Indexer.IsNullOrWhiteSpace())
{
@@ -119,7 +119,7 @@ namespace NzbDrone.Core.Blacklisting
return item.Indexer.Equals(indexer, StringComparison.InvariantCultureIgnoreCase);
}
- private bool HasSamePublishedDate(Blacklist item, DateTime publishedDate)
+ private bool HasSamePublishedDate(Blocklist item, DateTime publishedDate)
{
if (!item.PublishedDate.HasValue)
{
@@ -130,7 +130,7 @@ namespace NzbDrone.Core.Blacklisting
item.PublishedDate.Value.AddMinutes(2) >= publishedDate;
}
- private bool HasSameSize(Blacklist item, long size)
+ private bool HasSameSize(Blocklist item, long size)
{
if (!item.Size.HasValue)
{
@@ -142,14 +142,14 @@ namespace NzbDrone.Core.Blacklisting
return difference <= 2.Megabytes();
}
- public void Execute(ClearBlacklistCommand message)
+ public void Execute(ClearBlocklistCommand message)
{
- _blacklistRepository.Purge();
+ _blocklistRepository.Purge();
}
public void Handle(DownloadFailedEvent message)
{
- var blacklist = new Blacklist
+ var blocklist = new Blocklist
{
MovieId = message.MovieId,
SourceTitle = message.SourceTitle,
@@ -166,15 +166,15 @@ namespace NzbDrone.Core.Blacklisting
if (Enum.TryParse(message.Data.GetValueOrDefault("indexerFlags"), true, out IndexerFlags flags))
{
- blacklist.IndexerFlags = flags;
+ blocklist.IndexerFlags = flags;
}
- _blacklistRepository.Insert(blacklist);
+ _blocklistRepository.Insert(blocklist);
}
public void HandleAsync(MoviesDeletedEvent message)
{
- _blacklistRepository.DeleteForMovies(message.Movies.Select(m => m.Id).ToList());
+ _blocklistRepository.DeleteForMovies(message.Movies.Select(m => m.Id).ToList());
}
}
}
diff --git a/src/NzbDrone.Core/Blacklisting/ClearBlacklistCommand.cs b/src/NzbDrone.Core/Blocklisting/ClearBlocklistCommand.cs
similarity index 57%
rename from src/NzbDrone.Core/Blacklisting/ClearBlacklistCommand.cs
rename to src/NzbDrone.Core/Blocklisting/ClearBlocklistCommand.cs
index c2608aa06..16a7a4e7f 100644
--- a/src/NzbDrone.Core/Blacklisting/ClearBlacklistCommand.cs
+++ b/src/NzbDrone.Core/Blocklisting/ClearBlocklistCommand.cs
@@ -1,8 +1,8 @@
using NzbDrone.Core.Messaging.Commands;
-namespace NzbDrone.Core.Blacklisting
+namespace NzbDrone.Core.Blocklisting
{
- public class ClearBlacklistCommand : Command
+ public class ClearBlocklistCommand : Command
{
public override bool SendUpdatesToClient => true;
}
diff --git a/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs b/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs
index c60685cdb..a29e4ba1c 100644
--- a/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs
+++ b/src/NzbDrone.Core/CustomFormats/CustomFormatCalculationService.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using NzbDrone.Common.Extensions;
-using NzbDrone.Core.Blacklisting;
+using NzbDrone.Core.Blocklisting;
using NzbDrone.Core.History;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Movies;
@@ -16,7 +16,7 @@ namespace NzbDrone.Core.CustomFormats
{
List ParseCustomFormat(ParsedMovieInfo movieInfo);
List ParseCustomFormat(MovieFile movieFile);
- List ParseCustomFormat(Blacklist blacklist);
+ List ParseCustomFormat(Blocklist blocklist);
List ParseCustomFormat(MovieHistory history);
}
@@ -105,25 +105,25 @@ namespace NzbDrone.Core.CustomFormats
return ParseCustomFormat(movieFile, _formatService.All());
}
- public List ParseCustomFormat(Blacklist blacklist)
+ public List ParseCustomFormat(Blocklist blocklist)
{
- var movie = _movieService.GetMovie(blacklist.MovieId);
- var parsed = _parsingService.ParseMovieInfo(blacklist.SourceTitle, null);
+ var movie = _movieService.GetMovie(blocklist.MovieId);
+ var parsed = _parsingService.ParseMovieInfo(blocklist.SourceTitle, null);
var info = new ParsedMovieInfo
{
MovieTitle = movie.Title,
- SimpleReleaseTitle = parsed?.SimpleReleaseTitle ?? blacklist.SourceTitle.SimplifyReleaseTitle(),
- Quality = blacklist.Quality,
- Languages = blacklist.Languages,
+ SimpleReleaseTitle = parsed?.SimpleReleaseTitle ?? blocklist.SourceTitle.SimplifyReleaseTitle(),
+ Quality = blocklist.Quality,
+ Languages = blocklist.Languages,
ReleaseGroup = parsed?.ReleaseGroup,
Edition = parsed?.Edition,
Year = movie.Year,
ImdbId = movie.ImdbId,
ExtraInfo = new Dictionary
{
- { "IndexerFlags", blacklist.IndexerFlags },
- { "Size", blacklist.Size }
+ { "IndexerFlags", blocklist.IndexerFlags },
+ { "Size", blocklist.Size }
}
};
diff --git a/src/NzbDrone.Core/Datastore/Migration/197_rename_blacklist_to_blocklist.cs b/src/NzbDrone.Core/Datastore/Migration/197_rename_blacklist_to_blocklist.cs
new file mode 100644
index 000000000..ac9b3b86b
--- /dev/null
+++ b/src/NzbDrone.Core/Datastore/Migration/197_rename_blacklist_to_blocklist.cs
@@ -0,0 +1,14 @@
+using FluentMigrator;
+using NzbDrone.Core.Datastore.Migration.Framework;
+
+namespace NzbDrone.Core.Datastore.Migration
+{
+ [Migration(197)]
+ public class rename_blacklist_to_blocklist : NzbDroneMigrationBase
+ {
+ protected override void MainDbUpgrade()
+ {
+ Rename.Table("Blacklist").To("Blocklist");
+ }
+ }
+}
diff --git a/src/NzbDrone.Core/Datastore/TableMapping.cs b/src/NzbDrone.Core/Datastore/TableMapping.cs
index 833e739fc..c8caccd23 100644
--- a/src/NzbDrone.Core/Datastore/TableMapping.cs
+++ b/src/NzbDrone.Core/Datastore/TableMapping.cs
@@ -4,7 +4,7 @@ using System.Linq;
using Dapper;
using NzbDrone.Common.Reflection;
using NzbDrone.Core.Authentication;
-using NzbDrone.Core.Blacklisting;
+using NzbDrone.Core.Blocklisting;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.CustomFilters;
using NzbDrone.Core.CustomFormats;
@@ -129,7 +129,7 @@ namespace NzbDrone.Core.Datastore
Mapper.Entity("Profiles").RegisterModel();
Mapper.Entity("Logs").RegisterModel();
Mapper.Entity("NamingConfig").RegisterModel();
- Mapper.Entity("Blacklist").RegisterModel();
+ Mapper.Entity("Blocklist").RegisterModel();
Mapper.Entity("MetadataFiles").RegisterModel();
Mapper.Entity("SubtitleFiles").RegisterModel();
Mapper.Entity("ExtraFiles").RegisterModel();
diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/BlacklistSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/BlocklistSpecification.cs
similarity index 58%
rename from src/NzbDrone.Core/DecisionEngine/Specifications/BlacklistSpecification.cs
rename to src/NzbDrone.Core/DecisionEngine/Specifications/BlocklistSpecification.cs
index eb74b5023..113f99a6c 100644
--- a/src/NzbDrone.Core/DecisionEngine/Specifications/BlacklistSpecification.cs
+++ b/src/NzbDrone.Core/DecisionEngine/Specifications/BlocklistSpecification.cs
@@ -1,18 +1,18 @@
using NLog;
-using NzbDrone.Core.Blacklisting;
+using NzbDrone.Core.Blocklisting;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.DecisionEngine.Specifications
{
- public class BlacklistSpecification : IDecisionEngineSpecification
+ public class BlocklistSpecification : IDecisionEngineSpecification
{
- private readonly IBlacklistService _blacklistService;
+ private readonly IBlocklistService _blocklistService;
private readonly Logger _logger;
- public BlacklistSpecification(IBlacklistService blacklistService, Logger logger)
+ public BlocklistSpecification(IBlocklistService blocklistService, Logger logger)
{
- _blacklistService = blacklistService;
+ _blocklistService = blocklistService;
_logger = logger;
}
@@ -21,10 +21,10 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
public Decision IsSatisfiedBy(RemoteMovie subject, SearchCriteriaBase searchCriteria)
{
- if (_blacklistService.Blacklisted(subject.Movie.Id, subject.Release))
+ if (_blocklistService.Blocklisted(subject.Movie.Id, subject.Release))
{
- _logger.Debug("{0} is blacklisted, rejecting.", subject.Release.Title);
- return Decision.Reject("Release is blacklisted");
+ _logger.Debug("{0} is blocklisted, rejecting.", subject.Release.Title);
+ return Decision.Reject("Release is blocklisted");
}
return Decision.Accept();
diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedBlacklist.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedBlocklist.cs
similarity index 62%
rename from src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedBlacklist.cs
rename to src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedBlocklist.cs
index 0218a883f..aa62d50e9 100644
--- a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedBlacklist.cs
+++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedBlocklist.cs
@@ -3,11 +3,11 @@ using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.Housekeeping.Housekeepers
{
- public class CleanupOrphanedBlacklist : IHousekeepingTask
+ public class CleanupOrphanedBlocklist : IHousekeepingTask
{
private readonly IMainDatabase _database;
- public CleanupOrphanedBlacklist(IMainDatabase database)
+ public CleanupOrphanedBlocklist(IMainDatabase database)
{
_database = database;
}
@@ -16,11 +16,11 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
{
using (var mapper = _database.OpenConnection())
{
- mapper.Execute(@"DELETE FROM Blacklist
+ mapper.Execute(@"DELETE FROM Blocklist
WHERE Id IN (
- SELECT Blacklist.Id FROM Blacklist
+ SELECT Blocklist.Id FROM Blocklist
LEFT OUTER JOIN Movies
- ON Blacklist.MovieId = Movies.Id
+ ON Blocklist.MovieId = Movies.Id
WHERE Movies.Id IS NULL)");
}
}
diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json
index 6e7983153..53a91fc0d 100644
--- a/src/NzbDrone.Core/Localization/Core/en.json
+++ b/src/NzbDrone.Core/Localization/Core/en.json
@@ -63,7 +63,7 @@
"AreYouSureYouWantToDeleteThisImportListExclusion": "Are you sure you want to delete this import list exclusion?",
"AreYouSureYouWantToDeleteThisRemotePathMapping": "Are you sure you want to delete this remote path mapping?",
"AreYouSureYouWantToRemoveSelectedItemsFromQueue": "Are you sure you want to remove {0} item{1} from the queue?",
- "AreYouSureYouWantToRemoveTheSelectedItemsFromBlacklist": "Are you sure you want to remove the selected items from the blacklist?",
+ "AreYouSureYouWantToRemoveTheSelectedItemsFromBlocklist": "Are you sure you want to remove the selected items from the blocklist?",
"AreYouSureYouWantToResetYourAPIKey": "Are you sure you want to reset your API Key?",
"AsAllDayHelpText": "Events will appear as all-day events in your calendar",
"AudioInfo": "Audio Info",
@@ -86,10 +86,10 @@
"BeforeUpdate": "Before update",
"BindAddress": "Bind Address",
"BindAddressHelpText": "Valid IP4 address or '*' for all interfaces",
- "Blacklist": "Blacklist",
- "Blacklisted": "Blacklisted",
- "BlacklistHelpText": "Prevents Radarr from automatically grabbing this release again",
- "BlacklistRelease": "Blacklist Release",
+ "Blocklist": "Blocklist",
+ "Blocklisted": "Blocklisted",
+ "BlocklistHelpText": "Prevents Radarr from automatically grabbing this release again",
+ "BlocklistRelease": "Blocklist Release",
"Branch": "Branch",
"BranchUpdate": "Branch to use to update Radarr",
"BranchUpdateMechanism": "Branch used by external update mechanism",
@@ -788,7 +788,7 @@
"RemovedMovieCheckSingleMessage": "Movie {0} was removed from TMDb",
"RemoveFailedDownloadsHelpText": "Remove failed downloads from download client history",
"RemoveFilter": "Remove filter",
- "RemoveFromBlacklist": "Remove from blacklist",
+ "RemoveFromBlocklist": "Remove from blocklist",
"RemoveFromDownloadClient": "Remove From Download Client",
"RemoveFromQueue": "Remove from queue",
"RemoveFromQueueText": "Are you sure you want to remove {0} from the queue?",
@@ -1014,7 +1014,7 @@
"UnableToImportCheckLogs": "Downloaded - Unable to Import: check logs for details",
"UnableToLoadAltTitle": "Unable to load alternative titles.",
"UnableToLoadBackups": "Unable to load backups",
- "UnableToLoadBlacklist": "Unable to load blacklist",
+ "UnableToLoadBlocklist": "Unable to load blocklist",
"UnableToLoadCustomFormats": "Unable to load Custom Formats",
"UnableToLoadDelayProfiles": "Unable to load Delay Profiles",
"UnableToLoadDownloadClientOptions": "Unable to load download client options",
diff --git a/src/NzbDrone.Integration.Test/ApiTests/BlacklistFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/BlacklistFixture.cs
deleted file mode 100644
index 34c84bd48..000000000
--- a/src/NzbDrone.Integration.Test/ApiTests/BlacklistFixture.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using FluentAssertions;
-using NUnit.Framework;
-using Radarr.Api.V3.Movies;
-
-namespace NzbDrone.Integration.Test.ApiTests
-{
- [TestFixture]
- public class BlacklistFixture : IntegrationTest
- {
- private MovieResource _movie;
-
- [Test]
- [Ignore("Adding to blacklist not supported")]
- public void should_be_able_to_add_to_blacklist()
- {
- _movie = EnsureMovie(11, "The Blacklist");
-
- Blacklist.Post(new Radarr.Api.V3.Blacklist.BlacklistResource
- {
- MovieId = _movie.Id,
- SourceTitle = "Blacklist.S01E01.Brought.To.You.By-BoomBoxHD"
- });
- }
-
- [Test]
- [Ignore("Adding to blacklist not supported")]
- public void should_be_able_to_get_all_blacklisted()
- {
- var result = Blacklist.GetPaged(0, 1000, "date", "desc");
-
- result.Should().NotBeNull();
- result.TotalRecords.Should().Be(1);
- result.Records.Should().NotBeNullOrEmpty();
- }
-
- [Test]
- [Ignore("Adding to blacklist not supported")]
- public void should_be_able_to_remove_from_blacklist()
- {
- Blacklist.Delete(1);
-
- var result = Blacklist.GetPaged(0, 1000, "date", "desc");
-
- result.Should().NotBeNull();
- result.TotalRecords.Should().Be(0);
- }
- }
-}
diff --git a/src/NzbDrone.Integration.Test/ApiTests/BlocklistFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/BlocklistFixture.cs
new file mode 100644
index 000000000..64c016460
--- /dev/null
+++ b/src/NzbDrone.Integration.Test/ApiTests/BlocklistFixture.cs
@@ -0,0 +1,48 @@
+using FluentAssertions;
+using NUnit.Framework;
+using Radarr.Api.V3.Movies;
+
+namespace NzbDrone.Integration.Test.ApiTests
+{
+ [TestFixture]
+ public class BlocklistFixture : IntegrationTest
+ {
+ private MovieResource _movie;
+
+ [Test]
+ [Ignore("Adding to blocklist not supported")]
+ public void should_be_able_to_add_to_blocklist()
+ {
+ _movie = EnsureMovie(11, "The Blocklist");
+
+ Blocklist.Post(new Radarr.Api.V3.Blocklist.BlocklistResource
+ {
+ MovieId = _movie.Id,
+ SourceTitle = "Blocklist.S01E01.Brought.To.You.By-BoomBoxHD"
+ });
+ }
+
+ [Test]
+ [Ignore("Adding to blocklist not supported")]
+ public void should_be_able_to_get_all_blocklisted()
+ {
+ var result = Blocklist.GetPaged(0, 1000, "date", "desc");
+
+ result.Should().NotBeNull();
+ result.TotalRecords.Should().Be(1);
+ result.Records.Should().NotBeNullOrEmpty();
+ }
+
+ [Test]
+ [Ignore("Adding to blocklist not supported")]
+ public void should_be_able_to_remove_from_blocklist()
+ {
+ Blocklist.Delete(1);
+
+ var result = Blocklist.GetPaged(0, 1000, "date", "desc");
+
+ result.Should().NotBeNull();
+ result.TotalRecords.Should().Be(0);
+ }
+ }
+}
diff --git a/src/NzbDrone.Integration.Test/IntegrationTestBase.cs b/src/NzbDrone.Integration.Test/IntegrationTestBase.cs
index e880db95d..0ab73e5bf 100644
--- a/src/NzbDrone.Integration.Test/IntegrationTestBase.cs
+++ b/src/NzbDrone.Integration.Test/IntegrationTestBase.cs
@@ -17,7 +17,7 @@ using NzbDrone.Core.Qualities;
using NzbDrone.Integration.Test.Client;
using NzbDrone.SignalR;
using NzbDrone.Test.Common.Categories;
-using Radarr.Api.V3.Blacklist;
+using Radarr.Api.V3.Blocklist;
using Radarr.Api.V3.Config;
using Radarr.Api.V3.DownloadClient;
using Radarr.Api.V3.History;
@@ -36,7 +36,7 @@ namespace NzbDrone.Integration.Test
{
protected RestClient RestClient { get; private set; }
- public ClientBase Blacklist;
+ public ClientBase Blocklist;
public CommandClient Commands;
public ClientBase Tasks;
public DownloadClientClient DownloadClients;
@@ -98,7 +98,7 @@ namespace NzbDrone.Integration.Test
RestClient.AddDefaultHeader("Authentication", ApiKey);
RestClient.AddDefaultHeader("X-Api-Key", ApiKey);
- Blacklist = new ClientBase(RestClient, ApiKey);
+ Blocklist = new ClientBase(RestClient, ApiKey);
Commands = new CommandClient(RestClient, ApiKey);
Tasks = new ClientBase(RestClient, ApiKey, "system/task");
DownloadClients = new DownloadClientClient(RestClient, ApiKey);
diff --git a/src/Radarr.Api.V3/Blacklist/BlacklistModule.cs b/src/Radarr.Api.V3/Blacklist/BlacklistModule.cs
deleted file mode 100644
index 61cc608c4..000000000
--- a/src/Radarr.Api.V3/Blacklist/BlacklistModule.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using NzbDrone.Core.Blacklisting;
-using NzbDrone.Core.CustomFormats;
-using NzbDrone.Core.Datastore;
-using Radarr.Http;
-using Radarr.Http.Extensions;
-using Radarr.Http.REST;
-
-namespace Radarr.Api.V3.Blacklist
-{
- public class BlacklistModule : RadarrRestModule
- {
- private readonly IBlacklistService _blacklistService;
- private readonly ICustomFormatCalculationService _formatCalculator;
-
- public BlacklistModule(IBlacklistService blacklistService,
- ICustomFormatCalculationService formatCalculator)
- {
- _blacklistService = blacklistService;
- _formatCalculator = formatCalculator;
-
- GetResourcePaged = GetBlacklist;
- DeleteResource = DeleteBlacklist;
-
- Get("/movie", x => GetMovieBlacklist());
- Delete("/bulk", x => Remove());
- }
-
- private PagingResource GetBlacklist(PagingResource pagingResource)
- {
- var pagingSpec = pagingResource.MapToPagingSpec("date", SortDirection.Descending);
-
- return ApplyToPage(_blacklistService.Paged, pagingSpec, (blacklist) => BlacklistResourceMapper.MapToResource(blacklist, _formatCalculator));
- }
-
- private List GetMovieBlacklist()
- {
- var queryMovieId = Request.Query.MovieId;
-
- if (!queryMovieId.HasValue)
- {
- throw new BadRequestException("movieId is missing");
- }
-
- int movieId = Convert.ToInt32(queryMovieId.Value);
-
- return _blacklistService.GetByMovieId(movieId).Select(h => BlacklistResourceMapper.MapToResource(h, _formatCalculator)).ToList();
- }
-
- private void DeleteBlacklist(int id)
- {
- _blacklistService.Delete(id);
- }
-
- private object Remove()
- {
- var resource = Request.Body.FromJson();
-
- _blacklistService.Delete(resource.Ids);
-
- return new object();
- }
- }
-}
diff --git a/src/Radarr.Api.V3/Blacklist/BlacklistBulkResource.cs b/src/Radarr.Api.V3/Blocklist/BlocklistBulkResource.cs
similarity index 56%
rename from src/Radarr.Api.V3/Blacklist/BlacklistBulkResource.cs
rename to src/Radarr.Api.V3/Blocklist/BlocklistBulkResource.cs
index 6798f4c4c..1150c0801 100644
--- a/src/Radarr.Api.V3/Blacklist/BlacklistBulkResource.cs
+++ b/src/Radarr.Api.V3/Blocklist/BlocklistBulkResource.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
-namespace Radarr.Api.V3.Blacklist
+namespace Radarr.Api.V3.Blocklist
{
- public class BlacklistBulkResource
+ public class BlocklistBulkResource
{
public List Ids { get; set; }
}
diff --git a/src/Radarr.Api.V3/Blocklist/BlocklistModule.cs b/src/Radarr.Api.V3/Blocklist/BlocklistModule.cs
new file mode 100644
index 000000000..6087d0a3c
--- /dev/null
+++ b/src/Radarr.Api.V3/Blocklist/BlocklistModule.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using NzbDrone.Core.Blocklisting;
+using NzbDrone.Core.CustomFormats;
+using NzbDrone.Core.Datastore;
+using Radarr.Http;
+using Radarr.Http.Extensions;
+using Radarr.Http.REST;
+
+namespace Radarr.Api.V3.Blocklist
+{
+ public class BlocklistModule : RadarrRestModule
+ {
+ private readonly IBlocklistService _blocklistService;
+ private readonly ICustomFormatCalculationService _formatCalculator;
+
+ public BlocklistModule(IBlocklistService blocklistService,
+ ICustomFormatCalculationService formatCalculator)
+ {
+ _blocklistService = blocklistService;
+ _formatCalculator = formatCalculator;
+
+ GetResourcePaged = GetBlocklist;
+ DeleteResource = DeleteBlocklist;
+
+ Get("/movie", x => GetMovieBlocklist());
+ Delete("/bulk", x => Remove());
+ }
+
+ private PagingResource GetBlocklist(PagingResource pagingResource)
+ {
+ var pagingSpec = pagingResource.MapToPagingSpec("date", SortDirection.Descending);
+
+ return ApplyToPage(_blocklistService.Paged, pagingSpec, (blocklist) => BlocklistResourceMapper.MapToResource(blocklist, _formatCalculator));
+ }
+
+ private List GetMovieBlocklist()
+ {
+ var queryMovieId = Request.Query.MovieId;
+
+ if (!queryMovieId.HasValue)
+ {
+ throw new BadRequestException("movieId is missing");
+ }
+
+ int movieId = Convert.ToInt32(queryMovieId.Value);
+
+ return _blocklistService.GetByMovieId(movieId).Select(h => BlocklistResourceMapper.MapToResource(h, _formatCalculator)).ToList();
+ }
+
+ private void DeleteBlocklist(int id)
+ {
+ _blocklistService.Delete(id);
+ }
+
+ private object Remove()
+ {
+ var resource = Request.Body.FromJson();
+
+ _blocklistService.Delete(resource.Ids);
+
+ return new object();
+ }
+ }
+}
diff --git a/src/Radarr.Api.V3/Blacklist/BlacklistResource.cs b/src/Radarr.Api.V3/Blocklist/BlocklistResource.cs
similarity index 82%
rename from src/Radarr.Api.V3/Blacklist/BlacklistResource.cs
rename to src/Radarr.Api.V3/Blocklist/BlocklistResource.cs
index 773d11c1f..471d78582 100644
--- a/src/Radarr.Api.V3/Blacklist/BlacklistResource.cs
+++ b/src/Radarr.Api.V3/Blocklist/BlocklistResource.cs
@@ -8,9 +8,9 @@ using Radarr.Api.V3.CustomFormats;
using Radarr.Api.V3.Movies;
using Radarr.Http.REST;
-namespace Radarr.Api.V3.Blacklist
+namespace Radarr.Api.V3.Blocklist
{
- public class BlacklistResource : RestResource
+ public class BlocklistResource : RestResource
{
public int MovieId { get; set; }
public string SourceTitle { get; set; }
@@ -25,16 +25,16 @@ namespace Radarr.Api.V3.Blacklist
public MovieResource Movie { get; set; }
}
- public static class BlacklistResourceMapper
+ public static class BlocklistResourceMapper
{
- public static BlacklistResource MapToResource(this NzbDrone.Core.Blacklisting.Blacklist model, ICustomFormatCalculationService formatCalculator)
+ public static BlocklistResource MapToResource(this NzbDrone.Core.Blocklisting.Blocklist model, ICustomFormatCalculationService formatCalculator)
{
if (model == null)
{
return null;
}
- return new BlacklistResource
+ return new BlocklistResource
{
Id = model.Id,
diff --git a/src/Radarr.Api.V3/Queue/QueueActionModule.cs b/src/Radarr.Api.V3/Queue/QueueActionModule.cs
index 7116a5c44..151a5e145 100644
--- a/src/Radarr.Api.V3/Queue/QueueActionModule.cs
+++ b/src/Radarr.Api.V3/Queue/QueueActionModule.cs
@@ -79,9 +79,9 @@ namespace Radarr.Api.V3.Queue
private object Remove(int id)
{
var removeFromClient = Request.GetBooleanQueryParameter("removeFromClient", true);
- var blacklist = Request.GetBooleanQueryParameter("blacklist");
+ var blocklist = Request.GetBooleanQueryParameter("blocklist");
- var trackedDownload = Remove(id, removeFromClient, blacklist);
+ var trackedDownload = Remove(id, removeFromClient, blocklist);
if (trackedDownload != null)
{
@@ -94,14 +94,14 @@ namespace Radarr.Api.V3.Queue
private object Remove()
{
var removeFromClient = Request.GetBooleanQueryParameter("removeFromClient", true);
- var blacklist = Request.GetBooleanQueryParameter("blacklist");
+ var blocklist = Request.GetBooleanQueryParameter("blocklist");
var resource = Request.Body.FromJson();
var trackedDownloadIds = new List();
foreach (var id in resource.Ids)
{
- var trackedDownload = Remove(id, removeFromClient, blacklist);
+ var trackedDownload = Remove(id, removeFromClient, blocklist);
if (trackedDownload != null)
{
@@ -114,7 +114,7 @@ namespace Radarr.Api.V3.Queue
return new object();
}
- private TrackedDownload Remove(int id, bool removeFromClient, bool blacklist)
+ private TrackedDownload Remove(int id, bool removeFromClient, bool blocklist)
{
var pendingRelease = _pendingReleaseService.FindPendingQueueItem(id);
@@ -144,12 +144,12 @@ namespace Radarr.Api.V3.Queue
downloadClient.RemoveItem(trackedDownload.DownloadItem, true);
}
- if (blacklist)
+ if (blocklist)
{
_failedDownloadService.MarkAsFailed(trackedDownload.DownloadItem.DownloadId);
}
- if (!removeFromClient && !blacklist && !_ignoredDownloadService.IgnoreDownload(trackedDownload))
+ if (!removeFromClient && !blocklist && !_ignoredDownloadService.IgnoreDownload(trackedDownload))
{
return null;
}
diff --git a/src/Radarr.Api.V3/swagger.json b/src/Radarr.Api.V3/swagger.json
index 9170ade1e..3e731d43c 100644
--- a/src/Radarr.Api.V3/swagger.json
+++ b/src/Radarr.Api.V3/swagger.json
@@ -817,7 +817,7 @@
"description": "Invalid API Key"
}
},
- "description": "Pushes commands to Radarr using a key:value pair. The main key is \"name\" and below are acceptable values but it can also accept other key:value pairs (listed under each command):\n\n* ApplicationUpdate - Trigger an update of Radarr\n* Backup - Trigger a backup routine\n* CheckHealth - Trigger a system health check\n* ClearBlacklist - Triggers the removal of all blacklisted movies\n* CleanUpRecycleBin - Trigger a recycle bin cleanup check\n* DeleteLogFiles - Triggers the removal of all Info/Debug/Trace log files\n* DeleteUpdateLogFiles - Triggers the removal of all Update log files\n* DownloadedMoviesScan - Triggers the scan of downloaded movies\n* MissingMoviesSearch - Triggers a search of all missing movies\n* RefreshMonitoredDownloads - Triggers the scan of monitored downloads\n* RefreshMovie - Trigger a refresh / scan of library\n * movieIds:int[] - Specify a list of ids (comma separated) for individual movies to refresh",
+ "description": "Pushes commands to Radarr using a key:value pair. The main key is \"name\" and below are acceptable values but it can also accept other key:value pairs (listed under each command):\n\n* ApplicationUpdate - Trigger an update of Radarr\n* Backup - Trigger a backup routine\n* CheckHealth - Trigger a system health check\n* ClearBlocklist - Triggers the removal of all blocklisted movies\n* CleanUpRecycleBin - Trigger a recycle bin cleanup check\n* DeleteLogFiles - Triggers the removal of all Info/Debug/Trace log files\n* DeleteUpdateLogFiles - Triggers the removal of all Update log files\n* DownloadedMoviesScan - Triggers the scan of downloaded movies\n* MissingMoviesSearch - Triggers a search of all missing movies\n* RefreshMonitoredDownloads - Triggers the scan of monitored downloads\n* RefreshMovie - Trigger a refresh / scan of library\n * movieIds:int[] - Specify a list of ids (comma separated) for individual movies to refresh",
"security": [
{
"X-API-Key": []
@@ -1650,11 +1650,11 @@
},
"parameters": []
},
- "/blacklist": {
+ "/blocklist": {
"get": {
- "summary": "Get Blacklisted Releases",
+ "summary": "Get Blocklisted Releases",
"tags": [
- "Blacklist"
+ "Blocklist"
],
"responses": {
"200": {
@@ -1686,7 +1686,7 @@
"records": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/Blacklist"
+ "$ref": "#/components/schemas/Blocklist"
}
}
},
@@ -1704,8 +1704,8 @@
"description": "Invalid API Key"
}
},
- "operationId": "get-blackList",
- "description": "Returns blacklisted releases",
+ "operationId": "get-blockList",
+ "description": "Returns blocklisted releases",
"security": [
{
"X-API-Key": []
@@ -1751,8 +1751,8 @@
]
},
"delete": {
- "summary": "Delete a Blacklisted Release",
- "operationId": "delete-blackList",
+ "summary": "Delete a Blocklisted Release",
+ "operationId": "delete-blockList",
"responses": {
"200": {
"description": "Successful request"
@@ -1761,7 +1761,7 @@
"description": "Invalid API Key"
}
},
- "description": "Removes a specific release (the id provided) from the blacklist",
+ "description": "Removes a specific release (the id provided) from the blocklist",
"security": [
{
"X-API-Key": []
@@ -1781,16 +1781,16 @@
}
],
"tags": [
- "Blacklist"
+ "Blocklist"
]
},
"parameters": []
},
- "/blacklist/movie": {
+ "/blocklist/movie": {
"get": {
- "summary": "Get Blacklisted Releases for a Movie",
+ "summary": "Get Blocklisted Releases for a Movie",
"tags": [
- "Blacklist"
+ "Blocklist"
],
"responses": {
"200": {
@@ -1800,7 +1800,7 @@
"schema": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/Blacklist"
+ "$ref": "#/components/schemas/Blocklist"
}
}
}
@@ -1810,8 +1810,8 @@
"description": "Unauthorized"
}
},
- "operationId": "get-blacklist-movie",
- "description": "Retrieves blacklisted releases that are tied to a given movie in the database",
+ "operationId": "get-blocklist-movie",
+ "description": "Retrieves blocklisted releases that are tied to a given movie in the database",
"parameters": [
{
"schema": {
@@ -1833,16 +1833,16 @@
]
}
},
- "/blacklist/bulk": {
+ "/blocklist/bulk": {
"delete": {
- "summary": "Delete Blacklisted Releases",
- "operationId": "delete-blacklist-bulk",
+ "summary": "Delete Blocklisted Releases",
+ "operationId": "delete-blocklist-bulk",
"responses": {
"200": {
"description": "OK"
}
},
- "description": "Delete blacklisted releases in bulk",
+ "description": "Delete blocklisted releases in bulk",
"security": [
{
"X-API-Key": []
@@ -1857,7 +1857,7 @@
"properties": {
"ids": {
"type": "array",
- "description": "Database ids of the blacklist items to delete",
+ "description": "Database ids of the blocklist items to delete",
"items": {
"type": "integer"
}
@@ -1872,7 +1872,7 @@
}
},
"tags": [
- "Blacklist"
+ "Blocklist"
]
}
},
@@ -3314,7 +3314,7 @@
"description": "Invalid API Key"
}
},
- "description": "Remove an item from the queue and optionally blacklist it",
+ "description": "Remove an item from the queue and optionally blocklist it",
"security": [
{
"X-API-Key": []
@@ -3336,7 +3336,7 @@
"type": "boolean"
},
"in": "query",
- "name": "blacklist"
+ "name": "blocklist"
}
],
"tags": [
@@ -3377,7 +3377,7 @@
"type": "boolean"
},
"in": "query",
- "name": "blacklist"
+ "name": "blocklist"
}
],
"requestBody": {
@@ -4732,7 +4732,7 @@
"id"
]
},
- "Blacklist": {
+ "Blocklist": {
"description": "",
"type": "object",
"properties": {
@@ -4976,7 +4976,7 @@
"name": "History"
},
{
- "name": "Blacklist"
+ "name": "Blocklist"
},
{
"name": "Queue"
@@ -5009,4 +5009,4 @@
"name": "System"
}
]
-}
\ No newline at end of file
+}