Every 15 minutes (library.auto_scan_minutes, SONDA_AUTO_SCAN_MINUTES, 0 turns it off)
Sonda takes the signature of each library, a hash of the names of everything in it folder
by folder, which costs only the names of the files and so suits a NAS that sleeps. A
library whose signature changed (a song or a folder came, went or was renamed) is
scanned the usual way; every library is also scanned at least once a day, to find a song
tagged again where it stands.
It does not scan while another scan runs, tries again at the next look when a scan failed,
leaves alone a folder that cannot be read (a NAS that is not mounted), and ignores the
housekeeping folders of a NAS.
The image is on the registry of git.kmalloc.org: git.kmalloc.org/squid/sonda:latest and
a tag with the commit. The README says so, with the commands for pulling and running
it, and compose.yaml says how to use it instead of building.
A new setting, radio_in_apps, off until the person turns it on (Settings, Apps and
devices, or PATCH /me/settings). With it off, the list of playlists of an OpenSubsonic
app is only the playlists of the person, and a station asked for by id is not found.
With it on, the stations come as playlists called Radio · Rock.
- migration 0036: user_settings.radio_in_apps
- usersettings, the settings API and the OpenAPI spec have the new field; the PATCH
now keeps each setting apart (naming one no longer sets the other)
- Settings has a switch
The Radio page shows the stations Sonda makes by itself, in groups (made for you,
by genre, by decade). A click starts one and the player knows it is a radio: before
the queue runs out it asks the server for other songs of the same station and puts
them at the end (not the ones already queued; a station so small that all its songs
are queued starts them over), one question at a time, never twice within two seconds,
and again after ten when the server cannot answer. Every artist has a Start radio
button. The full-screen player says which station plays.
- Radio item in the menu (Library group), on the Library page and in the phone tab
- player store: radio and appendTracks; useRadioRefill
Stations made from the music, random and without end, with nothing to set up: the
mixes the listener has (genres, favourites, rediscover, new to you), everything,
one for each decade that has 30 songs by 4 artists, and the radio of an artist (their
songs, four times as likely, and the songs of the two genres most of theirs have).
Every time a station is asked for it picks other songs, with the same weights as the
mixes (taste, hearts, nothing skipped lately).
- mixes.Service.Radios and Radio; Filter has All and years, the store has Decades
- GET /radio and GET /radio/{id}, in the OpenAPI spec
- OpenSubsonic: each station is a playlist (rd-<id>, "Radio · Rock") that has other
songs every time it is opened, for apps that cannot play a radio that never ends
Feishin asks getUser right after the login and failed on the missing user. getUser
now says who the login is, with the roles of an app (play, download, playlists,
covers; never admin), and only about the person of the login.
Also answered with nothing, because apps ask them straight away: getArtistInfo(2),
getAlbumInfo(2), getTopSongs, getSimilarSongs(2), getLyrics, getLyricsBySongId,
getInternetRadioStations, getScanStatus, startScan and the play queue calls, and
getStarred, the older way to ask for the favourites.
A call that is not known is now in the server log with its name.
A box on top of every page except the search (on a phone the Search tab does
this) opens a list while the person types: up to 3 artists, 3 albums and 5 songs,
each with its picture. A click opens an artist or an album and plays a song; the
arrows move through the list, Enter opens what is marked, or with nothing marked
the page with all the results, and Escape closes it. The last row, always in
sight, opens all the results.
The pictures of artists are not asked for: asking makes the server look the
artist up at a provider, which a list of whatever matched a few letters should
not do.
The base radius goes from 8 px to 2 px, which squares buttons, fields, dialogs,
covers and cards at once. The things that were made round on purpose are square
now too: the play button, the switch and its knob, the chip of a friend, the bars
of the statistics, the tab marker, the dot of a request, and the volume slider
(a thin track and a bar for a knob). The rings of a missing cover stay round:
they are the drawing of Sonda.
A heart adds to what the listening says of an artist: a favourite artist counts
as much as three complete listens, a favourite album 1.5 for its album artist and
a favourite song 1 for each of its main artists, at most 6 for one artist, without
fading with time. An artist hearted but never played is liked, with no listens.
That feeds Discover, the mixes and the smart playlists that use the taste, and
GET /me/taste.
In the mixes of what the listener likes (genre mixes, Your favourites,
Rediscover) a hearted song is wanted 1.5 times as much and a song on a hearted
album 1.25 times. New to you is not changed.
A heart on every song, album and artist, in the player bar and the full-screen
player, and a Favourites page with the songs, albums and artists, newest first.
The heart changes at once and goes back if the server refuses. Hearts are only
for music of this server: a friend's song has none.
- FavoriteButton, useIsFavorite and useSetFavorite
- /favorites page, a Favourites item in the Library group of the menu, on the
Library page and in the phone Library tab
A person can mark songs, albums and artists as favourites. They are theirs
alone: never shown to a friend, never sent anywhere. Only what can be played is
listed.
- migration 0035 favorites, internal/favorites, storage.FavoritesRepo
- PUT/DELETE /me/favorites/{kind}/{id}, GET /me/favorites/{kind} and
GET /me/favorites/ids, in the OpenAPI spec
- catalog.Filter IDs now also reads artists by id
- OpenSubsonic: star, unstar, getStarred2, the starred date on songs, albums and
artists, and getAlbumList2 of type starred
Apps can use the playlists of a person and report what they listened to.
- getPlaylists, getPlaylist, createPlaylist (with songs, or in place of an
existing one), updatePlaylist (name, comment, songs to add, places to remove),
deletePlaylist: the same playlists as the web app
- scrobble records a complete listen once however many times an app tries
again, and shares it on Mastodon when the person connected it; a now playing
message records nothing; getNowPlaying answers with nothing
- README section on connecting other apps
Apps can play and browse: stream and download send the original file (Range,
HEAD), getCoverArt serves the cover of an album, an artist or the album of a
song (300 pixels or less is the small one), getAlbumList2 knows every kind of
list, getRandomSongs and getSongsByGenre list songs, search3 finds artists,
albums and songs, and the starred calls answer with nothing so apps do not break.
- catalog.Filter has IDs to read albums and songs by id
- storage.SubsonicRepo answers the album and song lists (random, newest,
frequent, recent, by name, by artist, by year, by genre)
/rest speaks the OpenSubsonic API (Subsonic 1.16.1) so that other apps can browse
the music of a server. A call logs in with the password of a device: an apiKey,
Subsonic's token (u, t, s) or the password itself (u, p). The account password is
never accepted there.
- devices: ByKey, ByToken, ByPassword and the note of last use
- opensubsonic package: JSON and XML answers, ping, getLicense,
getOpenSubsonicExtensions, tokenInfo, getMusicFolders, getArtists, getArtist,
getAlbum, getSong, getGenres
- storage.SubsonicRepo: year, genres, size, bitrate, suffix and added date
A person can make a password for each app that connects to their server, in
Settings, Apps and devices. The secret is shown once, can be taken back, and
is for the music API of other apps only: it cannot sign in or change the
account. Secrets are kept sealed (AES-256-GCM, key derived from the jwt secret)
because token login needs them in clear, and a hash finds a device by its key.
- migration 0034 device_passwords (sqlite, postgres)
- internal/devices service, storage repo
- GET/POST /me/devices, DELETE /me/devices/{id}, in the OpenAPI spec
- Settings section with copy and remove
- GET /stats/listening has genre_timeline: the share of the five biggest genres, of the smaller ones and of the songs with no genre, for each year, or for each month when all the listens are in one year, in the listener's time zone; years and months with no listen are empty
- web: a stacked column chart on the Statistics page, coloured in tints of the colour of this server so it follows every theme, with a legend; left out when there is only one column
- README: the new field
- GET /stats/library: the songs that can be played with their artists, albums, length and size, the files by format, the share of each genre and decade
- GET /stats/listening: listens, time listened, songs and artists, listens by year, hour and weekday in the listener's time zone, top artists and songs, the share of each genre, for all time or a period
- a song with several genres is split between them, so the shares add up
- web: a Statistics page in the Your listening group, with bars made of CSS and four periods
- the MP3 files, which the scanner calls mpeg, are shown as MP3
- README: the two endpoints
Migrating hosting from Codeberg to git.kmalloc.org. Renames the
module path in go.mod, every internal import, and the OCI image
source label in the Dockerfile. Build and full test suite verified
green after the rename.
- GET /version (signed-in users only) answers the version and, when the binary knows it, the commit it was built from and whether the files had uncommitted changes
- the commit is read from the build info Go records in a git checkout, so no build flag is needed
- the side menu shows the version under the privacy line, and Settings has an About section with it
- the menu's own requests (friends, version) are not counted as requests of an admin page in the Shell tests
- the favicon and the four PNG icons are in the colours of the current theme (#08161d ground, #37e0c2 wave)
- IT: Rimuovi for every remove, Elimina where a file is deleted
- EN: Create (not Make) for an invite, a playlist and a token; '{{genre}} mix' in lower case
- phone tabs: the Friends bar is amber only when Friends is the open tab
- README: songs in the prose, tracks only in paths and fields
- a short description in the page head
- the provider settings are named where they are (Admin → Providers), not 'the server settings'
- EN: deleting duplicates says delete, 'song' everywhere, 'at least once' for the forgotten songs, 'email', 'photos' for artist pictures, singular and plural for the history months
- IT: impersonal like the rest of the text, 'niente' not 'nulla', 'mandato' for what is sent to Lidarr, 'playlist smart', 'importazione'
- type: nothing under 13px, the federation pages use the scale, dialog titles are bold like every heading
- no shadow on the update notice
- web manifest colours are the ones of the current theme
- README: 'turned on', 'email'
- 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
- 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
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.