lib/movier/lmdb.rb in movier-0.0.6 vs lib/movier/lmdb.rb in movier-0.0.7
- old
+ new
@@ -130,15 +130,16 @@
if open == "no" && @params[:shuffle]
find @params
elsif open && open.to_i > 0
movie = filtered[open.to_i - 1]
# TODO: fix this to use a pure ruby implementation
+ require 'shellwords'
nice_name = "#{movie[:title]} [#{movie[:year]}]"
- movie_dir = "#{movie[:path]}".gsub(" ", "\\ ")
+ movie_dir = Shellwords.escape(movie[:path])
movie_file = `find #{movie_dir} -type f`.strip.split("\n")
movie_file = movie_file.select{|f| File.size(f) > 100 * 2**20}.first
Movier.tip_now "Opening: #{nice_name} with VLC Player"
- `open "#{movie_file}" -a VLC &`
+ `open '#{movie_file}' -a VLC &`
end
end
def sort_movies
@movies = @movies.sort_by {|movie| movie[:weight] }.reverse