          # @param {String} filepath - Wanted filename
          # @return {Object} - $q promise
         ###
-        $scope.check_filepath = (filepath) ->
+        $scope.check_filepath = (file) ->
             q = $q.defer()
 
-            $scope.db.find { path: filepath }, (e, items) ->
+            $scope.db.find { path: file.path }, (e, items) ->
                 if e then q.reject e
                 else if items.length > 0 then q.reject "Movie already in library"
-                else q.resolve items
+                else q.resolve file
 
             q.promise
 

                            .then (data) ->

                                # Add filepath to db
                                movie = data[0]
                                movie.path = file.path

                                # Save data to DB
                                $scope.db.insert movie, (e, item) ->
                                    if e then return console.error e

                                    # Add data to main grid
                                    $scope.add_movie movie

                            .catch (e) ->
                                console.error e

        ###
        $scope.drop = (files) ->

            for _file in files

                # Check if movie is already in user's library
                $scope
                    .check_filepath _file
                    .then (file) ->

                        # Check for ext
                        filename = file.name.split(".")
                        ext = filename.pop()
                        if $scope.allowed.indexOf(ext) is -1
                            return

                        # Rejoin filename parts with a space (previously replaced all
                        # dots in name)
                        filename = filename.join " "



                        # Find movie infos
                        $trakt
