feat(import): keep the artist and the time of plays of artists I do not have

The plays of songs that are not in the library were only counted. Now, when
such a play counts as listened (not a skip, long enough), its artist and its
time are kept in a new table (migration 0031, outside_plays), so a model can
later learn which artists are played together, also those not in the library.
No title, album, IP address, country or platform is stored. The same play is
kept once however many times the export is imported, and the report says how
many were kept (history.kept_outside).
This commit is contained in:
tgiachi 2026-11-15 10:50:29 +01:00
commit 3ba087bcc5

View file

@ -2197,7 +2197,9 @@ paths:
Everything happens on this server and nothing is sent to anyone. The files are read from the request and not
kept, and of each play only the song, the artist, the album, the time and how it ended are read: the IP
addresses, the country and the platform in the file are never looked at.
addresses, the country and the platform in the file are never looked at. Of a play that is not in your
library and counts as listened, the name of the artist and the time are kept (and nothing else), so that
Sonda can learn which artists you play together.
A play is matched to a song of your library by artist and title (case, accents and punctuation do not matter,
a "Remastered" note on either side does not either, and any of the credited artists will do; a play of a
@ -5511,7 +5513,7 @@ components:
history:
type: object
additionalProperties: false
required: [entries, matched, imported, already_there, not_found, ignored]
required: [entries, matched, imported, already_there, not_found, ignored, kept_outside]
properties:
entries: {type: integer, description: 'Plays of songs that were read.'}
matched: {type: integer, description: 'Of those, the plays of a song of your library.'}
@ -5519,6 +5521,7 @@ components:
already_there: {type: integer, description: 'Matched and already recorded by an earlier import, or the same play in two files.'}
not_found: {type: integer, description: 'Plays of songs that are not in your library.'}
ignored: {type: integer, description: 'Podcast episodes, and plays with no time that can be read.'}
kept_outside: {type: integer, description: 'Of the plays not in your library, the ones that count as listened, whose artist and time are kept to learn what you listen to together (never the title, the album or anything else).'}
playlists:
type: array
items: