From 47edcad245e36d6cde4fa3221f44bdf1fc5c308d Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Tue, 17 Feb 2026 09:01:12 +0000 Subject: [PATCH] Update module docs --- lib/last_fm/feed.ex | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/last_fm/feed.ex b/lib/last_fm/feed.ex index 65815c7d..b0db3ba4 100644 --- a/lib/last_fm/feed.ex +++ b/lib/last_fm/feed.ex @@ -1,11 +1,10 @@ defmodule LastFm.Feed do @moduledoc """ - Holds a in-memory cache of scrobbled tracks. + Persists scrobbled tracks in `MusicLibrary.Repo` and publishes feed updates. - Tracks are keyed and ASC ordered by their scrobbling unix timestamp. While this - is technically prone to collision, it's very unlikely for that to happen since - scrobbles are sequential events that occur over time - a user can likely only listen - to one track at a time, and the timestamp has second-level precision. + Tracks are inserted into the `scrobbled_tracks` table with conflict handling on + `[:scrobbled_at_uts, :title]` to avoid duplicates, then scrobble rules are applied + to newly inserted rows. """ @insertable_fields [