As I described in a previous post, I have commissioned a former student to create a Firefox OS app for me that will download and play books from the LibriVox audio books website.
My motivation for funding this project is twofold:
- To get a usable app for playing LibriVox books on my Firefox OS phone.
- To explore free software development best practices that we can then use in future projects.
Hey Jeff,Dominic [one of the Firefox OS Music player app developers] hasn't responded to me yet, but I've been thinking more about how the chapter files' metadata should be stored. I'm actually thinking that maybe json stored in each chapter folder isn't the best solution. I think sticking with localStorage is the better option, because it is reliable (we'll never have to worry about not having localStorage, whereas json files can be deleted) and only LibriFox can modify its own localStorage, whereas json files could be modified by other apps.
The downside to using localStorage, of course, is that the metadata doesn't follow the data, but is instead tied to the device. But how often are you really going to be swapping sdcards between devices? Worst case scenario, you might have to just redownload the chapters through the app on the new device rather than having them pop up automatically.
I don't know how to respond to Alex. I don't want to go down a path that is "expensive" both in time now and maintenance costs in the future, but I think that switching SD cards may happen more than Alex thinks, or at least it is not at all unlikely that an SD card will be removed, and when that happens, how should LibriFox behave?Depending on how much you care about the portability use case, I can also attempt to have it do what you were suggesting and pull data from the server based on the book id, assuming the files were originally downloaded through the app. Otherwise, it could fall back on ID3 tags if they are present. This gets pretty complicated, though.Let me know what your thoughts are!
Also, I know you were concerned about keeping the metadata in sync with the data, so I'm working on metadata validation. The latest commits to the repo have an object that scans the metadata and verifies all the paths when the app is started. It looks like there are filesystem events that I can hook into as well.
Alex is a terrific young programmer. He has great instincts and very high standards, which is why I was so happy about him taking on this "Summer of Code" project to begin with. But he did just graduate high school, and he lacks the wealth of experience that a veteran programmer would bring to a project like this.
I want to make the best contribution to Firefox OS that I can. As a teacher by trade, I also want this to be the best learning experience for Alex that it can be. For both of those goals to be realized, however, input from programmers who do have the experience Alex lacks will be required. I've been trying everything I know how to do reach out to the Mozilla and broader free software communities to ask for the help we need.
This blog post is part of that reaching out. If you think you can provide meaningful feedback to the questions Alex raises in his email, please send it our way. Thanks!