Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]: Sorting by duration when series collapsed uses first item duration instead of sum of all series duration #3432

Open
mattheys opened this issue Sep 17, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@mattheys
Copy link

What happened?

When you collapse the series in Library view and then sort by duration, the duration of the first item in the series seems to be chosen for the sorting. This should probably be a summation of the series duration as it makes the series look like it's the incorrect length.

What did you expect to happen?

The series with that longest combined runtime to be the top of the list.

Steps to reproduce the issue

  1. Go to Library (One that contains multiple books in a series)
  2. Collapse Series
  3. Sort by duration

Audiobookshelf version

2.13.4

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Chrome

Logs

No response

Additional Notes

Same can be said for the Size sorting as well.

@mattheys mattheys added the bug Something isn't working label Sep 17, 2024
@mikiher
Copy link
Contributor

mikiher commented Sep 19, 2024

@advplyr, do you consider this a bug or a feature?

I think it's a feature, not a bug. Collapse Series just represents all books of a series as one book entry, and should not affect the sorting of the library. The library view is still about books, not about series, and sorting as requested would not be an apple-to-apple comparison.

On the other hand, @mattheys may have a point.

@advplyr
Copy link
Owner

advplyr commented Sep 19, 2024

Using the total duration of the collapsed series is a feature request. However, what can be considered a bug is that currently it sorts the collapsed series using the first book, but doesn't show the duration.

image

Before switching to sqlite collapsed series were always put at the bottom for every sort except title. The series name is used for title sort. Now it is using the first book, but not showing the sort value which could be considered a bug.

There has been a lot of discussion about how to handle collapse series. Before switching to sqlite it was much easier to work with but now that we have to write queries that can be paginated with filter/sort it has become very difficult with the current data models.
I believe there is an open feature request for merging the authors for collapsed series and there are a few other threads about sorting collapsed series.

The library view is still about books, not about series, and sorting as requested would not be an apple-to-apple comparison.

This has been my primary argument against treating collapsed series as essentially a merged book. I think there is also a good argument to do it.

If we choose to do this we have to think of a new way to query for the data. I remember coming up with a possible solution in Discord, I'll have to try to find that old conversation.

@advplyr advplyr added enhancement New feature or request and removed bug Something isn't working labels Sep 19, 2024
@advplyr advplyr changed the title [Bug]: Sorting by duration when series collapsed uses first item duration instead of sum of all series duration [Enhancement]: Sorting by duration when series collapsed uses first item duration instead of sum of all series duration Sep 19, 2024
@advplyr
Copy link
Owner

advplyr commented Sep 19, 2024

I couldn't find the old discussion but I don't think it is worth pursuing this until we are fully off of the old library item model. It will be easier to optimize the queries when we don't have to make every query pulling the data needed for the old library item model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants