feat(import): bring my Spotify history and playlists in

I want my listening history and my playlists from Spotify in Sonda, so that Mixes, Discover and the smart playlists know what I listened to before.

- POST /me/import/spotify takes the zip of a Spotify data export, or the JSON files in it (extended streaming history, the older StreamingHistory files, the playlists), as a multipart form. A request may be up to 512 MB; the zip is limited in how much it may inflate and how many files it may hold, and only the history and playlist files are opened.
- Everything is read on the server and nothing is sent anywhere. The files are not kept, and of each play only the song, artist, album, time and how it ended are read: never the IP addresses, the country or the platform.
- A play is matched to a song of the library by artist and title (no case, accents or punctuation; a "Remastered" note on either side; any credited artist; a compilation by its album). A match is recorded as a listen at the time of the play: complete, skip or play. Nothing is posted to Mastodon.
- Importing the same files again records nothing twice, and the same play in the two shapes of history file is counted once. One import per person at a time.
- A playlist becomes a playlist of mine with the songs that were found; one with a name I already have is left alone, and one with none of its songs found is not made.
- The report counts what was added, what was already there and what is not in the library, and lists the missing artists, most played first.
- Settings gets an Import from Spotify section; the API client can send files.
- English and Italian.
This commit is contained in:
tgiachi 2026-11-14 16:25:58 +01:00
commit c08a234159
9 changed files with 2605 additions and 7 deletions

View file

@ -85,6 +85,36 @@ test('a JSON body is sent with its content type', async () => {
expect(JSON.parse(calls[0].init.body as string)).toEqual({ track_id: 3 })
})
test('files are sent as a form, which sets its own content type, and with the token', async () => {
const { calls } = mockFetch({ 'POST /api/v1/me/import/spotify': () => ({ ok: true }) })
const form = new FormData()
form.append('files', new File(['[]'], 'a.json'))
await api.upload('/me/import/spotify', form)
expect(calls[0].init.body).toBe(form)
const headers = calls[0].init.headers as Record<string, string>
expect(headers['Content-Type']).toBeUndefined() // the browser adds it, with the boundary
expect(headers.Authorization).toBe('Bearer t1')
})
test('files that were refused with a 401 are sent again with the renewed token', async () => {
let first = true
const { calls } = mockFetch({
'POST /api/v1/me/import/spotify': () => {
if (first) {
first = false
return apiError(401, 'unauthorized', 'expired')
}
return { ok: true }
},
})
const form = new FormData()
form.append('files', new File(['[]'], 'a.json'))
await api.upload('/me/import/spotify', form)
expect(calls).toHaveLength(2)
expect(calls[1].init.body).toBe(form)
expect(authorization(calls[1])).toBe('Bearer t2')
})
test('keepalive lets a request outlive the page', async () => {
const { calls } = mockFetch({ 'POST /api/v1/listens': () => ({ status: 'recorded' }) })
await api.post('/listens', { track_id: 3 }, { keepalive: true })

View file

@ -83,13 +83,15 @@ async function send(
signal: AbortSignal | undefined,
): Promise<Response> {
const headers: Record<string, string> = { Accept: 'application/json' }
if (body !== undefined) headers['Content-Type'] = 'application/json'
// A form (files) is sent as it is: the browser writes its content type, which carries the boundary.
const form = body instanceof FormData
if (body !== undefined && !form) headers['Content-Type'] = 'application/json'
if (token) headers.Authorization = `Bearer ${token}`
try {
return await fetch(url, {
method,
headers,
body: body === undefined ? undefined : JSON.stringify(body),
body: body === undefined ? undefined : form ? body : JSON.stringify(body),
keepalive: keepalive || undefined,
signal,
})
@ -119,6 +121,8 @@ async function request<T>(method: string, path: string, params: Query | undefine
export const api = {
get: <T>(path: string, params?: Query, opts: CallOptions = {}) => request<T>('GET', path, params, undefined, opts),
post: <T>(path: string, body?: unknown, opts: CallOptions = {}) => request<T>('POST', path, undefined, body ?? {}, opts),
/** Sends files, as a form. */
upload: <T>(path: string, form: FormData, opts: CallOptions = {}) => request<T>('POST', path, undefined, form, opts),
patch: <T>(path: string, body?: unknown, opts: CallOptions = {}) => request<T>('PATCH', path, undefined, body ?? {}, opts),
put: <T>(path: string, body?: unknown, opts: CallOptions = {}) => request<T>('PUT', path, undefined, body ?? {}, opts),
del: <T>(path: string, opts: CallOptions = {}) => request<T>('DELETE', path, undefined, undefined, opts),

View file

@ -0,0 +1,22 @@
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { api } from '@/api/client'
import type { components } from '@/api/schema'
export type SpotifyImportReport = components['schemas']['SpotifyImportReport']
/**
* Sends the files of a Spotify export (the zip, or the JSON files in it) to this server, which matches them to the
* library and records the listens and the playlists. When it is done everything that is made of listens or playlists is
* read again.
*/
export function useImportSpotify() {
const client = useQueryClient()
return useMutation({
mutationFn: (files: File[]) => {
const form = new FormData()
for (const file of files) form.append('files', file)
return api.upload<SpotifyImportReport>('/me/import/spotify', form)
},
onSuccess: () => client.invalidateQueries(),
})
}

View file

@ -1546,6 +1546,47 @@ export interface paths {
patch?: never;
trace?: never;
};
"/me/import/spotify": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Import your Spotify history and playlists
* @description Brings your listening history and your playlists from a Spotify data export into your own account, so that
* Mixes, Discover and the smart playlists know what you listened to before. Ask Spotify for your data (Account,
* Privacy, "Extended streaming history" and "Account data"), then send what it gives: the zip itself, or the
* JSON files in it (`Streaming_History_Audio_*.json`, the older `StreamingHistory_music_*.json`, and
* `Playlist*.json`), as a multipart form with one `files` field for each file. A request may be up to 512 MB.
*
* 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.
*
* 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
* compilation is matched by its album when Spotify names "Various Artists"). A match is recorded as a listen at
* the time of the play: `complete` when the play ran to its end (or nine tenths of the song were played),
* `skip` when Spotify says it was skipped or it was shorter than a listen, `play` otherwise. Importing does not
* post anything to Mastodon. Importing the same files again records nothing twice, and the same play in the
* extended history and in the older one is counted once.
*
* A playlist of the export becomes a playlist of yours with the songs that were found, in order. One whose
* name you already have is left alone (`exists`), and one with none of its songs in your library is not made
* (`empty`). The report lists what was not found, by artist, most played first, so you can see what is missing
* from your library. One import of yours runs at a time.
*/
post: operations["importMySpotify"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/artists/{id}/lidarr": {
parameters: {
query?: never;
@ -3760,6 +3801,44 @@ export interface components {
*/
discover_from_listening: boolean;
};
SpotifyImportReport: {
history: {
/** @description Plays of songs that were read. */
entries: number;
/** @description Of those, the plays of a song of your library. */
matched: number;
/** @description Recorded now. */
imported: number;
/** @description Matched and already recorded by an earlier import, or the same play in two files. */
already_there: number;
/** @description Plays of songs that are not in your library. */
not_found: number;
/** @description Podcast episodes, and plays with no time that can be read. */
ignored: number;
};
playlists: {
name: string;
/** @description Everything that was in the playlist, songs and not. */
tracks: number;
/** @description The songs of your library. */
matched: number;
/**
* @description `created`; `exists` (you already have one with that name, left alone); `empty` (none of its songs is in your library); `limit` (you have as many playlists as are allowed).
* @enum {string}
*/
status: "created" | "exists" | "empty" | "limit";
}[];
missing: {
/** @description How many artists have songs that were not found. */
total: number;
/** @description The artists with the most songs that were not found, at most 50, most first. */
artists: {
name: string;
/** @description Plays and playlist songs of this artist that were not found. */
count: number;
}[];
};
};
MastodonAccount: {
connected: boolean;
/** @description The instance, like `https://mastodon.social`. Only when connected. */
@ -6567,6 +6646,61 @@ export interface operations {
401: components["responses"]["Unauthorized"];
};
};
importMySpotify: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"multipart/form-data": {
/** @description The zip of the export, or its JSON files. */
files: string[];
};
};
};
responses: {
/** @description What the import did. */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SpotifyImportReport"];
};
};
/** @description No files were sent (`invalid_input`), none of them holds a history or playlists of Spotify (`no_spotify_data`) or one is damaged or cut short (`unreadable_file`). */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
401: components["responses"]["Unauthorized"];
/** @description An import of yours is still running (`import_running`). */
409: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description The files are larger than 512 MB, or hold more than can be imported once inflated (`too_large`). */
413: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
};
};
getArtistInLidarr: {
parameters: {
query?: never;

View file

@ -0,0 +1,109 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { render, screen, within } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { beforeEach, expect, test, vi } from 'vitest'
import { initI18n } from '@/i18n'
import { apiError, mockFetch, type MockRoutes } from '@/test/mockFetch'
import SpotifyImportBlock from './SpotifyImportBlock'
beforeEach(async () => {
vi.spyOn(navigator, 'language', 'get').mockReturnValue('en-US')
await initI18n()
})
const report = {
history: { entries: 120, matched: 100, imported: 80, already_there: 20, not_found: 20, ignored: 3 },
playlists: [
{ name: 'Road', tracks: 20, matched: 15, status: 'created' },
{ name: 'Mine', tracks: 5, matched: 5, status: 'exists' },
{ name: 'Nothing', tracks: 4, matched: 0, status: 'empty' },
],
missing: { total: 3, artists: [{ name: 'Blur', count: 9 }, { name: 'Oasis', count: 4 }] },
}
function setup(over: MockRoutes = {}) {
const mocked = mockFetch({ 'POST /api/v1/me/import/spotify': () => report, ...over })
const client = new QueryClient({ defaultOptions: { queries: { retry: false }, mutations: { retry: false } } })
render(
<QueryClientProvider client={client}>
<SpotifyImportBlock />
</QueryClientProvider>,
)
return mocked
}
const zip = new File(['PK'], 'my_spotify_data.zip', { type: 'application/zip' })
const json = new File(['[]'], 'Streaming_History_Audio_2020_0.json', { type: 'application/json' })
test('it says what is imported and that nothing leaves the server', () => {
setup()
expect(screen.getByText(/Extended streaming history/)).toBeInTheDocument()
expect(screen.getByText(/Nothing is sent anywhere and the files are not kept/)).toBeInTheDocument()
expect(screen.getByLabelText('Files from Spotify')).toHaveAttribute('multiple')
expect(screen.getByRole('button', { name: 'Import' })).toBeDisabled()
})
test('the files are sent together as a form, and the report says what was done', async () => {
const { calls } = setup()
await userEvent.upload(screen.getByLabelText('Files from Spotify'), [zip, json])
expect(screen.getByText('2 files chosen')).toBeInTheDocument()
await userEvent.click(screen.getByRole('button', { name: 'Import' }))
const done = await screen.findByRole('region', { name: 'Import done' })
const sent = calls.filter((c) => c.key === 'POST /api/v1/me/import/spotify')
expect(sent).toHaveLength(1)
const form = sent[0].init.body as FormData
expect(form.getAll('files').map((f) => (f as File).name)).toEqual(['my_spotify_data.zip', 'Streaming_History_Audio_2020_0.json'])
expect(within(done).getByText('80 listens added to your history.')).toBeInTheDocument()
expect(within(done).getByText('20 were already there.')).toBeInTheDocument()
expect(within(done).getByText('20 plays are of songs that are not in your library.')).toBeInTheDocument()
expect(within(done).getByText(/3 plays skipped/)).toBeInTheDocument()
expect(within(done).getByText('Road: 15 of 20 songs found')).toBeInTheDocument()
expect(within(done).getByText('Made')).toBeInTheDocument()
expect(within(done).getByText('You already have one with this name')).toBeInTheDocument()
expect(within(done).getByText('None of its songs is in your library')).toBeInTheDocument()
expect(within(done).getByText('Blur')).toBeInTheDocument()
expect(within(done).getByText('9')).toBeInTheDocument()
expect(within(done).getByText('and 1 more')).toBeInTheDocument() // 3 artists have songs not found, 2 are shown
})
test('while it works the button is off and says so', async () => {
let finish: (r: Response) => void = () => {}
setup({ 'POST /api/v1/me/import/spotify': () => new Promise<Response>((resolve) => (finish = resolve)) })
await userEvent.upload(screen.getByLabelText('Files from Spotify'), zip)
await userEvent.click(screen.getByRole('button', { name: 'Import' }))
expect(await screen.findByRole('status')).toHaveTextContent(/Importing/)
expect(screen.getByRole('button', { name: 'Import' })).toBeDisabled()
finish(new Response(JSON.stringify(report), { status: 200, headers: { 'Content-Type': 'application/json' } }))
expect(await screen.findByRole('region', { name: 'Import done' })).toBeInTheDocument()
})
test('files that are not Spotify’s are explained', async () => {
setup({ 'POST /api/v1/me/import/spotify': () => apiError(400, 'no_spotify_data', 'nothing') })
await userEvent.upload(screen.getByLabelText('Files from Spotify'), json)
await userEvent.click(screen.getByRole('button', { name: 'Import' }))
expect(await screen.findByRole('alert')).toHaveTextContent(/do not hold a Spotify streaming history or playlists/)
expect(screen.queryByRole('region', { name: 'Import done' })).not.toBeInTheDocument()
})
test('an import that is too large, damaged or already running has its own message', async () => {
for (const [code, text] of [
['too_large', /too large to import/],
['unreadable_file', /damaged or cut short/],
['import_running', /still running/],
] as const) {
document.body.innerHTML = ''
setup({ 'POST /api/v1/me/import/spotify': () => apiError(code === 'too_large' ? 413 : code === 'import_running' ? 409 : 400, code, 'x') })
await userEvent.upload(screen.getByLabelText('Files from Spotify'), zip)
await userEvent.click(screen.getByRole('button', { name: 'Import' }))
expect(await screen.findByRole('alert')).toHaveTextContent(text)
}
})
test('an import with no plays in it says so', async () => {
setup({ 'POST /api/v1/me/import/spotify': () => ({ ...report, history: { entries: 0, matched: 0, imported: 0, already_there: 0, not_found: 0, ignored: 0 }, playlists: [], missing: { total: 0, artists: [] } }) })
await userEvent.upload(screen.getByLabelText('Files from Spotify'), json)
await userEvent.click(screen.getByRole('button', { name: 'Import' }))
expect(await screen.findByText('No plays in these files.')).toBeInTheDocument()
})

View file

@ -0,0 +1,112 @@
import { useState, type ChangeEvent } from 'react'
import { useTranslation } from 'react-i18next'
import { ApiError } from '@/api/client'
import { useImportSpotify, type SpotifyImportReport } from '@/api/importSpotify'
import { Button } from '@/components/ui/button'
import { errorMessageKey } from '@/i18n'
/**
* Bringing the history and the playlists of a Spotify export in. The files are sent to this server, which reads them
* and keeps nothing of them but the listens and playlists that match the library; the report says what was done and
* which artists are missing from the library.
*/
export default function SpotifyImportBlock() {
const { t } = useTranslation()
const run = useImportSpotify()
const [files, setFiles] = useState<File[]>([])
function choose(event: ChangeEvent<HTMLInputElement>) {
setFiles(Array.from(event.target.files ?? []))
}
return (
<div className="flex max-w-xl flex-col gap-4">
<p>{t('spotify.intro')}</p>
<p className="text-sm text-muted-foreground">{t('spotify.privacy')}</p>
<div className="flex flex-col gap-2">
<label htmlFor="spotify-files" className="font-semibold">
{t('spotify.files')}
</label>
<input
id="spotify-files"
type="file"
multiple
accept=".zip,.json,application/zip,application/json"
onChange={choose}
className="text-sm file:mr-3 file:min-h-11 file:rounded-md file:border-0 file:bg-secondary file:px-4 file:font-semibold"
/>
{files.length > 0 && <p className="text-sm text-muted-foreground">{t('spotify.chosen', { count: files.length })}</p>}
</div>
<Button className="self-start" disabled={files.length === 0 || run.isPending} onClick={() => run.mutate(files)}>
{t('spotify.start')}
</Button>
{run.isPending && (
<p role="status" className="text-sm font-semibold">
{t('spotify.running')}
</p>
)}
{run.isError && (
<p role="alert" className="text-sm text-destructive">
{t(errorMessageKey(run.error instanceof ApiError ? run.error.code : 'unknown'))}
</p>
)}
{run.data && !run.isPending && <Report report={run.data} />}
</div>
)
}
function Report({ report }: { report: SpotifyImportReport }) {
const { t } = useTranslation()
const h = report.history
const more = report.missing.total - report.missing.artists.length
return (
<section aria-label={t('spotify.done')} className="flex flex-col gap-4 border-t border-border pt-4">
<h3 className="text-lg font-bold">{t('spotify.done')}</h3>
{h.entries === 0 && report.playlists.length === 0 ? (
<p>{t('spotify.noPlays')}</p>
) : (
h.entries > 0 && (
<ul className="flex flex-col gap-1 tabular-nums">
<li className="font-semibold">{t('spotify.imported', { count: h.imported })}</li>
{h.already_there > 0 && <li>{t('spotify.already', { count: h.already_there })}</li>}
{h.not_found > 0 && <li>{t('spotify.notFound', { count: h.not_found })}</li>}
{h.ignored > 0 && <li>{t('spotify.ignored', { count: h.ignored })}</li>}
</ul>
)
)}
{report.playlists.length > 0 && (
<div className="flex flex-col gap-2">
<h4 className="font-semibold">{t('spotify.playlists')}</h4>
<ul className="flex flex-col gap-2">
{report.playlists.map((p, i) => (
<li key={`${i}-${p.name}`} className="flex flex-col">
<span>{t('spotify.playlistLine', { name: p.name, matched: p.matched, tracks: p.tracks })}</span>
<span className="text-sm text-muted-foreground">{t(`spotify.status.${p.status}`)}</span>
</li>
))}
</ul>
</div>
)}
{report.missing.artists.length > 0 && (
<div className="flex flex-col gap-2">
<h4 className="font-semibold">{t('spotify.missing')}</h4>
<ul className="flex max-h-72 flex-col gap-1 overflow-y-auto text-sm">
{report.missing.artists.map((a) => (
<li key={a.name} className="flex justify-between gap-4">
<span>{a.name}</span>
<span className="tabular-nums text-muted-foreground">{a.count}</span>
</li>
))}
</ul>
{more > 0 && <p className="text-sm text-muted-foreground">{t('spotify.missingMore', { count: more })}</p>}
</div>
)}
</section>
)
}

View file

@ -99,6 +99,7 @@
"replayGainTrack": "Song by song",
"replayGainAlbum": "Album by album",
"replayGainOff": "Off",
"spotify": "Import from Spotify",
"password": "Password",
"currentPassword": "Current password",
"newPassword": "New password",
@ -768,6 +769,10 @@
"invalid_token": "The token is empty or too long.",
"mastodon_refused": "The instance refused that token. Check that it has the write:statuses permission.",
"mastodon_unreachable": "That instance could not be reached. Check the address and try again.",
"no_spotify_data": "These files do not hold a Spotify streaming history or playlists. Choose the zip that Spotify sent you, or the files named Streaming_History_Audio… and Playlist….",
"unreadable_file": "One of the files is damaged or cut short. Download your export from Spotify again.",
"too_large": "These files are too large to import (the limit is 512 MB). Choose only the files named Streaming_History_Audio… and Playlist….",
"import_running": "An import of yours is still running. Wait for it to end.",
"unknown": "Something went wrong. Try again.",
"playlist_not_found": "This playlist does not exist.",
"limit_reached": "Limit reached: a user can have 1000 playlists, and a playlist up to 10000 songs.",
@ -779,6 +784,35 @@
"suggested_not_found": "This suggested smart playlist does not exist.",
"smart_playlist_empty": "These rules give no songs to keep."
},
"spotify": {
"intro": "Bring in your listening history and your playlists from Spotify, so that your mixes, Discover and smart playlists know what you listened to before. Ask Spotify for your data (Account, Privacy, “Extended streaming history” and “Account data”), then choose the zip it sends you, or the JSON files inside it.",
"privacy": "Everything is read on your server. Nothing is sent anywhere and the files are not kept. Songs are matched to your library by artist and title; the ones you do not have are only counted.",
"files": "Files from Spotify",
"chosen_one": "{{count}} file chosen",
"chosen_other": "{{count}} files chosen",
"start": "Import",
"running": "Importing. With a long history this can take a minute…",
"done": "Import done",
"noPlays": "No plays in these files.",
"imported_one": "{{count}} listen added to your history.",
"imported_other": "{{count}} listens added to your history.",
"already_one": "{{count}} was already there.",
"already_other": "{{count}} were already there.",
"notFound_one": "{{count}} play is of a song that is not in your library.",
"notFound_other": "{{count}} plays are of songs that are not in your library.",
"ignored_one": "{{count}} play skipped (a podcast, or with no readable time).",
"ignored_other": "{{count}} plays skipped (podcasts, or with no readable time).",
"playlists": "Playlists",
"playlistLine": "{{name}}: {{matched}} of {{tracks}} songs found",
"status": {
"created": "Made",
"exists": "You already have one with this name",
"empty": "None of its songs is in your library",
"limit": "You have reached the limit of playlists"
},
"missing": "Artists you play on Spotify and have no music of here",
"missingMore": "and {{count}} more"
},
"playlists": {
"empty": "You have no playlists yet. Make one below, or put a song in a new one with the playlist button next to it.",
"newLabel": "Name of the new playlist",

View file

@ -99,6 +99,7 @@
"replayGainTrack": "Brano per brano",
"replayGainAlbum": "Album per album",
"replayGainOff": "Disattivato",
"spotify": "Importa da Spotify",
"password": "Password",
"currentPassword": "Password attuale",
"newPassword": "Nuova password",
@ -768,6 +769,10 @@
"invalid_token": "Il token è vuoto o troppo lungo.",
"mastodon_refused": "L'istanza ha rifiutato il token. Controlla che abbia il permesso write:statuses.",
"mastodon_unreachable": "Non riesco a raggiungere quell'istanza. Controlla l'indirizzo e riprova.",
"no_spotify_data": "Questi file non contengono una cronologia di streaming né playlist di Spotify. Scegli lo zip che Spotify ti ha mandato, oppure i file che si chiamano Streaming_History_Audio… e Playlist….",
"unreadable_file": "Uno dei file è danneggiato o tagliato. Scarica di nuovo i tuoi dati da Spotify.",
"too_large": "Questi file sono troppo grandi da importare (il limite è 512 MB). Scegli solo i file che si chiamano Streaming_History_Audio… e Playlist….",
"import_running": "Un tuo import è ancora in corso. Aspetta che finisca.",
"unknown": "Qualcosa è andato storto. Riprova.",
"playlist_not_found": "Questa playlist non esiste.",
"limit_reached": "Limite raggiunto: un utente può avere 1000 playlist e una playlist fino a 10000 brani.",
@ -779,6 +784,35 @@
"suggested_not_found": "Questa playlist smart suggerita non esiste.",
"smart_playlist_empty": "Con queste regole non ci sono brani da salvare."
},
"spotify": {
"intro": "Porta qui la cronologia di ascolto e le playlist di Spotify, così i tuoi mix, Discover e le smart playlist sanno cosa ascoltavi prima. Chiedi a Spotify i tuoi dati (Account, Privacy, «Cronologia di streaming estesa» e «Dati dell'account»), poi scegli lo zip che ti manda, oppure i file JSON che contiene.",
"privacy": "Tutto viene letto sul tuo server. Non viene inviato niente a nessuno e i file non vengono conservati. I brani si abbinano alla tua libreria per artista e titolo; quelli che non hai vengono solo contati.",
"files": "File di Spotify",
"chosen_one": "{{count}} file scelto",
"chosen_other": "{{count}} file scelti",
"start": "Importa",
"running": "Importazione in corso. Con una cronologia lunga può volerci un minuto…",
"done": "Importazione finita",
"noPlays": "Nessun ascolto in questi file.",
"imported_one": "{{count}} ascolto aggiunto alla cronologia.",
"imported_other": "{{count}} ascolti aggiunti alla cronologia.",
"already_one": "{{count}} c'era già.",
"already_other": "{{count}} c'erano già.",
"notFound_one": "{{count}} ascolto è di un brano che non è nella tua libreria.",
"notFound_other": "{{count}} ascolti sono di brani che non sono nella tua libreria.",
"ignored_one": "{{count}} ascolto saltato (un podcast, o senza un orario leggibile).",
"ignored_other": "{{count}} ascolti saltati (podcast, o senza un orario leggibile).",
"playlists": "Playlist",
"playlistLine": "{{name}}: trovati {{matched}} brani su {{tracks}}",
"status": {
"created": "Creata",
"exists": "Ne hai già una con questo nome",
"empty": "Nessuno dei suoi brani è nella tua libreria",
"limit": "Hai raggiunto il limite di playlist"
},
"missing": "Artisti che ascolti su Spotify e di cui qui non hai musica",
"missingMore": "e altri {{count}}"
},
"playlists": {
"empty": "Non hai ancora nessuna playlist. Creane una qui sotto, oppure metti un brano in una nuova con il pulsante accanto al brano.",
"newLabel": "Nome della nuova playlist",

View file

@ -5,6 +5,7 @@ import { logout, useSession } from '@/auth/session'
import ChoiceGroup from '@/components/ChoiceGroup'
import ListeningSwitch from '@/components/ListeningSwitch'
import MastodonBlock from '@/components/MastodonBlock'
import SpotifyImportBlock from '@/components/SpotifyImportBlock'
import Section from '@/components/Section'
import { useInstall } from '@/pwa/useInstall'
import { Button } from '@/components/ui/button'
@ -183,6 +184,10 @@ export default function SettingsPage() {
<MastodonBlock />
</Section>
<Section title={t('settings.spotify')}>
<SpotifyImportBlock />
</Section>
<Section title={t('settings.password')}>
<ChangePassword />
</Section>