diff --git a/Cargo.lock b/Cargo.lock index 9c02c2f304..d2e2a9596f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3330,6 +3330,7 @@ dependencies = [ "importer-models", "itertools 0.13.0", "media-models", + "nanoid", "providers", "regex", "reqwest 0.12.9", @@ -3344,7 +3345,6 @@ dependencies = [ "supporting-service", "tracing", "traits", - "uuid", ] [[package]] diff --git a/crates/services/importer/Cargo.toml b/crates/services/importer/Cargo.toml index acbcf9a24c..8b76dfbc8e 100644 --- a/crates/services/importer/Cargo.toml +++ b/crates/services/importer/Cargo.toml @@ -27,6 +27,7 @@ flate2 = { workspace = true } importer-models = { path = "../../models/importer" } itertools = { workspace = true } media-models = { path = "../../models/media" } +nanoid = { workspace = true } providers = { path = "../../providers" } regex = { workspace = true } reqwest = { workspace = true } @@ -41,7 +42,6 @@ specific-models = { path = "../../models/specific" } supporting-service = { path = "../supporting" } tracing = { workspace = true } traits = { path = "../../traits" } -uuid = { workspace = true } [package.metadata.cargo-machete] ignored = ["tracing"] diff --git a/crates/services/importer/src/strong_app.rs b/crates/services/importer/src/strong_app.rs index cabf5362cb..e8e3829d4a 100644 --- a/crates/services/importer/src/strong_app.rs +++ b/crates/services/importer/src/strong_app.rs @@ -13,12 +13,12 @@ use fitness_models::{ use importer_models::{ImportFailStep, ImportFailedItem}; use itertools::Itertools; use media_models::DeployStrongAppImportInput; +use nanoid::nanoid; use rust_decimal::Decimal; use rust_decimal_macros::dec; use sea_orm::{ColumnTrait, EntityTrait, QueryFilter}; use serde::{Deserialize, Serialize}; use supporting_service::SupportingService; -use uuid::Uuid; use super::utils; @@ -118,7 +118,7 @@ pub async fn import( } else if let Some(mem_ex) = unique_exercises.get(&entry.exercise_name) { mem_ex.id.clone() } else { - let id = format!("{} [{}]", entry.exercise_name, Uuid::new_v4()); + let id = format!("{} [{}]", entry.exercise_name, nanoid!(5)); unique_exercises.insert( entry.exercise_name.clone(), exercise::Model {