docs: document packages, exported API and non-obvious logic

This commit is contained in:
Mathis Maquenne
2026-08-06 13:04:10 +02:00
parent 5dfd832d0d
commit b1ad9b4904
41 changed files with 757 additions and 7 deletions
+11
View File
@@ -6,6 +6,17 @@ import (
"path/filepath"
)
// MigrateLegacy moves the download ledger from the old ~/.godeez directory
// next to the user's music, where it now lives.
//
// It is silent and best effort throughout. A failed migration costs the user
// their skip history, which the next download simply rebuilds, so there is
// nothing worth interrupting them about. An existing database at the new
// location always wins, which makes this safe to run on every download rather
// than needing a flag to say whether it has happened yet.
//
// The rename is attempted first and falls back to a copy, because the old and
// new locations are often on different filesystems.
func MigrateLegacy(outputDir string) {
homeDir, err := os.UserHomeDir()
if err != nil {