Skip to content

Commit

Permalink
error of [null]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kronos2308 committed Jul 22, 2022
1 parent aec2f48 commit b1cc0d4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
Binary file modified out/RipJKAnimeNX.nro
Binary file not shown.
10 changes: 7 additions & 3 deletions source/JKanime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ int AnimeLoader(void* data){

if (haschange || BD["TimeStamp"].is_null()) {
//update TimeStamp
if (BD["arrays"]["chapter"]["link"].is_null() || BD["arrays"]["chapter"]["link"][0] != ChapLink[0] || BD["TimeStamp"].is_null()) {
bool areNEQ = true;
if (BD["arrays"]["chapter"]["link"].size() > 0) areNEQ = BD["arrays"]["chapter"]["link"][0] != ChapLink[0];

if (BD["arrays"]["chapter"]["link"].is_null() || areNEQ || BD["TimeStamp"].is_null()) {

BD["TimeStamp"] = to_string(TimeNow());
cout << "# New TimeStamp: " << BD["TimeStamp"] << endl;

Expand Down Expand Up @@ -171,8 +175,8 @@ int AnimeLoader(void* data){

GOD.PlayEffect(GOD.proc);
Frames=1;
BD["arrays"]["chapter"]["link"]=ChapLink;
BD["arrays"]["chapter"]["images"]=ChapImag;
if (ChapLink.size() > 0) BD["arrays"]["chapter"]["link"]=ChapLink;
if (ChapImag.size() > 0) BD["arrays"]["chapter"]["images"]=ChapImag;
haschange = true;
}
} else {
Expand Down
2 changes: 2 additions & 0 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ int main(int argc, char **argv)

read_DB(BD,rootdirectory+"DataBase.json");

//temp fix
if (BD["arrays"]["chapter"]["link"] == "[null]"_json ){BD["arrays"]["chapter"]["link"]="null"_json;}
BD["com"] = "{}"_json;
if (isset(BD,"DataBase")) {
BD.erase("DataBase");
Expand Down
7 changes: 6 additions & 1 deletion source/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,9 @@ int E(int r){
ErrorCode+=result;
return result;
}

int getErrorCode(){
return ErrorCode;
}
void Memory(){
if (MLOG()) {
cout << "Log to Mem >" << endl;
Expand All @@ -634,6 +636,9 @@ void Files(){
fileLog.open("sdmc:/JK.log", ios::app);
fileLog << redirectStream.str();//get log from memory
cout.rdbuf(fileLog.rdbuf());
write_DB(AB,"sdmc:/AnimeBase.json.bak");
write_DB(BD,"sdmc:/DataBase.json.bak");
write_DB(UD,"sdmc:/UserData.json.bak");
}
}
void deinit(){
Expand Down
1 change: 1 addition & 0 deletions source/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ bool DoubleKill(vector<string>& data);
namespace LOG {
void init();
int E(int r);
int getErrorCode();
void Memory();
void Screen();
void Files();
Expand Down

0 comments on commit b1cc0d4

Please sign in to comment.