llakssz / CIAngel

Download GOOD CIAs on your 3DS!
189 stars 19 forks source link

If wings are stale, offer to update them on init #57

Closed cerea1killer closed 8 years ago

cerea1killer commented 8 years ago

utils.h defines JSON_UPDATE_INTERVAL_IN_SECONDS, which is set to 3 days at the moment. We can tweak this if we think its too short or long, but I like this.

Currently untested, I don't have my 3ds on me to try with

The easiest way to test this, would be to change the modified time of your wings.json to a few days ago, and then launch and see if it complains of a stale file and offers to download them.

If no one gets to this, I'll do it when I get home tonight

llakssz commented 8 years ago

let me know when you test to see if this works as is - then i will merge, it's a good idea!

cerea1killer commented 8 years ago

Bad news, stat() returns 0 for all timestamps, so we will have to go about this a different way. Maybe an extra file, if it doesnt exist, we assume the wings are old, and if it does, we use its stored time to estimate. I'll mess around

superbudvar commented 8 years ago

In libctru/include/3ds/sdmc.h I have a Result sdmc_getmtime(const char name, u64 mtime)?

It's fairly new, and not in the reference manual online, but if anything was going to retrieve the modified time of a file on the sd, I reckon it's that

cerea1killer commented 8 years ago

That worked, awesome.

Now tested and ready to go!

llakssz commented 8 years ago

Excellent, thanks for the work!