Skip to content

Commit

Permalink
fix(LibriaRepository): exclusion of new episodes
Browse files Browse the repository at this point in the history
  • Loading branch information
urFate committed May 18, 2024
1 parent 7a3e323 commit 26aa3bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class ResourceViewModel(context: Context, private val contentType: ContentType)
content = content,
contentUid = combinedContent.content.uid,
cachedEpisodes = cachedEpisodes,
range = cachedEpisodes.last().episode.inc()..Int.MAX_VALUE
range = cachedEpisodes.last().episode.dec()..Int.MAX_VALUE
)
}
}.await()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ class LibriaRepository : AbstractContentRepository(
content: Content,
range: IntRange
): Flow<List<EpisodeEntity>> = flow {
val results = advancedSearch(content)

emit(
advancedSearch(content).subList(
range.first.coerceIn(0, range.first.dec()),
range.last.coerceIn(0, advancedSearch(content).size)
results.subList(
range.first.coerceIn(0, results.size),
range.last.coerceIn(0, results.size)
)
)
}
Expand Down

0 comments on commit 26aa3bc

Please sign in to comment.