Screenshot_2013-07-29-15-59-34

Last week, I wrote about how I started looking into using sqlite with Tasker, with my first creation being an add-on for a postal tracking app. Over the weekend, I played with it a bit more, and have a few more things working. I’m not ready to write a guide for sqlite in general yet (and honestly haven’t decided if I’m going to do one at all), but I wanted to share one of my sqlite creations to provide ideas for those who know how to do it already.

I’m a TV show junkie, and I follow a lot of series. That’s why I’m using TV Show Favs, an app that allows you to track the shows you’re following. I’ve wanted Tasker integration for a long while, but despite the developer promising to look into it, nothing has come of it. With my new knowledge of sqlite, however, I managed to create that interaction myself.

TV Show Favs stores all its information in a database. Episodes are stored in a table, with columns for air date, title, and so on. I wanted to create a notification system that would give me a notification each day for that day’s shows, so the first thing I needed to extract was what episodes would air that day. I did that by simply finding unix time values for the start and end of the day and then using the command you see in the screenshot to extract any episodes that air within that range.

This returns only the series_id, by design, as I don’t need to know what the episodes that air are called, just which shows they’re from. Only a numerical ID for the series is available in the episode list, however, not a title. To find the title, it refers to another table to find the title from the id, as seen in the second screenshot. It does this with a For loop for all IDs returned the first time. It then sticks those into a notification using AutoNotification. This is done automatically every morning a 5.

This is the second creation I’ve made with sqlite that adds something that I’ve wanted for a long time to an existing app. It’s great to be able to do things like that, and it saves you from having to create a complete framework from scratch just to get a tiny feature.