Skip to content

Add audiobook Date Added sorting and filtering - #841

Draft
therobbiedavis wants to merge 1 commit into
canaryfrom
feature/date-added-sorting-filtering
Draft

Add audiobook Date Added sorting and filtering#841
therobbiedavis wants to merge 1 commit into
canaryfrom
feature/date-added-sorting-filtering

Conversation

@therobbiedavis

Copy link
Copy Markdown
Collaborator

Summary

Supersedes #516 and moves the work onto a maintainer-owned branch so it can be completed and maintained without depending on write access to a contributor fork.

The original feature request and implementation originated with @T4g1 in #516 / discussion #513. This replacement preserves the existing #516 code state and attribution in the PR history while giving the Listenarr maintainers direct control of the branch for the remaining hardening and review work.

This feature adds a canonical Date Added value for audiobooks and exposes it throughout the library UI for sorting and custom filtering.

Changes

  • Persist an audiobook's library-added timestamp.
  • Expose added through library API/list DTOs.
  • Add Date Added sorting to the audiobook library.
  • Add Date Added as a custom-filter field with date comparisons.
  • Preserve UTC semantics for persisted timestamps.
  • Add legacy-upgrade/backfill support using durable library evidence where available.
  • Add automated coverage for migration, serialization, sorting, and filtering behavior.

Supersedes

Validation

The rebuilt #516 head was previously validated with the repository's backend/frontend CI and targeted Date Added regression coverage. Additional maintainer hardening identified during final review will be landed directly on this maintainer-owned branch before merge.

@therobbiedavis therobbiedavis added the minor minor version bump - add functionality in a backward compatible manner label Aug 20, 2026 — with ChatGPT Codex Connector
@therobbiedavis therobbiedavis self-assigned this Aug 20, 2026
@therobbiedavis
therobbiedavis requested a review from a team August 20, 2026 13:14

Copy link
Copy Markdown
Collaborator Author

Remaining maintainer hardening from final #516 review

The maintainer-owned branch currently matches the last pushed #516 head (0859c661). Before marking this PR ready, carry over the already-reviewed local finishing commit 229f1984 (fix: finalize audiobook date-added contracts). That commit was validated locally but was never pushed to the contributor fork.

It contains these fixes:

  • Remove the DateTime.UtcNow initializer from Audiobook.Added; assign the timestamp only at actual library-add commit boundaries.
  • Preserve Added in detached AudiobookRepository.UpdateAsync so unrelated/partial metadata updates cannot rewrite lifecycle metadata.
  • Make CollectionView Date Added sorting use the canonical added timestamp instead of audiobook ID.
  • Make the built-in Recently Added filter use added rather than publication year while preserving its existing current/previous-calendar-year window.
  • Expand backend/frontend regression coverage for UTC/null serialization, add-time persistence, detached-update preservation, CollectionView sorting, and Recently Added semantics.

Final validation performed on that exact local state:

  • Release backend build: 0 warnings / 0 errors
  • Backend: 2,999 passed, 156 platform-specific skips, 0 failed
  • Frontend Vitest: 600/600 passed
  • ESLint: passed
  • Vue template-handler checks: passed
  • Prettier: passed
  • vue-tsc: passed
  • Vite production build: passed
  • Two independent adversarial review passes after the final changes: zero findings

Keep this PR in draft until that delta is landed on feature/date-added-sorting-filtering and CI reruns on the resulting GitHub head.

Assert.Equal(1, item.GetProperty("fileCount").GetInt32());
Assert.True(item.TryGetProperty("added", out var added));
Assert.NotNull(book.Added);
Assert.Equal(book.Added.Value, added.GetDateTime());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor minor version bump - add functionality in a backward compatible manner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant