Files
SpotiFLAC-Mobile/rust_backend/crates/core/src/metadata.rs
T
zarzet aa99726439 feat(backend): migrate production backend to Rust
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.
2026-09-14 22:58:27 +07:00

48 lines
1.4 KiB
Rust

//! Application metadata response schemas and built-in provider conversion.
mod catalog;
pub mod deezer;
pub mod musicbrainz;
pub mod reenrich;
pub mod share;
pub use catalog::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(default)]
pub struct TrackMetadata {
#[serde(skip_serializing_if = "String::is_empty")]
pub spotify_id: String,
pub artists: String,
pub name: String,
pub album_name: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub album_artist: String,
pub duration_ms: isize,
pub images: String,
pub release_date: String,
pub track_number: isize,
#[serde(skip_serializing_if = "zero")]
pub total_tracks: isize,
#[serde(skip_serializing_if = "zero")]
pub disc_number: isize,
#[serde(skip_serializing_if = "zero")]
pub total_discs: isize,
pub external_urls: String,
pub isrc: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub album_id: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub artist_id: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub album_type: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub composer: String,
#[serde(skip_serializing_if = "std::ops::Not::not")]
pub explicit: bool,
}
fn zero(value: &isize) -> bool {
*value == 0
}