mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 21:29:36 +02:00
perf(rust): skip audio rewrites for identical FLAC metadata
This commit is contained in:
1 parent
3e50dd75d6
commit
96b037bb34
4 files changed
+213
-6
No files matched your search
@@ -4,7 +4,7 @@ use cap_std::fs::{File, OpenOptions};
|
||||
use serde_json::{Value, json};
|
||||
use spotiflac_core::tags::{
|
||||
embed_flac_metadata, rewrite_ac4_config, rewrite_ac4_metadata, rewrite_audio_tags,
|
||||
rewrite_m4a_freeform,
|
||||
rewrite_flac_tags_if_changed, rewrite_m4a_freeform,
|
||||
};
|
||||
use std::cell::RefCell;
|
||||
use std::collections::BTreeMap;
|
||||
@@ -218,6 +218,15 @@ impl Backend {
|
||||
matches!(format, "wav" | "aiff" | "aif" | "aifc"),
|
||||
&check,
|
||||
)?;
|
||||
if format == "flac" {
|
||||
return rewrite_flac_tags_if_changed(
|
||||
source,
|
||||
output,
|
||||
fields,
|
||||
cover.as_deref(),
|
||||
&check,
|
||||
);
|
||||
}
|
||||
rewrite_audio_tags(source, output, format, fields, cover.as_deref(), &check)?;
|
||||
Ok(true)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user