Skip to content

Instantly share code, notes, and snippets.

@XayOn
Created October 28, 2012 23:26
Show Gist options
  • Save XayOn/3970424 to your computer and use it in GitHub Desktop.
Save XayOn/3970424 to your computer and use it in GitHub Desktop.
Play the lastest file in a serie
# My dir structure is like this:
# Series name/
# Season X/
# Chapter
# So, this script get a random series and plays the lastest chapter
# This way, flexget gets all the tv series from me, and this command plays randomly the lastest chapter.
# Soon I'll add something like a read flag, or I'll check out the last file access, if last file access < 7 days, a new chapter is probably there!
a=(*); mplayer "$(find ${a[ $[ ( $RANDOM % ${#a[@]} ) + 1 ] - 1 ]}/*|tail -n1)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment