The report of an import used to be shown once in Settings and lost. Each import is now stored (migration 0030, spotify_imports) as the report in JSON, and GET /me/import/spotify lists the past ones, newest first. POST /me/import/spotify answers with the same shape plus id and created_at. The web app gets an Import page (menu, More tab) with the form and one card for each past import: plays read, added, already there, not in the library, the playlists it made and the artists that are missing. Settings only links to it. An import that finds nothing is not kept, and a report that cannot be stored is still returned to the person who asked.
11 lines
495 B
SQL
11 lines
495 B
SQL
-- What each import of a Spotify export did, kept so the numbers can be read again later: the report as JSON (see
|
|
-- internal/spotifyimport). The files themselves are never kept.
|
|
|
|
CREATE TABLE spotify_imports (
|
|
id INTEGER PRIMARY KEY,
|
|
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
created_at INTEGER NOT NULL, -- unix seconds
|
|
report TEXT NOT NULL
|
|
);
|
|
|
|
CREATE INDEX idx_spotify_imports_user ON spotify_imports(user_id, created_at DESC);
|