mirror of
https://github.com/markuryy/shark.git
synced 2026-07-26 15:01:02 +00:00
feat: re-encode cover images for rockbox compatibility
This commit is contained in:
@@ -37,6 +37,14 @@ fn read_audio_metadata(path: String) -> Result<metadata::AudioMetadata, String>
|
||||
metadata::read_audio_metadata(&path)
|
||||
}
|
||||
|
||||
/// Re-encode cover image as baseline JPEG for broad player compatibility
|
||||
#[tauri::command]
|
||||
async fn reencode_cover_image(data: Vec<u8>, quality: u8) -> Result<Vec<u8>, String> {
|
||||
tauri::async_runtime::spawn_blocking(move || tagger::reencode_cover_image(&data, quality))
|
||||
.await
|
||||
.map_err(|e| format!("Re-encode task failed: {}", e))?
|
||||
}
|
||||
|
||||
/// Decrypt Deezer track data (legacy - kept for backwards compatibility)
|
||||
#[tauri::command]
|
||||
async fn decrypt_deezer_track(data: Vec<u8>, track_id: String) -> Result<Vec<u8>, String> {
|
||||
@@ -405,6 +413,7 @@ pub fn run() {
|
||||
greet,
|
||||
tag_audio_file,
|
||||
read_audio_metadata,
|
||||
reencode_cover_image,
|
||||
decrypt_deezer_track,
|
||||
download_and_decrypt_track,
|
||||
device_sync::index_and_compare,
|
||||
|
||||
Reference in New Issue
Block a user