mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-08 06:16:37 +08:00
fix: group local search series results
This commit is contained in:
@@ -7,7 +7,7 @@ import { imageURL } from '../api/client'
|
||||
import { libraryAPI } from '../api/library'
|
||||
import { MediaCard } from '../components/MediaCard'
|
||||
import type { Library, Media } from '../types'
|
||||
import { artworkScore, groupSeries, type SeriesCard } from '../utils/groupSeries'
|
||||
import { artworkScore, groupSeries, seriesCardLink, type SeriesCard } from '../utils/groupSeries'
|
||||
|
||||
type LibraryPreview = {
|
||||
library: Library
|
||||
@@ -206,7 +206,7 @@ function LibraryShelf({ preview }: { preview: LibraryPreview }) {
|
||||
<MediaCard
|
||||
media={card.rep}
|
||||
count={card.count}
|
||||
linkTo={mediaCardLink(card)}
|
||||
linkTo={seriesCardLink(card)}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
@@ -226,13 +226,6 @@ function latestCards(items: Media[]): SeriesCard[] {
|
||||
.slice(0, 10)
|
||||
}
|
||||
|
||||
function mediaCardLink(card: SeriesCard): string {
|
||||
if (card.count > 1) {
|
||||
return `/library/${card.rep.library_id}?series=${encodeURIComponent(card.key)}`
|
||||
}
|
||||
return `/media/${card.rep.id}`
|
||||
}
|
||||
|
||||
function mediaTime(media: Media): number {
|
||||
return Date.parse(media.updated_at || media.created_at || '') || 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user