eivid 1.0.9 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/jobs/eivid/request_folder_id_job.rb +14 -0
- data/app/models/eivid/concerns/main_app/owner.rb +1 -1
- data/app/models/eivid/owner.rb +3 -3
- data/lib/eivid/engine.rb +14 -18
- data/lib/eivid/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9246a571186c117fe8a8cedba5908a275eaa74b0bea191fd69f557431a18201a
|
4
|
+
data.tar.gz: 860c7a305e0909d59b093cd33fb063542edf0a49632f7c1db83889681a6029a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff72ebf02f8a5f89bb2ffa3ac1e92f7001900588fbbf54fe3764dd2a680003c06776a2100f68952ae4f2515b2213a5b8bbdc423dc01b2f28e9f241cca3bf839c
|
7
|
+
data.tar.gz: a62b3655af2be692f16f71fb3bb029000cefff28575eb2f480f900037d11a41924a7dfab8d737a91714b1b345e5a29aa260c09a7a1aceabed1c9bcf6063493b3
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Eivid
|
2
|
+
class RequestFolderIdJob < ApplicationJob
|
3
|
+
|
4
|
+
def perform(eivid_owner_id)
|
5
|
+
|
6
|
+
owner = Owner.find(eivid_owner_id)
|
7
|
+
folder_id = RequestService.create_folder(namespace: Eivid.owner_model, id: owner.id)
|
8
|
+
|
9
|
+
owner.update!(folder_id: folder_id)
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
data/app/models/eivid/owner.rb
CHANGED
@@ -5,16 +5,16 @@ module Eivid
|
|
5
5
|
|
6
6
|
validates :external_id, presence: true, uniqueness: true
|
7
7
|
|
8
|
-
|
8
|
+
after_commit :get_folder_id, unless: :folder_id
|
9
9
|
|
10
|
-
belongs_to :"#{Eivid.owner_model}", foreign_key: "external_id"
|
10
|
+
belongs_to :"#{Eivid.owner_model}", foreign_key: "external_id", optional: true
|
11
11
|
|
12
12
|
def external_owner
|
13
13
|
send Eivid.owner_model
|
14
14
|
end
|
15
15
|
|
16
16
|
def get_folder_id
|
17
|
-
|
17
|
+
RequestFolderIdJob.perform_later(self.id)
|
18
18
|
end
|
19
19
|
|
20
20
|
end
|
data/lib/eivid/engine.rb
CHANGED
@@ -7,27 +7,23 @@ module Eivid
|
|
7
7
|
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
mattr_accessor :owner_model, :infer_external_owner_id, :notify_front_enabled, :notify_method_on_upload,
|
11
|
+
:notify_method_on_video_available, :notify_method_on_versions_available
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
# sets how to extract the owner_id in controller actions
|
19
|
-
self.infer_external_owner_id = "params['external_owner_id'].to_i"
|
20
|
-
|
21
|
-
# sets front end notifiers
|
22
|
-
self.notify_front_enabled = false
|
23
|
-
self.notify_method_on_upload = nil
|
24
|
-
self.notify_method_on_video_available = nil
|
25
|
-
self.notify_method_on_versions_available = nil
|
13
|
+
#sets video owner in the main app
|
14
|
+
self.owner_model = nil
|
15
|
+
|
16
|
+
# sets how to extract the owner_id in controller actions
|
17
|
+
self.infer_external_owner_id = "params['external_owner_id'].to_i"
|
26
18
|
|
27
|
-
|
28
|
-
|
29
|
-
|
19
|
+
# sets front end notifiers
|
20
|
+
self.notify_front_enabled = false
|
21
|
+
self.notify_method_on_upload = nil
|
22
|
+
self.notify_method_on_video_available = nil
|
23
|
+
self.notify_method_on_versions_available = nil
|
30
24
|
|
25
|
+
def self.set_mattr_accessors(&block)
|
26
|
+
yield self
|
31
27
|
end
|
32
28
|
|
33
29
|
end
|
data/lib/eivid/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eivid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jurriaan Schrofer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: httparty
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- app/jobs/eivid/get_vimeo_hd_url_job.rb
|
81
81
|
- app/jobs/eivid/get_vimeo_urls_job.rb
|
82
82
|
- app/jobs/eivid/get_vimeo_urls_mixin.rb
|
83
|
+
- app/jobs/eivid/request_folder_id_job.rb
|
83
84
|
- app/jobs/eivid/upload_vimeo_job.rb
|
84
85
|
- app/mailers/eivid/application_mailer.rb
|
85
86
|
- app/models/eivid/application_record.rb
|