Add Lyrics practice: search, translate, and read Spanish song lyrics

New feature in the Practice tab that lets users search for Spanish songs
by artist + title, fetch lyrics from LRCLIB (free, no API key), pull
album art from iTunes Search API, auto-translate to English via Apple's
on-device Translation framework, and save for offline reading.

Components:
- SavedSong SwiftData model (local container, no CloudKit sync)
- LyricsSearchService actor (LRCLIB + iTunes Search, concurrent)
- LyricsSearchView (artist/song fields, result list with album art)
- LyricsConfirmationView (lyrics preview, auto-translation, save)
- LyricsLibraryView (saved songs list, swipe to delete)
- LyricsReaderView (Spanish lines with English subtitles)
- Practice tab integration (Lyrics button with NavigationLink)
- localStoreResetVersion bumped to 3 for schema migration

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-04-11 22:44:40 -05:00
parent 5fa1cc3921
commit faef20e5b8
9 changed files with 718 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
import SwiftData
import Foundation
@Model
public final class SavedSong {
public var id: String = ""
public var title: String = ""
public var artist: String = ""
public var lyricsES: String = ""
public var lyricsEN: String = ""
public var albumArtURL: String = ""
public var appleMusicURL: String = ""
public var savedDate: Date = Date()
public init(title: String, artist: String, lyricsES: String, lyricsEN: String, albumArtURL: String = "", appleMusicURL: String = "") {
self.id = UUID().uuidString
self.title = title
self.artist = artist
self.lyricsES = lyricsES
self.lyricsEN = lyricsEN
self.albumArtURL = albumArtURL
self.appleMusicURL = appleMusicURL
self.savedDate = Date()
}
}