From 8c17194180e5776cc53759bace53aa2d7f04dc21 Mon Sep 17 00:00:00 2001 From: Matt Mascarenhas Date: Wed, 13 Jun 2018 16:05:21 +0100 Subject: [PATCH] cinera.c: Correctly set theme --- cinera/cinera.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/cinera/cinera.c b/cinera/cinera.c index 6caf3d6..2739a15 100644 --- a/cinera/cinera.c +++ b/cinera/cinera.c @@ -16,7 +16,7 @@ typedef struct version CINERA_APP_VERSION = { .Major = 0, .Minor = 5, - .Patch = 60 + .Patch = 61 }; // TODO(matt): Copy in the DB 3 stuff from cinera_working.c @@ -3031,15 +3031,22 @@ HMMLToBuffers(buffers *CollationBuffers, template **BespokeTemplate, char *Filen HaveErrors = TRUE; } - if(!HMML.metadata.project && !StringsDiffer(CollationBuffers->Theme, "")) + if(!StringsDiffer(CollationBuffers->Theme, "")) { - fprintf(stderr, "Unable to determine which theme to apply to the HTML\n" - "Please set at least one of:\n" - "\t1. project attribute in the [video] node of your .hmml file\n" - "\t2. ProjectID on the command line with -p\n" - "\t3. Style on the command line with -s\n" - ); - HaveErrors = TRUE; + if(HMML.metadata.project) + { + CopyStringNoFormat(CollationBuffers->Theme, sizeof(CollationBuffers->Theme), HMML.metadata.project); + } + else + { + fprintf(stderr, "Unable to determine which theme to apply to the HTML\n" + "Please set at least one of:\n" + "\t1. project attribute in the [video] node of your .hmml file\n" + "\t2. ProjectID on the command line with -p\n" + "\t3. Style on the command line with -s\n" + ); + HaveErrors = TRUE; + } } if(!HMML.metadata.id) @@ -6490,7 +6497,7 @@ main(int ArgC, char **Args) CopyStringNoFormat(CollationBuffers.ProjectID, sizeof(CollationBuffers.ProjectID), Config.ProjectID); if(!StringsDiffer(Config.Theme, "")) { - CopyStringNoFormat(Config.Theme, sizeof(Config.Theme), Config.ProjectID); + Config.Theme = Config.ProjectID; } CopyStringNoFormat(CollationBuffers.Theme, sizeof(CollationBuffers.Theme), Config.Theme); if(StringsDiffer(ProjectInfo[ProjectInfoIndex].FullName, ""))