Skip to content

Commit

Permalink
fix opening of new showfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
maxjoehnk committed Dec 27, 2024
1 parent ba7f37c commit db8de17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions crates/mizer/src/mizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use mizer_console::ConsoleCategory;
use mizer_media::{MediaDiscovery, MediaServer};
use mizer_message_bus::MessageBus;
use mizer_module::{ProjectHandlerContext, Runtime};
use mizer_project_files::{HandlerContext, history::ProjectHistory};
use mizer_project_files::{HandlerContext, history::ProjectHistory, SHOWFILE_EXTENSION};
use mizer_runtime::DefaultRuntime;
use mizer_session::SessionState;
use mizer_status_bus::{ProjectStatus, StatusBus};
Expand All @@ -17,8 +17,6 @@ use crate::api::*;
use crate::flags::Flags;
use crate::project_handler::ErasedProjectHandler;

const SHOWFILE_EXTENSION: &str = "mshow";

pub struct Mizer {
pub flags: Flags,
pub runtime: DefaultRuntime,
Expand Down
2 changes: 2 additions & 0 deletions crates/projects/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ mod handler_context;
mod project_file;
mod media;

pub const SHOWFILE_EXTENSION: &str = "mshow";

#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct Project {
#[serde(default)]
Expand Down
3 changes: 2 additions & 1 deletion crates/projects/src/project_file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use indexmap::IndexMap;
use serde::{Deserialize, Serialize};
use zip::unstable::{LittleEndianReadExt, LittleEndianWriteExt};
pub(crate) use self::archive_file::ProjectArchive;
use crate::SHOWFILE_EXTENSION;

mod archive_file;

Expand All @@ -20,7 +21,7 @@ impl TryFrom<&Path> for ProjectFileType {
fn try_from(value: &Path) -> Result<Self, Self::Error> {
match value.extension().and_then(|ext| ext.to_str()) {
Some("yaml") | Some("yml") => Ok(Self::Yaml),
Some("zip") => Ok(Self::Zip),
Some(SHOWFILE_EXTENSION) => Ok(Self::Zip),
_ => anyhow::bail!("unsupported file type"),
}
}
Expand Down

0 comments on commit db8de17

Please sign in to comment.