refactor: drop code nothing calls, and the sync log rows no app reads (#8002)
release / go (push) Successful in 1m56s
release / web (push) Successful in 1m18s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 4m0s
release / android (push) Successful in 4m20s
release / Build signed APK (push) Successful in 4m52s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 25s
release / Verify release artifacts (tag releases only) (push) Skipped

- library.ProbeDurationMs and IsAudioFile, and db.MigrationsFS, had no
  callers.
- The delta sync logged and hydrated like and playlist changes on every
  like, playlist edit and duplicate merge, including a GetPlaylistsByIDs
  query per sync. Android applies only artists, albums and tracks, and
  the web doesn't sync; likes and playlists reach both through their own
  endpoints and live events. The like and playlist-entry deletes also
  went to every caller unscoped, user ids included. They are no longer
  written or served, and migration 0112 clears the rows already logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-26 12:52:35 -05:00
co-authored by Claude Opus 5.5
parent 39fa740bff
commit 58fb2bbe9d
16 changed files with 29 additions and 350 deletions
-11
View File
@@ -5,7 +5,6 @@ import (
"embed"
"errors"
"fmt"
"io/fs"
"log/slog"
"github.com/golang-migrate/migrate/v4"
@@ -17,16 +16,6 @@ import (
//go:embed migrations/*.sql
var migrationsFS embed.FS
// MigrationsFS exposes the embedded migration set for callers that need
// raw access (e.g. tests that construct their own migration runner).
func MigrationsFS() fs.FS {
sub, err := fs.Sub(migrationsFS, "migrations")
if err != nil {
panic(fmt.Sprintf("db: sub fs: %v", err))
}
return sub
}
// Open establishes a pgx connection pool. The caller owns the returned pool
// and must Close() it on shutdown.
func Open(ctx context.Context, dsn string) (*pgxpool.Pool, error) {
@@ -0,0 +1,2 @@
-- The cleared rows were never read; there is nothing to put back.
SELECT 1;
@@ -0,0 +1,7 @@
-- The delta sync (GET /api/library/sync) carries the shared library only:
-- artists, albums and tracks. Likes and playlists reach the apps through
-- their own endpoints and live events, so their rows here were written and
-- never read. Clear them. The entity_type check still admits the old
-- values, so a backup from before this change still restores; nothing
-- writes them any more.
DELETE FROM library_changes WHERE entity_type NOT IN ('artist', 'album', 'track');