lib/movie-renamer.rb in movie-renamer-0.0.7 vs lib/movie-renamer.rb in movie-renamer-0.0.8

- old
+ new

@@ -81,11 +81,11 @@ end # attempt to remove the divx part from a filename def MovieRenamer::titleExtract(filename) r = %r{\s*\[?\(?\s*(d|D)(i|I)(v|V)(x|X)\s?(-|_)?\s?\w+\s*\)?\]?\s*} - filename.gsub(r,'') + filename.gsub(r,'').gsub(/\s?(-|_)\s?/,'') end # rename a movie according to movie data # and moves it to the new path in filesystem def MovieRenamer::renameMovie(movie,newpath = NEWPATH) @@ -236,10 +236,10 @@ end # makes a query to imdb database def MovieRenamer::suggestMovies(name) s = Imdb::Search.new(name) - s.movies.each do |m| + s.movies[0..5].each do |m| @output.puts "#{m.year} - #{m.director.to_s.gsub(/(\[")|("\])/,'')} - #{m.title.gsub(/ .*/,'')}" end end # TODO output string variable