mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
Fixed: Sort authors by lastname, firstname
This commit is contained in:
@@ -78,7 +78,7 @@ class BlacklistRow extends Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (name === 'authors.sortName') {
|
||||
if (name === 'authorMetadata.sortName') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
<AuthorNameLink
|
||||
|
||||
@@ -93,7 +93,7 @@ class HistoryRow extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'authors.sortName') {
|
||||
if (name === 'authorMetadata.sortName') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
<AuthorNameLink
|
||||
|
||||
@@ -138,7 +138,7 @@ class QueueRow extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'authors.sortName') {
|
||||
if (name === 'authorMetadata.sortName') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ export const defaultState = {
|
||||
|
||||
columns: [
|
||||
{
|
||||
name: 'authors.sortName',
|
||||
name: 'authorMetadata.sortName',
|
||||
label: 'Author Name',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
|
||||
@@ -34,7 +34,7 @@ export const defaultState = {
|
||||
isModifiable: false
|
||||
},
|
||||
{
|
||||
name: 'authors.sortName',
|
||||
name: 'authorMetadata.sortName',
|
||||
label: 'Author',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
|
||||
@@ -63,7 +63,7 @@ export const defaultState = {
|
||||
isModifiable: false
|
||||
},
|
||||
{
|
||||
name: 'authors.sortName',
|
||||
name: 'authorMetadata.sortName',
|
||||
label: 'Author',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
|
||||
@@ -28,7 +28,7 @@ export const defaultState = {
|
||||
|
||||
columns: [
|
||||
{
|
||||
name: 'authors.sortName',
|
||||
name: 'authorMetadata.sortName',
|
||||
label: 'Author',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
@@ -91,7 +91,7 @@ export const defaultState = {
|
||||
|
||||
columns: [
|
||||
{
|
||||
name: 'authors.sortName',
|
||||
name: 'authorMetadata.sortName',
|
||||
label: 'Author',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import migrateAddAuthorDefaults from './migrateAddAuthorDefaults';
|
||||
import migrateAuthorSortKey from './migrateAuthorSortKey';
|
||||
|
||||
export default function migrate(persistedState) {
|
||||
migrateAddAuthorDefaults(persistedState);
|
||||
migrateAuthorSortKey(persistedState);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { get, set } from 'lodash';
|
||||
|
||||
const TABLES_TO_MIGRATE = ['blacklist', 'history', 'queue.paged', 'wanted.missing', 'wanted.cutoffUnmet'];
|
||||
|
||||
export default function migrateAuthorSortKey(persistedState) {
|
||||
|
||||
for (const table of TABLES_TO_MIGRATE) {
|
||||
const key = `${table}.sortKey`;
|
||||
const sortKey = get(persistedState, key);
|
||||
|
||||
if (sortKey === 'authors.sortName') {
|
||||
set(persistedState, key, 'authorMetadata.sortName');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ function CutoffUnmetRow(props) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (name === 'authors.sortName') {
|
||||
if (name === 'authorMetadata.sortName') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
<AuthorNameLink
|
||||
|
||||
@@ -45,7 +45,7 @@ function MissingRow(props) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (name === 'authors.sortName') {
|
||||
if (name === 'authorMetadata.sortName') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
<AuthorNameLink
|
||||
|
||||
Reference in New Issue
Block a user