Improve series overview loading speed (#800)

## Description
Improves loading speed for the series overview page (one with list of
episodes). This is mostly accomplished by querying for the cast/crew in
the episodes on demand instead of during the initial query.

Also stops using the date as a replacement for the episode index. Using
this caused an extra unnecessary (long) query.

Going from home to the 109th of a 230 episode season is ~2x faster with
this change on my test server.


### Related issues
Closes #599
This commit is contained in:
Ray 2026-01-30 11:34:12 -05:00 committed by GitHub
parent e7ed173692
commit 003fe8348c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 10 deletions

View file

@ -72,8 +72,7 @@ data class BaseItem(
@Transient
val aspectRatio: Float? = data.primaryImageAspectRatio?.toFloat()?.takeIf { it > 0 }
@Transient
val indexNumber = data.indexNumber ?: dateAsIndex()
val indexNumber get() = data.indexNumber
val playbackPosition get() = data.userData?.playbackPositionTicks?.ticks ?: Duration.ZERO