A review of the phone experience (the issue) found a desktop page made
smaller. What changes:
feat:
- The player bar is one row on a phone (cover, title, play and next, a thin
line of progress) and is not there while nothing plays. A tap or a swipe up
on it opens the full-screen player.
- The Back gesture closes the full-screen player instead of leaving the page
under it; a swipe down closes it too. The full queue is listed on a phone.
- The queue is kept in the browser: a reload, or a tab that Android throws
away, comes back paused on the same song at the same second. It belongs to
the person signed in and is forgotten on sign-out.
- Tabs have icons; the page starts at its top on a new route and back goes to
where the list was; a swipe on the page no longer reloads it.
fix:
- The player now knows when the system pauses the audio (another app, a
headset), so the button and the lock screen no longer say it plays.
- The lock screen has a working seek bar and the right play/pause state.
- The player bar was not hidden by max-sm:hidden: its grid rules were outside
the Tailwind layers and won. They are in the components layer now.
- Song rows give the title the room on a phone (no number column).
- The album header is centred and the greeting is smaller on a phone; recent
songs on Home show the artist.
- Thumbnails ask for the small cover (300 px) and not the 1000 px one.
- Pages use dvh, the viewport covers the notch, and the tabs keep clear of
the gesture bar; the update notice no longer sits on the bar.
- No grey tap flash, no double-tap delay, no image menu on a long press.
The image is now made for amd64 and for arm64, and each tag (X.Y.Z, X.Y,
latest) points at both, so a Raspberry Pi or an ARM NAS pulls the right one.
- Dockerfile: the web and Go stages run on the builder and the Go program is
cross-compiled (GOARCH from SONDA_ARCH or TARGETARCH); what the image needs
besides the program (time zones, the user, the folders) is made in a stage
of the builder, so the last stage runs no command and needs no emulation.
- release workflow: the runner has no Docker and cannot run ARM, and kaniko
takes the base of every stage for one platform, so the arm64 image starts
from the arm64 Alpine by digest (found at each release), kaniko builds one
image per architecture, and crane sets the architecture of each and joins
them under the tags.
The preset of the commit messages in its 10th version cannot be read by the generator of
the release notes that semantic-release 25 comes with: use its 8th, and pin the
analyzer and the generator too. Found by a dry run before the first release.
At every merge into main a workflow reads the Conventional Commits since the last release,
works out the version, writes CHANGELOG.md, tags the commit and makes the release on the
forge; when there is a release it builds the image from the tag and pushes it to
git.kmalloc.org/squid/sonda as X.Y.Z, X.Y and latest. The runner has no Docker, so the
image is built with kaniko.
The version is no longer written in the code: the release sets it (-X main.version) in the
Dockerfile and the Makefile, and a build that no release made says dev.
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