Fixed --clean behaviour, version bump

This commit is contained in:
farfalleflickan 2023-03-16 15:14:15 +01:00
parent 8ed17ed69b
commit a3b57f7033
No known key found for this signature in database
GPG Key ID: 6506CE3E020FAF59
2 changed files with 12 additions and 2 deletions

View File

@ -17,7 +17,7 @@
#include "main.h"
#define REPO_URL "https://github.com/farfalleflickan/cmyflix"
#define VERSION_STRING "0.21"
#define VERSION_STRING "0.22"
// GLOBAL VARIABLES
FILE *LOGFILE=NULL;
@ -268,8 +268,13 @@ void cleanMode(progConfig *conf, progFlags flags) {
if (threadArgTV.oldJSON!=NULL) {
char *newDB=cJSON_Print(threadArgTV.oldJSON);
cJSON_Delete(threadArgTV.oldJSON);
freeFileMem(conf->dbNameTV, conf->tvDB_str);
writeCharToFile(newDB, conf->dbNameTV);
tryFree(newDB);
cJSON_Delete(conf->JSON_tvDB);
conf->JSON_tvDB=NULL;
conf->tvDB_str=fileToMem(conf->dbNameTV);
conf->JSON_tvDB=cJSON_Parse(conf->tvDB_str);
} else {
printInfo("cleanMode warning", true, "oldJSON was NULL!\n");
}
@ -279,8 +284,13 @@ void cleanMode(progConfig *conf, progFlags flags) {
if (threadArgMovies.oldJSON!=NULL) {
char *newDB=cJSON_Print(threadArgMovies.oldJSON);
cJSON_Delete(threadArgMovies.oldJSON);
freeFileMem(conf->dbNameMovie, conf->moDB_str);
writeCharToFile(newDB, conf->dbNameMovie);
tryFree(newDB);
cJSON_Delete(conf->JSON_moDB);
conf->JSON_moDB=NULL;
conf->moDB_str=fileToMem(conf->dbNameMovie);
conf->JSON_moDB=cJSON_Parse(conf->moDB_str);
} else {
printInfo("cleanMode warning", true, "oldJSON was NULL!\n");
}

View File

@ -49,7 +49,7 @@ struct fileList *createTVShowDB(progConfig *conf) {
break;
}
} else {
printError("createTVShowDB warning", false, "some errors occured while reading \"%s\", parts of the database will be rebuilt from scratch...\n", conf->dbNameTV);
printError("createTVShowDB warning", false, HYEL, "some errors occured while reading \"%s\", parts of the database will be rebuilt from scratch...\n", conf->dbNameTV);
threadObj[i].oldJSON=NULL;
conf->tvDB_exists=false;
cJSON_Delete(tempJSON);