feat: new-music notices come from the scanner; request notices and the original specs go
release / web (push) Failing after 1m29s
release / go (push) Successful in 1m55s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 4m22s
release / android (push) Successful in 4m57s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 4m23s
release / web (push) Failing after 1m29s
release / go (push) Successful in 1m55s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 4m22s
release / android (push) Successful in 4m57s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 4m23s
Request notifications (approved, declined, completed, pending) are removed
along with the request flow that produced them. A new_music kind takes the
"new music arrived" slot: when a scan or a watcher batch finishes, the
scanner claims every album not yet announced (albums.announced_at) and tells
every user about the ones that are new: an album with a track on disk and
no track older than itself. The first import into an empty library, and an
album formed only by retagging tracks already held, announce nothing. One
notice per scan, carrying up to 50 albums and the total; it is never
coalesced, so a notice already emailed can't quietly absorb later arrivals.
It feeds the daily summary email, grouped by artist. Defaults: inbox and
email on, phone off.
Migration 0103 deletes request-kind notification rows and prefs, swaps the
kind CHECKs to new_music, and adds albums.announced_at with every album
held marked announced, so the first scan after it announces nothing old.
Web and Android: labels, the Android "Requests" settings section becomes
"New music", the shade channel your_requests becomes new_music (the old one
is deleted at startup), and "/" opens Home in the app. TrackLabel moves to
the notifications package. docs/smart-music-{server,client}-spec.md are
deleted per the operator; an Android comment loses the word "exchanges".
Grimoire #7666, #7671.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -77,36 +77,33 @@ func renderDigest(group EmailGroup, name string, items []pendingItem, base strin
|
||||
}
|
||||
|
||||
// summaryArtists groups new-music arrivals by artist, in the order each
|
||||
// artist first arrived, with each artist's albums and tracks under them. An
|
||||
// artist request has no title of its own; the artist links to its page.
|
||||
// artist first arrived, with each artist's albums under them.
|
||||
func summaryArtists(items []pendingItem, base string) []digestArtist {
|
||||
var out []digestArtist
|
||||
index := map[string]int{}
|
||||
for _, it := range items {
|
||||
var p Payload
|
||||
_ = json.Unmarshal(it.Payload, &p)
|
||||
artist, title := p.Artist, p.Title
|
||||
if artist == "" {
|
||||
// Rows from before Artist was recorded carry only "Artist – Title".
|
||||
artist, title, _ = strings.Cut(p.Name, " – ")
|
||||
}
|
||||
if artist == "" {
|
||||
artist = "Something you asked for"
|
||||
}
|
||||
i, ok := index[artist]
|
||||
if !ok {
|
||||
i = len(out)
|
||||
index[artist] = i
|
||||
out = append(out, digestArtist{Name: artist})
|
||||
}
|
||||
link := Render(it.Kind, it.Payload).Link
|
||||
if title == "" {
|
||||
if p.ArtistID != "" {
|
||||
out[i].URL = joinURL(base, link)
|
||||
for _, a := range p.Albums {
|
||||
artist := a.Artist
|
||||
if artist == "" {
|
||||
artist = "Unknown artist"
|
||||
}
|
||||
continue
|
||||
i, ok := index[artist]
|
||||
if !ok {
|
||||
i = len(out)
|
||||
index[artist] = i
|
||||
out = append(out, digestArtist{Name: artist})
|
||||
if a.ArtistID != "" {
|
||||
out[i].URL = joinURL(base, "/artists/"+a.ArtistID)
|
||||
}
|
||||
}
|
||||
link := "/"
|
||||
if a.AlbumID != "" {
|
||||
link = "/albums/" + a.AlbumID
|
||||
}
|
||||
out[i].Titles = append(out[i].Titles, digestLine{Title: a.Title, URL: joinURL(base, link)})
|
||||
}
|
||||
out[i].Titles = append(out[i].Titles, digestLine{Title: title, URL: joinURL(base, link)})
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user