mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Fix various small sort issues
This commit is contained in:
parent
1dd3a794f8
commit
8dcca76ec9
6 changed files with 11 additions and 11 deletions
|
@ -26,7 +26,7 @@ func NewAlbumRepository(ctx context.Context, o orm.Ormer) model.AlbumRepository
|
|||
r.ormer = o
|
||||
r.tableName = "album"
|
||||
r.sortMappings = map[string]string{
|
||||
"artist": "compilation asc, album_artist asc, name asc",
|
||||
"artist": "compilation asc, order_album_artist_name asc, order_album_name asc",
|
||||
"random": "RANDOM()",
|
||||
}
|
||||
r.filterMappings = map[string]filterFunc{
|
||||
|
|
|
@ -26,6 +26,9 @@ func NewArtistRepository(ctx context.Context, o orm.Ormer) model.ArtistRepositor
|
|||
r.ormer = o
|
||||
r.indexGroups = utils.ParseIndexGroups(conf.Server.IndexGroups)
|
||||
r.tableName = "artist"
|
||||
r.sortMappings = map[string]string{
|
||||
"name": "order_artist_name",
|
||||
}
|
||||
r.filterMappings = map[string]filterFunc{
|
||||
"name": fullTextFilter,
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@ func NewMediaFileRepository(ctx context.Context, o orm.Ormer) *mediaFileReposito
|
|||
r.ormer = o
|
||||
r.tableName = "media_file"
|
||||
r.sortMappings = map[string]string{
|
||||
"artist": "artist asc, album asc, disc_number asc, track_number asc",
|
||||
"album": "album asc, disc_number asc, track_number asc",
|
||||
"artist": "order_artist_name asc, album asc, disc_number asc, track_number asc",
|
||||
"album": "order_album_name asc, disc_number asc, track_number asc",
|
||||
}
|
||||
r.filterMappings = map[string]filterFunc{
|
||||
"title": fullTextFilter,
|
||||
|
|
|
@ -29,11 +29,10 @@ const AlbumListView = ({ hasShow, hasEdit, hasList, ...rest }) => {
|
|||
const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('md'))
|
||||
return (
|
||||
<Datagrid expand={<AlbumDetails />} rowClick={'show'} {...rest}>
|
||||
<TextField source="name" sortBy={'orderAlbumName'} />
|
||||
<TextField source="name" />
|
||||
<FunctionField
|
||||
source="artist"
|
||||
render={(r) => (r.albumArtist ? r.albumArtist : r.artist)}
|
||||
sortBy={'orderAlbumArtistName'}
|
||||
/>
|
||||
{isDesktop && <NumberField source="songCount" />}
|
||||
{isDesktop && <NumberField source="playCount" />}
|
||||
|
|
|
@ -26,7 +26,7 @@ const ArtistList = (props) => (
|
|||
<List
|
||||
{...props}
|
||||
title={<Title subTitle={'Artists'} />}
|
||||
sort={{ field: 'orderArtistName', order: 'ASC' }}
|
||||
sort={{ field: 'name', order: 'ASC' }}
|
||||
exporter={false}
|
||||
bulkActionButtons={false}
|
||||
filters={<ArtistFilter />}
|
||||
|
@ -34,7 +34,7 @@ const ArtistList = (props) => (
|
|||
pagination={<Pagination />}
|
||||
>
|
||||
<Datagrid rowClick={artistRowClick}>
|
||||
<TextField source="name" sortBy={'orderArtistName'} />
|
||||
<TextField source="name" />
|
||||
<NumberField source="albumCount" />
|
||||
</Datagrid>
|
||||
</List>
|
||||
|
|
|
@ -63,10 +63,8 @@ const SongList = (props) => {
|
|||
rowClick={(id, basePath, record) => dispatch(setTrack(record))}
|
||||
>
|
||||
<TextField source="title" />
|
||||
{isDesktop && (
|
||||
<AlbumLinkField source="album" sortBy={'orderAlbumName'} />
|
||||
)}
|
||||
<TextField source="artist" sortBy={'orderArtistName'} />
|
||||
{isDesktop && <AlbumLinkField source="album" />}
|
||||
<TextField source="artist" />
|
||||
{isDesktop && <NumberField source="trackNumber" />}
|
||||
{isDesktop && <NumberField source="playCount" />}
|
||||
{isDesktop && (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue