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>
26 lines
790 B
Swift
26 lines
790 B
Swift
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()
|
|
}
|
|
}
|