falcon 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/falcon/encoder.rb +21 -13
- data/lib/falcon/media.rb +1 -4
- data/lib/falcon/version.rb +1 -1
- metadata +3 -3
data/lib/falcon/encoder.rb
CHANGED
@@ -95,26 +95,34 @@ module Falcon
|
|
95
95
|
self.status == SUCCESS
|
96
96
|
end
|
97
97
|
|
98
|
+
def processing!
|
99
|
+
self.status = PROCESSING
|
100
|
+
save(:validate => false)
|
101
|
+
end
|
102
|
+
|
103
|
+
def fail!
|
104
|
+
self.status = FAILURE
|
105
|
+
save(:validate => false)
|
106
|
+
end
|
107
|
+
|
108
|
+
def success!
|
109
|
+
self.status = SUCCESS
|
110
|
+
self.encoded_at = Time.now
|
111
|
+
save(:validate => false)
|
112
|
+
end
|
113
|
+
|
98
114
|
protected
|
99
115
|
|
100
116
|
def process_encoding
|
101
117
|
begun_encoding = Time.now
|
102
118
|
|
103
|
-
|
104
|
-
self.save(:validate => false)
|
119
|
+
processing!
|
105
120
|
|
106
|
-
|
107
|
-
self.encode_source
|
108
|
-
self.generate_screenshots
|
109
|
-
|
110
|
-
self.status = SUCCESS
|
111
|
-
self.encoded_at = Time.now
|
121
|
+
if encode_source && generate_screenshots
|
112
122
|
self.encoding_time = (Time.now - begun_encoding).to_i
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
self.save(:validate => false)
|
117
|
-
raise
|
123
|
+
success!
|
124
|
+
else
|
125
|
+
fail!
|
118
126
|
end
|
119
127
|
end
|
120
128
|
|
data/lib/falcon/media.rb
CHANGED
@@ -148,10 +148,7 @@ module Falcon
|
|
148
148
|
|
149
149
|
# Clear generated files and created encodings
|
150
150
|
def flush_deletes
|
151
|
-
|
152
|
-
filepath = path(profile)
|
153
|
-
FileUtils.rm(filepath, :force => true) if filepath && File.exists?(filepath)
|
154
|
-
end
|
151
|
+
instance.falcon_encodings.clear
|
155
152
|
end
|
156
153
|
end
|
157
154
|
end
|
data/lib/falcon/version.rb
CHANGED
metadata
CHANGED