Skip to content

Commit

Permalink
Fixed --clean behaviour, version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
farfalleflickan committed Mar 16, 2023
1 parent 8ed17ed commit a3b57f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}
Expand All @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion src/tvshow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a3b57f7

Please sign in to comment.