Files
music_library/backlog/completed/ml-40 - Two-different-pagination-query-styles-across-contexts.md
2026-05-04 21:22:27 +01:00

1.0 KiB

id, title, status, assignee, created_date, labels, dependencies, references, priority
id title status assignee created_date labels dependencies references priority
ML-40 Two different pagination query styles across contexts Done
2026-04-20 08:53
https://github.com/cloud8421/music_library/issues/137
low

Description

GitHub: created 2026-03-25 · updated 2026-03-25 · closed 2026-03-25

Description

Contexts use two different patterns for handling offset/limit pagination:

Style 1 — Keyword.get with defaults (used by Collection, RecordSets):

offset = Keyword.get(opts, :offset, 0)
limit = Keyword.get(opts, :limit, @pagination[:default_page_size])

Style 2 — Case statements (used by ScrobbleRules, OnlineStoreTemplates):

case opts[:offset] do
  nil -> ...
  offset -> ...
end

Expected behavior

Standardize on one approach. The Keyword.get pattern is simpler and more common in the codebase.

Found during

Codebase consistency audit (2026-03-25)