mirror of
https://github.com/farfalleflickan/cmyflix.git
synced 2024-11-24 09:45:30 +00:00
Fixed --clean behaviour, version bump
This commit is contained in:
parent
8ed17ed69b
commit
a3b57f7033
12
src/main.c
12
src/main.c
@ -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");
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user