diff --git a/lib/suby/filename_parser.rb b/lib/suby/filename_parser.rb
index <HASH>..<HASH> 100644
--- a/lib/suby/filename_parser.rb
+++ b/lib/suby/filename_parser.rb
@@ -76,10 +76,11 @@ module Suby
       found = TVSHOW_PATTERNS.find { |pattern|
         pattern =~ filename
       }
-      if found
-        { type: :tvshow, show: clean_show_name($~[:show]), season: $~[:season].to_i, episode: $~[:episode].to_i }
-      elsif MOVIE_PATTERN =~ filename
-        { type: :movie, name: clean_show_name($~[:movie]), year: $~[:year].to_i }
+      if TVSHOW_PATTERNS.find { |pattern| pattern.match(filename) }
+        m = $~
+        { type: :tvshow, show: clean_show_name(m[:show]), season: m[:season].to_i, episode: m[:episode].to_i }
+      elsif m = MOVIE_PATTERN.match(filename)
+        { type: :movie, name: clean_show_name(m[:movie]), year: m[:year].to_i }
       else
         { type: :unknown, name: filename }
       end
refactor the filename parser