Extracting Archives
Previously, I was planning to load the each archive into memory and process it there, but I have since realised that this is not a great option; Most of the archive is taken up with files other than the main message files (i.e. images), and most of those files will not need to be loaded into memory, as they will not be shown on screen. The down side is of course that this trades ram for storage, but that seems like an okay tradeoff. A fairly large archive I am testing with is only about 1.5 GB. It may be worth adding an in-memory only option later, however.
Part 1: Splitting the current function
The first thing I did was split the current function I had to load and process the archives into one for processing (which is now incomplete), and another to extract them. Based on the archive library’s docs, it was very simple to convert the in-memory code to extraction code.
Part 2: Foldering
At this point, the extraction code extracted just fine, but it recreated the folder structure from the zip archive, when all I wanted was the “Google Chat” folder. I decided to give each new loaded archive its own folder, numbered based on when it was added. (The archives do have a user number inside, but finding it would involve reading through the archive while it was in memory, and it didn’t appear to have any benefit.) This is the point where I got stuck for a while; I was attempting to get the number of folders in the directory, and the asynchronous function for getting that number never returned. I spent a while messing with print statements and try/catch statements trying to find a solution. Eventually, I found a synchronous version that solved the problem, as I am not trying to run this async, but I am still not sure what the real problem was. Either way, it is now extracting successfully. I need to make a note to look into this further.
Part 3: Screenshot
In writing this devlog, I really wasn’t sure what to put as a screenshot; nothing about the Ui has changed. Eventually I settled on showing the output save directory. to demonstrate how it properly extracts to a new folder.
Part 4: Time
I’m honestly not sure exactly what went on with he time on this devlog. When I started working on extraction, there were 10-15 minutes (it has been a while since I looked at the exact number) already listed‚ but i couldn’t’ figure out what I had been working on; I ended up reverting those changes and starting over. After that I got sick and went to a Bible school, so it has been a while since I made any meaningful progress. I am fairly certain that the time on this devlog is too high, but I am not exactly sure why (maybe the time I spent trying to work when I wasn’t feeling well?). Either way, my apologies, and I’m hoping to get this project back on track in the next devlog.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.