movier 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/movier.rb +1 -0
- data/lib/movier/lmdb.rb +8 -16
- data/lib/movier/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0badd4508856c37a8b5058c7cdd20b7f1f58a28e
|
4
|
+
data.tar.gz: 125ea20f8f286fe15572f8f14a2d032ac36f77c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcb9ea902e193e756ecc4aefbd4596a208ba09bb2d73c224d17566d78dbcd0965b8d7103d9904048c4fc4bcabad54dff869fe5b0c8ed60b8fcab8df2cab41809
|
7
|
+
data.tar.gz: fcd4bc724eb9e81565317d14589b05a3d030c3b3f28ab8cc098f45c3c6205b3e655c8592de6736064f2d3260a32ad99f977362b4c16cf81aa4564d516a49ae4f
|
data/lib/movier.rb
CHANGED
data/lib/movier/lmdb.rb
CHANGED
@@ -57,6 +57,7 @@ module Movier
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def find(params)
|
60
|
+
# TODO: add support for "find in a box" and "exclude boxes"
|
60
61
|
read_data; @params = params; @params[:verbose] = true if @params[:shuffle]
|
61
62
|
raise "Please, add some movie boxes, before searching in the local movie database" unless @movies.any?
|
62
63
|
|
@@ -154,15 +155,9 @@ module Movier
|
|
154
155
|
message = "Found no movie box in the local database.\n"
|
155
156
|
message += "Please, run `movier add` to add some movie boxes, before updating me!"
|
156
157
|
raise message if @boxes.empty?
|
157
|
-
@
|
158
|
-
end
|
159
|
-
|
160
|
-
def delete(dir = nil)
|
161
|
-
dir = File.expand_path dir
|
162
|
-
@movies.reject!{ |movie| movie[:box] == dir }
|
163
|
-
@boxes.reject!{ |box| box == dir }
|
158
|
+
@movies = []
|
164
159
|
write_data
|
165
|
-
|
160
|
+
@boxes.each { |box| add(box) }
|
166
161
|
end
|
167
162
|
|
168
163
|
# Add a given directory to the local movie database.
|
@@ -181,8 +176,9 @@ module Movier
|
|
181
176
|
count = 0
|
182
177
|
imdb.each do |file|
|
183
178
|
movie = Movier.read_yaml file
|
184
|
-
if in_database?(movie)
|
185
|
-
|
179
|
+
if in_database?(movie)
|
180
|
+
# TODO: add the path with a "dup" key
|
181
|
+
Movier.warn_with "#{movie[:imdb]["Title"]} - # #{movie[:imdb]["imdbRating"]} - already exists in database!"
|
186
182
|
elsif !in_database?(movie)
|
187
183
|
@movies.push sanitize(movie, dir, file)
|
188
184
|
count += 1
|
@@ -192,12 +188,8 @@ module Movier
|
|
192
188
|
@boxes.push dir unless @boxes.include? dir
|
193
189
|
write_data
|
194
190
|
|
195
|
-
Movier.passed_with "Added #{count} new movies in LMDB
|
196
|
-
|
197
|
-
end
|
198
|
-
|
199
|
-
def current_state
|
200
|
-
Movier.tip_now "LMDB now contains #{@movies.count} movies, and #{@boxes.count} boxes."
|
191
|
+
Movier.passed_with "Added #{"%4d" % count} new movies in LMDB from: #{dir}"
|
192
|
+
Movier.tip_now "LMDB now contains #{"%4d" % @movies.count} movies."
|
201
193
|
end
|
202
194
|
|
203
195
|
def sanitize(movie, dir, imdb_file)
|
data/lib/movier/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: movier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikhil Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
177
|
rubyforge_project:
|
178
|
-
rubygems_version: 2.0.
|
178
|
+
rubygems_version: 2.0.3
|
179
179
|
signing_key:
|
180
180
|
specification_version: 4
|
181
181
|
summary: Movier is a gem that allows you to quickly organize your movies
|