Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions crates/store/re_data_loader/src/load_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ pub fn load_from_path(

re_log::info!("Loading {path:?}…");

let application_id = path
.file_name()
.map(|f| f.to_string_lossy().to_string())
.map(ApplicationId::from);
// If no application ID was specified, we derive one from the filename.
let application_id = settings.application_id.clone().or_else(|| {
path.file_name()
.map(|f| f.to_string_lossy().to_string())
.map(ApplicationId::from)
});
let settings = &crate::DataLoaderSettings {
// When loading a LeRobot dataset, avoid sending a `SetStoreInfo` message since the LeRobot loader handles this automatically.
force_store_info: !crate::lerobot::is_lerobot_dataset(path),
Expand Down
4 changes: 1 addition & 3 deletions crates/store/re_data_loader/src/loader_mcap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,7 @@ pub fn load_mcap(
raw_fallback_enabled: bool,
) -> Result<(), DataLoaderError> {
re_tracing::profile_function!();

// If there's an open store, use it. If there's no store yet, use the recommended id.
let store_id = settings.opened_store_id_or_recommended();
Comment thread
oxkitsune marked this conversation as resolved.
let store_id = settings.recommended_store_id();

if tx
.send(LoadedData::LogMsg(
Expand Down
4 changes: 2 additions & 2 deletions crates/store/re_data_loader/src/loader_urdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl DataLoader for UrdfDataLoader {
robot,
&filepath,
&tx,
&settings.opened_store_id_or_recommended(),
&settings.recommended_store_id(),
&settings.entity_path_prefix,
)
.with_context(|| "Failed to load URDF file!")?;
Expand Down Expand Up @@ -112,7 +112,7 @@ impl DataLoader for UrdfDataLoader {
robot,
&filepath,
&tx,
&settings.opened_store_id_or_recommended(),
&settings.recommended_store_id(),
&settings.entity_path_prefix,
)
.with_context(|| "Failed to load URDF file!")?;
Expand Down
4 changes: 2 additions & 2 deletions crates/viewer/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2271,12 +2271,12 @@ impl App {
// welcome screen would end up in different recordings!

// If we don't have any application ID to recommend (which means we are on the welcome screen),
// then we use the file path as the application ID or generate a new one using a UUID.
// then we use the file path as the application ID or the file name if there is no path (on web builds).
let application_id = file
.path
.clone()
.map(|p| ApplicationId::from(p.display().to_string()))
.unwrap_or(ApplicationId::random());
.unwrap_or(ApplicationId::from(file.name.clone()));

// NOTE: We don't override blueprints' store IDs anyhow, so it is sound to assume that
// this can only be a recording.
Expand Down
Loading