Page 1 of 1

Rule Request: Tv Show Season and Episode

PostPosted: Sat Dec 14, 2013 1:20 pm
by ondrovic
I was wondering if someone could help provide how I would go about creating a rule to Automatically Add Season and Episode Number to tv show names?

Sometimes the shows come in as ShowName.S0xExx, and sometimes the come across as Show.Name.xxx
I really want to have a rule created to say if S0xExx not present the add to the name before moving to my conversion folder, the only other problem I see is it needs to detect if it is S9 or lower and add the S0, any help would be greatly appreciated

Re: Rule Request: Tv Show Season and Episode

PostPosted: Sun Dec 15, 2013 11:14 am
by ondrovic
I figured out how to do it using FileBot and this applescript

Code: Select all
set ProgramPath to "/Applications/FileBot.app/Contents/MacOS/filebot"
set FilePath to "/Users/ondrovic/Downloads/Converting/"
set FileTestPath to "MAIN:Users:ondrovic:Downloads:Converting:" as alias
set FormatFile to "{n}.{s00e00}.{t}"

tell application "Finder"
   set TVShowFileNames to name of every file in FileTestPath
end tell

repeat with TVShow in TVShowFileNames
   try
      set RenameFile to FilePath & TVShow
      do shell script (quoted form of ProgramPath) & " -rename " & (quoted form of RenameFile) & " --db TheTVDB --conflict skip -non-strict --format " & (quoted form of FormatFile)
   on error
      --do nothing
   end try
end repeat

Re: Rule Request: Tv Show Season and Episode

PostPosted: Mon Dec 16, 2013 12:26 pm
by Mr_Noodle
I normally would move this topic to another forum as you aren't supposed to post questions here but since you provided the answer (which qualifies as a tip), I'll leave it in place. ;)