mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-20 21:54:25 -04:00
New: UI Updates, Tag manager, More custom filters (#437)
* New: UI Updates, Tag manager, More custom filters * fixup! Fix ScanFixture Unit Tests * Fixed: Sentry Errors from UI don't have release, branch, environment * Changed: Bump Mobile Detect for New Device Detection * Fixed: Build on changes to package.json * fixup! Add MetadataProfile filter option * fixup! Tag Note, Blacklist, Manual Import * fixup: Remove connectSection * fixup: root folder comment
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import moment from 'moment';
|
||||
import { createAction } from 'redux-actions';
|
||||
@@ -44,7 +43,7 @@ export const defaultState = {
|
||||
},
|
||||
|
||||
quality: function(item, direction) {
|
||||
return item.quality.qualityWeight;
|
||||
return item.quality ? item.quality.qualityWeight : 0;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -144,7 +143,7 @@ export const reducers = createHandleActions({
|
||||
const id = payload.id;
|
||||
const newState = Object.assign({}, state);
|
||||
const items = newState.items;
|
||||
const index = _.findIndex(items, { id });
|
||||
const index = items.findIndex((item) => item.id === id);
|
||||
const item = Object.assign({}, items[index], payload);
|
||||
|
||||
newState.items = [...items];
|
||||
@@ -157,7 +156,7 @@ export const reducers = createHandleActions({
|
||||
const folder = payload.folder;
|
||||
const recentFolder = { folder, lastUsed: moment().toISOString() };
|
||||
const recentFolders = [...state.recentFolders];
|
||||
const index = _.findIndex(recentFolders, { folder });
|
||||
const index = recentFolders.findIndex((r) => r.folder === folder);
|
||||
|
||||
if (index > -1) {
|
||||
recentFolders.splice(index, 1, recentFolder);
|
||||
@@ -170,7 +169,10 @@ export const reducers = createHandleActions({
|
||||
|
||||
[REMOVE_RECENT_FOLDER]: function(state, { payload }) {
|
||||
const folder = payload.folder;
|
||||
const recentFolders = _.remove([...state.recentFolders], { folder });
|
||||
const recentFolders = [...state.recentFolders];
|
||||
const index = recentFolders.findIndex((r) => r.folder === folder);
|
||||
|
||||
recentFolders.splice(index, 1);
|
||||
|
||||
return Object.assign({}, state, { recentFolders });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user