mirror of
https://github.com/HabiRabbu/Musicseerr
synced 2026-04-21 13:37:27 +00:00
Various FE fixes
This commit is contained in:
parent
fd2be0ddd5
commit
407fd18b69
6 changed files with 13 additions and 7 deletions
|
|
@ -147,6 +147,6 @@ class LidarrHistoryRepository(LidarrBase):
|
|||
artist_mbid=artist_mbid,
|
||||
date_added=date_added,
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
return out
|
||||
return out
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ class ArtistService:
|
|||
)
|
||||
|
||||
_SCAN_BATCH = 100
|
||||
_MAX_SCAN_BATCHES = 20
|
||||
_MAX_SCAN_BATCHES = 2
|
||||
seen_mbids: set[str] = set()
|
||||
all_albums: list[ReleaseItem] = []
|
||||
all_singles: list[ReleaseItem] = []
|
||||
|
|
|
|||
|
|
@ -310,4 +310,4 @@ class TestFilterAwarePagination:
|
|||
|
||||
assert result.has_more is True
|
||||
assert result.next_offset is not None
|
||||
assert result.next_offset == 20
|
||||
assert result.next_offset == 2
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
};
|
||||
</script>
|
||||
|
||||
{#if nowPlayingMerged.primarySession}
|
||||
{#if nowPlayingMerged.primarySession && !nowPlayingMerged.primarySession._isLocal}
|
||||
{@const session = nowPlayingMerged.primarySession}
|
||||
{@const isPaused = session.is_paused}
|
||||
{@const href = sourceHub[session.source ?? ''] ?? '#'}
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ const BATCH_SIZE = 50;
|
|||
|
||||
export const getArtistReleasesInfiniteQuery = (getArtistId: Getter<string>) =>
|
||||
createInfiniteQuery(() => ({
|
||||
staleTime: CACHE_TTL.ARTIST_DETAIL_BASIC,
|
||||
queryKey: ArtistQueryKeyFactory.releases(getArtistId()),
|
||||
initialPageParam: 0,
|
||||
queryFn: async ({ pageParam = 0, signal }) => {
|
||||
|
|
|
|||
|
|
@ -128,6 +128,8 @@
|
|||
releasesQuery.data?.pages.flatMap((page) => [...page.albums, ...page.singles, ...page.eps])
|
||||
.length || 0
|
||||
);
|
||||
const initialReleasesLoading = $derived(releasesQuery.isLoading);
|
||||
const sourceTotalCount = $derived(releasesQuery.data?.pages[0]?.source_total_count ?? null);
|
||||
|
||||
$effect(() => {
|
||||
if (hasMoreReleases && !releasesQuery.isFetchingNextPage) {
|
||||
|
|
@ -328,7 +330,9 @@
|
|||
/>
|
||||
</section>
|
||||
|
||||
{#if hasMoreReleases || loadingMoreReleases}
|
||||
{#if initialReleasesLoading}
|
||||
<AlbumGridSkeleton title="Discography" count={12} />
|
||||
{:else if hasMoreReleases || loadingMoreReleases}
|
||||
<div
|
||||
class="flex items-center justify-center gap-3 p-4 bg-base-300 rounded-box mb-6"
|
||||
style="border: 2px solid {colors.accent};"
|
||||
|
|
@ -338,7 +342,8 @@
|
|||
<span class="font-semibold text-base" style="color: {colors.accent};"
|
||||
>Loading releases...</span
|
||||
>
|
||||
<span class="text-sm text-base-content/70">Loading {loadedReleaseCount} releases</span
|
||||
<span class="text-sm text-base-content/70"
|
||||
>{#if sourceTotalCount}Loaded {loadedReleaseCount} of {sourceTotalCount} releases{:else}Loading {loadedReleaseCount} releases{/if}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue