1
0
Fork 0
mirror of https://github.com/suchmememanyskill/TegraExplorer.git synced 2024-11-22 20:06:43 +00:00

Add a check if 120 or 053 is missing

This commit is contained in:
Jeff 2024-05-27 20:36:57 +02:00
parent 6b84d6cd86
commit 51e8efc6a5

View file

@ -98,12 +98,29 @@ if(f.folders.len()!=0){p("Folders in save dir???")pe()}
f.files.foreach("x"){if(!is.contains(x)){if(delfile("bis:/save/"+x)){p("File deletion failed: ", x)pe()}}} f.files.foreach("x"){if(!is.contains(x)){if(delfile("bis:/save/"+x)){p("File deletion failed: ", x)pe()}}}
pr("Done!\nSetting up indexer save...") pr("Done!\nSetting up indexer save...")
if(fsexists("bis:/save/"+is[0]))
{
ba0=["BYTE[]",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00] ba0=["BYTE[]",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
ba120=["BYTE[]",0x20,0x01,0x00,0x00,0x00,0x00,0x00,0x80] ba120=["BYTE[]",0x20,0x01,0x00,0x00,0x00,0x00,0x00,0x80]
ba53=["BYTE[]",0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x80] ba53=["BYTE[]",0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x80]
imen=["BYTE[]",0x49,0x4D,0x45,0x4E,0x40,0x00,0x00,0x00,0x40,0x00,0x00,0x00] imen=["BYTE[]",0x49,0x4D,0x45,0x4E,0x40,0x00,0x00,0x00,0x40,0x00,0x00,0x00]
idb=["BYTE[]",0x49,0x4D,0x4B,0x56,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00].copy() # 0x02 imens idb=["BYTE[]",0x49,0x4D,0x4B,0x56,0x00,0x00,0x00,0x00].copy() # imkv
skip53 = !fsexists("bis:/save/"+is[1])
if(skip53)
{
idb.add(0x01) # 0x01 imen
pr("053 save not found!!! Skip indexing it...")
}.else()
{
idb.add(0x02) # 0x02 imens
}
idb.add(0x00)
idb.add(0x00)
idb.add(0x00)
# 120 save # 120 save
s=getfilesize("bis:/save/"+is[0]) s=getfilesize("bis:/save/"+is[0])
@ -136,6 +153,8 @@ idb.addrange(ba0)
idb.addrange(ba0) idb.addrange(ba0)
idb.addrange(ba0) idb.addrange(ba0)
if(!skip53)
{
# 53 save # 53 save
s=getfilesize("bis:/save/"+is[1]) s=getfilesize("bis:/save/"+is[1])
s1=s&0xFF s1=s&0xFF
@ -166,6 +185,7 @@ idb.addrange(ba0)
idb.addrange(ba0) idb.addrange(ba0)
idb.addrange(ba0) idb.addrange(ba0)
idb.addrange(ba0) idb.addrange(ba0)
}
idxs=readsave("bis:/save/"+is[2]) idxs=readsave("bis:/save/"+is[2])
if(idxs.resize("/imkvdb.arc",idb.len())){p("imkvdb resize failed")pe()} if(idxs.resize("/imkvdb.arc",idb.len())){p("imkvdb resize failed")pe()}
@ -174,8 +194,13 @@ if(idxs.resize("/lastPublishedId",ba0.len())){p("lastPublishedId resize failed")
if(idxs.write("/lastPublishedId",ba0)){p("lastPublishedId write failed")pe()} if(idxs.write("/lastPublishedId",ba0)){p("lastPublishedId write failed")pe()}
if(idxs.commit()){p("Indexer save commit failed")pe()} if(idxs.commit()){p("Indexer save commit failed")pe()}
idxs=0 idxs=0
pr("Done!")
}.else()
{
pr("120 save not found!!! Skip editing indexer save!!!")
}
pr("Done!\nDeleting user dirs...")ud=["Album","Contents","save","saveMeta","temp"] pr("\nDeleting user dirs...")ud=["Album","Contents","save","saveMeta","temp"]
if(mount("USER")){p("Mount failed!")pe()} if(mount("USER")){p("Mount failed!")pe()}
ud.foreach("x"){pr("\n"+x,"")if(deldir("bis:/"+x)){p("Dir deletion failed")pe()}mkdir("bis:/"+x)} ud.foreach("x"){pr("\n"+x,"")if(deldir("bis:/"+x)){p("Dir deletion failed")pe()}mkdir("bis:/"+x)}
mkdir("bis:/Contents/placehld")mkdir("bis:/Contents/registered") mkdir("bis:/Contents/placehld")mkdir("bis:/Contents/registered")