fix: sort tv shows by date played (#741)

* Fix wrong "Date Played" sort for TV shows

* fix: change sortby dateplayed to seriesdateplayed right before retrieving items

---------

Co-authored-by: Jarne Demeulemeester <jarnedemeulemeester@gmail.com>
This commit is contained in:
Yusuf 2024-05-02 11:11:11 +03:00 committed by GitHub
parent 0733bd2b21
commit 9379e60fc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -61,7 +61,7 @@ constructor(
parentId = parentId,
includeTypes = itemType,
recursive = recursive,
sortBy = sortBy,
sortBy = if (libraryType == CollectionType.TvShows && sortBy == SortBy.DATE_PLAYED) SortBy.SERIES_DATE_PLAYED else sortBy, // Jellyfin uses a different enum for sorting series by data played
sortOrder = sortOrder,
).cachedIn(viewModelScope)
_uiState.emit(UiState.Normal(items))

View file

@ -7,6 +7,7 @@ enum class SortBy(val sortString: String) {
DATE_ADDED("DateCreated"),
DATE_PLAYED("DatePlayed"),
RELEASE_DATE("PremiereDate"),
SERIES_DATE_PLAYED("SeriesDatePlayed"),
;
companion object {