forked from akai/readest
Sort the library by reading progress (current/total pages). Books that have never been opened read 0% and sort to the unread end; groups sort by their most-progressed book. Direction reuses the existing ascending/descending toggle, so "most read first" is Descending. Adds the "Progress Read" entry to the Sort by menu and translates it across all locales. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -544,6 +544,18 @@ describe('getGroupSortValue', () => {
|
||||
expect(getGroupSortValue(group, LibrarySortByType.Series)).toBe('My Series');
|
||||
});
|
||||
|
||||
it('should return max read ratio for progress sort', () => {
|
||||
const group = createMockGroup({
|
||||
books: [
|
||||
createMockBook({ progress: [10, 100] }),
|
||||
createMockBook({ progress: [80, 100] }),
|
||||
createMockBook({}),
|
||||
],
|
||||
});
|
||||
|
||||
expect(getGroupSortValue(group, LibrarySortByType.Progress)).toBe(0.8);
|
||||
});
|
||||
|
||||
it('should handle empty groups gracefully', () => {
|
||||
const group = createMockGroup({ books: [] });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user