mirror of
https://github.com/farfalleflickan/cmyflix.git
synced 2025-05-11 12:32:07 +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"
|
#include "main.h"
|
||||||
|
|
||||||
#define REPO_URL "https://github.com/farfalleflickan/cmyflix"
|
#define REPO_URL "https://github.com/farfalleflickan/cmyflix"
|
||||||
#define VERSION_STRING "0.21"
|
#define VERSION_STRING "0.22"
|
||||||
|
|
||||||
// GLOBAL VARIABLES
|
// GLOBAL VARIABLES
|
||||||
FILE *LOGFILE=NULL;
|
FILE *LOGFILE=NULL;
|
||||||
@ -268,8 +268,13 @@ void cleanMode(progConfig *conf, progFlags flags) {
|
|||||||
if (threadArgTV.oldJSON!=NULL) {
|
if (threadArgTV.oldJSON!=NULL) {
|
||||||
char *newDB=cJSON_Print(threadArgTV.oldJSON);
|
char *newDB=cJSON_Print(threadArgTV.oldJSON);
|
||||||
cJSON_Delete(threadArgTV.oldJSON);
|
cJSON_Delete(threadArgTV.oldJSON);
|
||||||
|
freeFileMem(conf->dbNameTV, conf->tvDB_str);
|
||||||
writeCharToFile(newDB, conf->dbNameTV);
|
writeCharToFile(newDB, conf->dbNameTV);
|
||||||
tryFree(newDB);
|
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 {
|
} else {
|
||||||
printInfo("cleanMode warning", true, "oldJSON was NULL!\n");
|
printInfo("cleanMode warning", true, "oldJSON was NULL!\n");
|
||||||
}
|
}
|
||||||
@ -279,8 +284,13 @@ void cleanMode(progConfig *conf, progFlags flags) {
|
|||||||
if (threadArgMovies.oldJSON!=NULL) {
|
if (threadArgMovies.oldJSON!=NULL) {
|
||||||
char *newDB=cJSON_Print(threadArgMovies.oldJSON);
|
char *newDB=cJSON_Print(threadArgMovies.oldJSON);
|
||||||
cJSON_Delete(threadArgMovies.oldJSON);
|
cJSON_Delete(threadArgMovies.oldJSON);
|
||||||
|
freeFileMem(conf->dbNameMovie, conf->moDB_str);
|
||||||
writeCharToFile(newDB, conf->dbNameMovie);
|
writeCharToFile(newDB, conf->dbNameMovie);
|
||||||
tryFree(newDB);
|
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 {
|
} else {
|
||||||
printInfo("cleanMode warning", true, "oldJSON was NULL!\n");
|
printInfo("cleanMode warning", true, "oldJSON was NULL!\n");
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ struct fileList *createTVShowDB(progConfig *conf) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} 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;
|
threadObj[i].oldJSON=NULL;
|
||||||
conf->tvDB_exists=false;
|
conf->tvDB_exists=false;
|
||||||
cJSON_Delete(tempJSON);
|
cJSON_Delete(tempJSON);
|
||||||
|
Loading…
Reference in New Issue
Block a user