Fixed: Sorting by movie title in Blocklist and History

Fixes #9234
This commit is contained in:
Bogdan 2023-10-05 01:02:35 +03:00
parent 2bea61bae5
commit cb2bed93cb
5 changed files with 8 additions and 5 deletions

View File

@ -82,7 +82,7 @@ class BlocklistRow extends Component {
return null;
}
if (name === 'movies.sortTitle') {
if (name === 'movieMetadata.sortTitle') {
return (
<TableRowCell key={name}>
<MovieTitleLink

View File

@ -99,7 +99,7 @@ class HistoryRow extends Component {
);
}
if (name === 'movies.sortTitle') {
if (name === 'movieMetadata.sortTitle') {
return (
<TableRowCell key={name}>
<MovieTitleLink

View File

@ -32,7 +32,7 @@ export const defaultState = {
columns: [
{
name: 'movies.sortTitle',
name: 'movieMetadata.sortTitle',
label: () => translate('MovieTitle'),
isSortable: true,
isVisible: true

View File

@ -37,7 +37,7 @@ export const defaultState = {
isModifiable: false
},
{
name: 'movies.sortTitle',
name: 'movieMetadata.sortTitle',
label: () => translate('Movie'),
isSortable: true,
isVisible: true

View File

@ -48,7 +48,10 @@ namespace NzbDrone.Core.Blocklisting
Delete(x => movieIds.Contains(x.MovieId));
}
protected override SqlBuilder PagedBuilder() => new SqlBuilder(_database.DatabaseType).Join<Blocklist, Movie>((b, m) => b.MovieId == m.Id);
protected override SqlBuilder PagedBuilder() => new SqlBuilder(_database.DatabaseType)
.Join<Blocklist, Movie>((b, m) => b.MovieId == m.Id)
.LeftJoin<Movie, MovieMetadata>((m, mm) => m.MovieMetadataId == mm.Id);
protected override IEnumerable<Blocklist> PagedQuery(SqlBuilder sql) => _database.QueryJoined<Blocklist, Movie>(sql, (bl, movie) =>
{
bl.Movie = movie;