mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-01 21:59:43 +02:00
Replace the Go backend with the Rust workspace and route Android/iOS through UniFFI bindings. Include the migrated extension runtime, network, providers, media metadata, downloads and library operations, with version 5.0.0+147. Remove Go sources, adapters, native build selection and CI dependencies. Build Rust unconditionally and lock the iOS Rust pod using a relative path. Retain legacy source and migration evidence in a local ignored archive. Validation: Android Kotlin compile and 53 native tests; Swift Rust-branch equivalence and syntax; CocoaPods install; workflow, shell, Ruby, plist and diff checks. Reuse the preceding 100 Rust tests, fmt/Clippy and five-ABI build checkpoint; no new APK or iOS application build for this cleanup. Known follow-up: URL/URLSearchParams globals are missing from the Rust JS runtime. A controlled extension replay confirms a URL-resolution regression; this commit does not fix that runtime gap.
38 lines
941 B
Rust
38 lines
941 B
Rust
pub mod builtin;
|
|
pub mod cache;
|
|
mod calls;
|
|
mod http;
|
|
pub mod lrclib;
|
|
mod service;
|
|
|
|
pub use calls::{CallGraph, CallNode, CallWait};
|
|
pub use service::{LyricsFetcher, LyricsService, SearchRequest};
|
|
|
|
use spotiflac_core::lyrics::errors::ErrorKind;
|
|
|
|
pub type Check<'a> = dyn Fn() -> Result<(), String> + Sync + 'a;
|
|
|
|
#[derive(Clone, Debug, Eq, PartialEq, thiserror::Error)]
|
|
pub enum LyricsError {
|
|
#[error("{0}")]
|
|
NotFound(String),
|
|
#[error("{0}")]
|
|
Unavailable(String),
|
|
#[error("{0}")]
|
|
Other(String),
|
|
#[error("{0}")]
|
|
Cancelled(String),
|
|
#[error("{0}")]
|
|
Recursive(String),
|
|
}
|
|
|
|
impl LyricsError {
|
|
pub fn classified(kind: ErrorKind, message: impl Into<String>) -> Self {
|
|
match kind {
|
|
ErrorKind::NotFound => Self::NotFound(message.into()),
|
|
ErrorKind::Unavailable => Self::Unavailable(message.into()),
|
|
ErrorKind::Other => Self::Other(message.into()),
|
|
}
|
|
}
|
|
}
|