Commit graph

287 commits

Author SHA1 Message Date
squidd
8be9e93551 Merge pull request 'Fold the side menu to a strip of icons' (#196) from feat/sidebar-collapse into main 2026-11-15 15:11:04 +01:00
tgiachi
78f3f7ec9e feat(web): fold the side menu to a strip of icons
- a button next to the logo folds the menu to icons and opens it again
- folded, each link keeps its name for a screen reader and shows it as a tooltip, the group names stay for a screen reader, the logo becomes the mark
- the choice is kept in this device's storage
- no button on a phone, where the tabs replace the menu
2026-11-15 15:09:58 +01:00
squidd
0fb57fe4f0 Merge pull request 'An icon next to each link in the side menu' (#194) from feat/sidebar-icons into main 2026-11-15 15:06:39 +01:00
tgiachi
3512f0cbaa feat(web): an icon next to each link in the side menu
- each link has a lucide icon in place of the dot; the icon of the open page is the colour of this server, Friends keeps the friend colour
- the group headings line up with the words again
- tests: every link has a decorative icon, no two pages share one
2026-11-15 15:05:17 +01:00
squidd
fee06e2bb9 Merge pull request 'A page of the artists I sent to Lidarr, and whether they arrived' (#192) from feat/lidarr-requests into main 2026-11-15 12:33:31 +01:00
tgiachi
af933ad9ea feat(lidarr): a page of the artists I sent to Lidarr, and whether they arrived
Sonda kept no record of what an admin sent to Lidarr. Each send is now kept
(migration 0033, lidarr_requests), once for each artist, with the first date.
GET /lidarr/requests lists them newest first and says for each whether its
music is in the library: it is noticed when the list is read, by the artist
that was sent or by an artist of the same name that a scan made, and the day
it first was is kept.

The web app has a Requests page for admins, under Discover in the menu and on
Home on a phone, with the waiting and the arrived artists apart.
2026-11-15 12:32:29 +01:00
squidd
d31d4da1bd Merge pull request 'Organise the menu in groups' (#190) from feat/sidebar-groups into main 2026-11-15 12:17:14 +01:00
tgiachi
b2549336ba feat(web): the menu in groups
The left menu was a flat list of 14 links. It is now in groups, in the order
of what a person does: find (Home, Search, Discover), the library (Artists,
Albums, Songs, Playlists, Smart playlists, Mixes), their listening (History,
Import) and Friends, with Settings and Admin at the foot. Only the library and
the listening have a quiet heading; space tells the groups apart.

The phone follows it: the Library page lists the same rows in the same order
with a "Your listening" section, Discover (which has no tab) is a row at the
end of Home, and More keeps Settings and Admin.
2026-11-15 12:14:57 +01:00
squidd
2b6e80fda6 Merge pull request 'Browse my listening history by year and month' (#188) from feat/history into main 2026-11-15 12:08:08 +01:00
tgiachi
9f63121028 feat(history): browse my listening by year and month
GET /listens/months counts the listens that count in each calendar month,
newest first, in the time zone the client sends (the zone database is built
into the binary). GET /listens takes from and until to read one month, and
each listen now names its artists.

The web app has a History page: a button for each year with its listens, the
months of the year as bars, and the listens of the chosen month a day at a
time, with the choice kept in the address.
2026-11-15 12:07:19 +01:00
squidd
9ce7beb42d Merge pull request 'Suggestions learned from my own listening' (#186) from feat/suggestions into main 2026-11-15 11:10:26 +01:00
tgiachi
7c961028bb feat(discover): suggestions learned from my own listening
A new model (internal/affinity) splits my listening into sittings (plays less
than 30 minutes apart) and links the artists that are often played in the same
sitting. It is built from my listening events and from the plays of artists I
have no music of that an import kept, on my server, with no provider, and is
built again when plays are added (migration 0032 keeps it as a cache).

GET /me/suggestions gives two lists, each artist with the artists it goes
with: the ones I have and did not play for two months, and the ones I played
at least three times and have no music of. It needs discover_from_listening.
POST /me/suggestions/wishlist puts an artist I played on my wishlist by name.
Discover has a "From your listening" tab for both lists.
2026-11-15 11:09:19 +01:00
squidd
7b18478fe4 Merge pull request 'Keep the artist and the time of plays of artists I do not have' (#185) from feat/outside-plays into main 2026-11-15 10:51:26 +01:00
tgiachi
3ba087bcc5 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).
2026-11-15 10:50:29 +01:00
squidd
01cbab21be Merge pull request 'A page for imports, with the numbers of each one kept' (#182) from feat/import-page into main 2026-11-15 10:34:53 +01:00
tgiachi
aa4883b955 feat(import): an Import page, with the numbers of every import kept
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.
2026-11-15 10:34:12 +01:00
squidd
83b578ea4c Merge pull request 'Import my Spotify history and playlists' (#180) from feat/spotify-import into main 2026-11-14 16:27:02 +01:00
tgiachi
c08a234159 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.
2026-11-14 16:25:58 +01:00
squidd
2bc74b2d26 Merge pull request 'Play every song at a similar volume with ReplayGain' (#178) from feat/replaygain into main 2026-11-14 16:03:40 +01:00
tgiachi
a92326c1b4 feat(player): play every song at a similar volume with ReplayGain
I want songs from different albums to play at about the same loudness without touching the volume.

- The scan reads REPLAYGAIN_TRACK_GAIN, REPLAYGAIN_ALBUM_GAIN and the two peaks from each file, offline, and keeps them on the file (migration 0029, SQLite and PostgreSQL). A tag that makes no sense (not a number, more than 60 dB) is left out. Files indexed before have none until a full rescan.
- A track in the API carries them as replay_gain (null when its first playable file says nothing).
- The web player levels each song with them: the sound passes through a gain node, so a quiet song can be raised too, but never so much that its peak would clip (and never more than 12 dB when there is no peak). Without Web Audio the element is turned down instead.
- A new Playback section in Settings chooses song by song (default), album by album or off; the choice stays on the device.
- README: the ReplayGain entry, and the old line that said the year was not in the index is removed.
- English and Italian.
2026-11-14 16:02:23 +01:00
squidd
e9f85c2f39 Merge pull request 'Attiva and disattiva in the Italian texts' (#176) from fix/italian-on-off into main 2026-11-14 11:02:09 +01:00
tgiachi
d29d824f56 fix(i18n): attiva and disattiva instead of accendi and spegni
Providers, federation, Lidarr and Discover now say attiva, attivo, disattivato in Italian, which reads better for settings than accendi and spegni.
2026-11-14 11:00:44 +01:00
squidd
a507741460 Merge pull request 'A pass over the Italian texts' (#174) from fix/italian-pass into main 2026-11-14 10:52:54 +01:00
tgiachi
8263e0ca43 fix(i18n): a pass over the Italian texts
Rifai tutto sounded wrong, and a number of other texts were calques from English or used different words for the same thing.

- Riesegui tutto instead of Rifai tutto.
- brano everywhere instead of canzone, eliminare instead of cancellare, Successivo and Precedente in the player, one kind of quotes and of apostrophe.
- Fixes to sentences with the wrong meaning or grammar: removing a friend, the invite hint, the jobs that need a provider turned on, the plural of what a purge removes, the Duplicates texts.
2026-11-14 10:52:15 +01:00
squidd
f3ab8f0c8e Merge pull request 'Show the albums added last on Home' (#172) from feat/recently-added into main 2026-11-14 10:29:41 +01:00
tgiachi
246cdc63d3 feat: Recently added on Home, with a newest-first order for albums
I can now see on Home what I added to the library lately.

- GET /albums takes sort=recent: the albums added last first, by the date of the newest file of the album that is not missing, then the newest album. The default stays by title and any other value is invalid_input.
- The albums shelf on Home is Recently added and asks for that order; See all leads to /albums?sort=recent, which the albums page understands.
- English and Italian.
2026-11-14 10:29:08 +01:00
squidd
2f1a86dedb Merge pull request 'Smart playlists by the year a song came out' (#170) from feat/smart-year into main 2026-11-14 10:20:24 +01:00
tgiachi
d3695d00d6 feat(smart): smart playlists by the year a song came out
I can now ask for songs from a year to a year, for example the eighties.

- The year is read from the tags of each file (the original date first, then the date) and kept on the track: migration 0028 adds tracks.year (SQLite and PostgreSQL).
- Two new rules, min_year and max_year, both included and checked (1000 to 2999, the first not after the second). The index answers them. A song with no year never matches.
- Files indexed before have no year until a full rescan reads their tags again; the editor and the API description say so.
- The smart playlist editor gets From year and Up to year, and the rules are described in words.
- English and Italian.
2026-11-14 10:19:39 +01:00
squidd
6028d8e686 Merge pull request 'Say in Settings when Mastodon no longer accepts my token' (#168) from feat/mastodon-revoked-token into main 2026-11-14 10:04:56 +01:00
tgiachi
a7a258464b feat(mastodon): say in Settings when the instance no longer accepts the token
When the instance refuses the token on a post (it was revoked or expired), the account now remembers it: GET /me/mastodon says problem: token_refused and nothing is posted until I connect again with a new token.

- migration 0027 adds mastodon_accounts.problem (SQLite and PostgreSQL).
- Only a refused token marks the account; an instance that is down does not.
- Saving the account again clears the problem.
- Settings shows the warning and the form with the instance already filled in, next to Disconnect.
- English and Italian.
2026-11-14 10:04:07 +01:00
squidd
2962698baa Merge pull request 'A Duplicates section in the admin area' (#166) from feat/admin-duplicates into main 2026-11-14 09:53:28 +01:00
tgiachi
4ede6d4118 feat(web): a Duplicates section in the admin area
I can now see the songs that are in more than one file and delete the extra copies from Admin.

- A table of the copies of each song (album, format, bitrate, size, length) with the copy to keep already chosen and changeable.
- The check that reads the files, with a question first, progress, Stop, and the result of the last run; the groups are read again when it ends.
- Delete the others for one song and Clean all suggestions for all of them, each after a question that lists the files and the space it frees. It stops at the first refusal and says what was already deleted.
- With deleting off everything is visible and the delete buttons are disabled, with the reason.
- English and Italian.
2026-11-14 09:52:57 +01:00
squidd
58a596c88e Merge pull request 'Post what I listen to on Mastodon, if I connect an account' (#165) from feat/mastodon-post into main 2026-11-13 21:59:41 +01:00
tgiachi
0dc7782028 feat: post what I listen to on Mastodon, if I connect an account
In Settings a person connects their Mastodon account: the address of their instance and an access token that can only write posts. Nothing is connected by default, and disconnecting forgets the token.

- When a track of this server counts as a listen, it is posted as an unlisted status: title, artists, album and #NowPlaying, with no link. Music of a friend is never reported as a listen, so it is never posted. At most one post a minute for each person, in the background, with a bounded queue.
- PUT, GET and DELETE /me/mastodon. The token is never sent back.
- The address of the instance is typed by a person, so it must be a domain name on https, and the client never connects to a private, loopback or link-local address (checked on the address it really dials, so a name that points inside is no way in), never follows a redirect, ignores proxy settings and reads at most a megabyte.
- New table mastodon_accounts (SQLite and PostgreSQL) that goes with the account.
- README: the feature, and the credit for butterchurn and its presets.
2026-11-13 21:59:03 +01:00
squidd
7aa822f6bb Merge pull request 'The player can draw the sound as bars, an oscilloscope or Milkdrop' (#163) from feat/visualizers into main 2026-11-13 21:33:08 +01:00
tgiachi
1d19e014a3 feat(web): choose how the player draws the sound: bars, oscilloscope, Milkdrop
Settings has one choice, kept on the device, in place of the spectrogram switch: Spectrogram, Bars, Oscilloscope, Milkdrop or None. Whoever had turned the spectrogram off stays on None.

- Bars: the classic spectrum, with a cap on each bar that waits and falls.
- Oscilloscope: the wave of the sound as it plays.
- Milkdrop: butterchurn and its presets fill the background of the full-screen player behind a veil. They are loaded only when chosen, change by themselves every 25 seconds or with a button, and give way to the spectrogram where WebGL is missing or the system asks for less motion.
- The bar of the player keeps a small picture; for Milkdrop it is the spectrogram.
- The analyser also hands over the wave and the audio node.
2026-11-13 21:32:10 +01:00
squidd
f25d8f0dcf Merge pull request 'A switch in Settings to turn the spectrogram off' (#161) from feat/spectrogram-toggle into main 2026-11-13 19:53:17 +01:00
tgiachi
ce3c8598c8 feat(web): a switch in Settings to turn the spectrogram off
The choice stays on the device, like the theme. When it is off the player
draws nothing and the spectrogram is not there at all.
2026-11-13 19:52:36 +01:00
squidd
f17d9eb66d Merge pull request 'The seek bar shows the waveform of a friend's track' (#159) from feat/friend-waveform into main 2026-11-13 19:47:33 +01:00
tgiachi
7243fe7a04 feat: the seek bar shows the waveform of a friend's track
A friend's server works out the peaks of a track in a shared library and gives
them to a signed friend (GET /peer/tracks/{id}/peaks). This server asks for them
and passes them on to the listener after checking them: 1 to 1000 levels from 0
to 255, as many as the count says (GET /friends/{friend}/tracks/{id}/peaks). The
player uses it for a friend's track, so its bar is no longer flat.
2026-11-13 19:46:37 +01:00
squidd
1736fc5a29 Merge pull request 'The full-screen player fits the phone' (#157) from feat/ui-phone-player into main 2026-11-13 19:28:48 +01:00
tgiachi
3647c88723 feat(web): the full-screen player fits the phone
Close on the left, the friend in the middle and a queue button on the right;
a smaller cover, a smaller spectrogram and the controls spread across the
width, so they are in view without scrolling. The volume stays off a phone,
which has its own buttons. For a friend's track a note says the audio passes
through this server and the friend does not see who listens.
2026-11-13 19:28:17 +01:00
squidd
9c2c5ba884 Merge pull request 'Mixes as tiles of colour with the name big' (#155) from feat/ui-mixes into main 2026-11-13 19:22:39 +01:00
tgiachi
226ee72900 feat(web): mixes as tiles of colour with the name big
Each mix is a tile with its name and a note on where it comes from (my
listening or the genres of my files), in a colour that is always the same for
that mix. The tones of the missing covers are shared with the tiles.
2026-11-13 19:21:48 +01:00
squidd
d207787575 Merge pull request 'The Federation admin page like the mockup' (#153) from feat/ui-federation into main 2026-11-13 19:18:06 +01:00
tgiachi
69ec2abc1c feat(web): the Federation admin page like the mockup
Parts divided by lines instead of stacked blocks, the key of this server big
and in groups of four, the state of a friend as a pill in the friend colour,
two columns for the settings, the invites and the limits.
2026-11-13 19:17:04 +01:00
squidd
7a9aeab7d1 Merge pull request 'A bar of tabs at the bottom of the phone' (#151) from feat/ui-phone into main 2026-11-13 17:59:30 +01:00
tgiachi
35dabf48ef feat(web): a bar of tabs at the bottom of the phone
Home, Search, Library, Friends (only when there is a friend) and More,
under the player. The menu on the left stays on wide screens; on a phone
only the logo is left on top. New Library and More pages list the places
that do not fit in the bar.
2026-11-13 17:58:50 +01:00
squidd
cacb30d5ae Merge pull request 'Pages without boxes: rows, underlined tabs, one title style' (#149) from feat/ui-pages into main 2026-11-13 17:55:19 +01:00
tgiachi
1a03f70059 feat(web): pages without boxes: rows, underlined tabs, one title style
The fourth piece of the new look, first part.

- One component for the title of a page, larger than before; the greeting of
  Home is larger still.
- The cards of artists, albums, mixes, playlists and smart playlists are the
  picture and the words: no panel, no hover box, they still lift.
- The lists of the admin area (libraries, users, friends), of Discover (the
  suggestions and the wishlist) and of Friends are rows separated by a line.
  The providers, the jobs and the costs are sections divided by a line.
- The tabs of Discover, Admin and the music of a friend are underlined, in the
  colour of this server, or in the friend colour for a friend.
- The page of a friend has a band in the friend colour at its top edge.
- An artist with no picture is a quiet tile with its initial, not a loud one.
2026-11-13 17:54:25 +01:00