Saturday, 7 September 2013

Automatic log manager for Game of Thrones series.

I watch a lot of anime. When I started watching One Piece which had 500+ episodes, it was very hard for me to keep track of how many episodes I have seen already. So I used to keep a log file which always had the next episode's number and I used to manually update it whenever I watch an episode.

That was a good idea but not good enough :P. At least for awesome people like me doing work manually is too mainstream xD.
If you do all the work what is your computer there for???
So I wrote a script which automatically manages the log. And next time when I run the script it will continue from the place I stopped last time \m/. Now I am planning to start Game of Thrones TV series. People tell I'll like it because I am a big fan of Age of Empires and I love wars :D.

So now what I am planning to do is to automate viewing it just like I did for One piece. In the version of Game of Thrones which I have, each episode name has SxxExx in it. For example S02E09 is there in the file name of episode 9 in season 2. So using this I can iterate over series and inside that i can iterate over episodes.

Setup

Download the gist from here or copy it from here:

Step1

Place the script in the base folder which has folders of all the series. Make it executable:
$ chmod +x script.sh

Step2

create a file called "log" in the same folder. The log file contains current series number and episode number. For example if you are watching third episode of season 1, put 1:3 in that file and save it.

Running:

Just go that folder in terminal and do this:
$ ./script.sh

Now just enter the  number of episodes you want to watch in a stretch and enjoy!