Skip to content

Commit

Permalink
🐛 Fix unordered OPDS entries
Browse files Browse the repository at this point in the history
Fixes #551
  • Loading branch information
aaronleopold committed Jan 7, 2025
1 parent 6d7759d commit a3e2d0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/server/src/routers/opds/v1_2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ async fn get_libraries(
let libraries = db
.library()
.find_many(vec![library_not_hidden_from_user_filter(user)])
.order_by(library::name::order(Direction::Asc))

Check warning on line 286 in apps/server/src/routers/opds/v1_2.rs

View check run for this annotation

Codecov / codecov/patch

apps/server/src/routers/opds/v1_2.rs#L286

Added line #L286 was not covered by tests
.exec()
.await?;
let entries = libraries
Expand Down Expand Up @@ -424,6 +425,7 @@ async fn get_series(
.find_many(chain_optional_iter([], [age_restrictions.clone()]))
.skip(skip)
.take(take)
.order_by(series::name::order(Direction::Asc))

Check warning on line 428 in apps/server/src/routers/opds/v1_2.rs

View check run for this annotation

Codecov / codecov/patch

apps/server/src/routers/opds/v1_2.rs#L428

Added line #L428 was not covered by tests
.exec()
.await?;

Expand Down Expand Up @@ -516,7 +518,6 @@ async fn get_series_by_id(
params: OPDSIDURLParams { id },
..
}): Path<OPDSURLParams<OPDSIDURLParams>>,
// Path((id, _)): Path<(String, String)>,
State(ctx): State<AppState>,
pagination: Query<PageQuery>,
Extension(req): Extension<RequestContext>,
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/routers/opds/v2_0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ async fn browse_libraries(
.find_many(library_conditions.clone())
.take(take)
.skip(skip)
.order_by(library::name::order(Direction::Asc))
.exec()
.await?;
let library_count = client.library().count(library_conditions).exec().await?;
Expand Down

0 comments on commit a3e2d0f

Please sign in to comment.