phocoder-rails 0.0.38 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/phocoder_rails/acts_as_phocodable.rb +32 -1
- data/phocoder-rails.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -178,7 +178,7 @@ module ActsAsPhocodable
|
|
178
178
|
|
179
179
|
include ActiveSupport::Callbacks
|
180
180
|
|
181
|
-
define_callbacks :local_file_saved, :file_saved, :file_ready, :phocode_hdr, :phocode_composite, :phocode_tone_mapping
|
181
|
+
define_callbacks :local_file_saved, :file_saved, :file_ready, :phocode_hdr, :phocode_hdrhtml, :phocode_composite, :phocode_tone_mapping
|
182
182
|
|
183
183
|
#cattr_accessor :phocoder_options
|
184
184
|
#self.phocoder_options = options
|
@@ -552,6 +552,33 @@ module ActsAsPhocodable
|
|
552
552
|
end
|
553
553
|
|
554
554
|
|
555
|
+
def phocode_hdrhtml
|
556
|
+
#if self.thumbnails.count >= self.class.phocoder_thumbnails.size
|
557
|
+
# raise "This item already has thumbnails!"
|
558
|
+
# return
|
559
|
+
#end
|
560
|
+
|
561
|
+
# We do this because sometimes save will get called more than once
|
562
|
+
# during a single request
|
563
|
+
return if phocoding
|
564
|
+
phocoding = true
|
565
|
+
run_callbacks :phocode_hdrhtml do
|
566
|
+
Rails.logger.debug "trying to phocode for #{Phocoder.base_url} "
|
567
|
+
Rails.logger.debug "callback url = #{callback_url}"
|
568
|
+
response = Phocoder::Job.create(phocoder_hdrhtml_params)
|
569
|
+
Rails.logger.debug "the response from phocode_hdrhtml = #{response.body.to_json}"
|
570
|
+
job = self.encodable_jobs.new
|
571
|
+
job.phocoder_output_id = response.body["job"]["hdrhtml"]["id"]
|
572
|
+
job.phocoder_job_id = response.body["job"]["id"]
|
573
|
+
job.phocoder_status = "phocoding"
|
574
|
+
self.encodable_jobs << job
|
575
|
+
self.encodable_status = "phocoding"
|
576
|
+
self.save #false need to do save(false) here if we're calling phocode on after_save
|
577
|
+
end
|
578
|
+
|
579
|
+
end
|
580
|
+
|
581
|
+
|
555
582
|
def phocode_tone_mapping
|
556
583
|
#if self.thumbnails.count >= self.class.phocoder_thumbnails.size
|
557
584
|
# raise "This item already has thumbnails!"
|
@@ -681,6 +708,10 @@ module ActsAsPhocodable
|
|
681
708
|
{ }
|
682
709
|
end
|
683
710
|
|
711
|
+
def phocoder_hdrhtml_params
|
712
|
+
{ }
|
713
|
+
end
|
714
|
+
|
684
715
|
def phocoder_tone_mapping_params
|
685
716
|
{ }
|
686
717
|
end
|
data/phocoder-rails.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{phocoder-rails}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.39"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Jeremy Green}]
|
12
|
-
s.date = %q{2012-
|
12
|
+
s.date = %q{2012-02-15}
|
13
13
|
s.description = %q{Rails engine for easy integration with phocoder.com}
|
14
14
|
s.email = %q{jagthedrummer@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phocoder-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 81
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 39
|
10
|
+
version: 0.0.39
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jeremy Green
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-02-15 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rails
|