@ -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 " ) ;
}
}