Fixed a bug that caused the buffDir to get deleted before the app did
any work. Apparently the filesystem lib crashes the app if the directory
doesn't exists. Might need to add protection against that in the future.

Directory pages with now explicitly link to index.html since implicit
does not work for apache2.
This commit is contained in:
Maurice ONeal 2022-12-11 15:06:09 -05:00
parent 5ab50433cf
commit 2bd600bd51
3 changed files with 5 additions and 5 deletions

View File

@ -225,15 +225,15 @@ bool rdConf(shared_t *share)
share->outDir = cleanDir(share->webRoot) + "/" + share->camName; share->outDir = cleanDir(share->webRoot) + "/" + share->camName;
createDirTree(cleanDir(share->buffDir));
createDirTree(share->outDir);
if (share->init) if (share->init)
{ {
remove_all(share->buffDir.c_str()); remove_all(share->buffDir.c_str());
share->init = false; share->init = false;
} }
createDirTree(cleanDir(share->buffDir));
createDirTree(share->outDir);
} }
varFile.close(); varFile.close();

View File

@ -35,7 +35,7 @@ using namespace cv;
using namespace std; using namespace std;
using namespace std::filesystem; using namespace std::filesystem;
#define APP_VER "1.5.t4" #define APP_VER "1.5.t5"
#define APP_NAME "Motion Watch" #define APP_NAME "Motion Watch"
struct shared_t struct shared_t

View File

@ -33,7 +33,7 @@ void genHTMLul(const string &outputDir, const string &title, shared_t *share)
for (auto &&dirName : dirNames) for (auto &&dirName : dirNames)
{ {
htmlText += " <li><a href='" + dirName + "'>" + dirName + "</a></li>\n"; htmlText += " <li><a href='" + dirName + "/index.html'>" + dirName + "</a></li>\n";
} }
htmlText += "</ul>\n"; htmlText += "</ul>\n";