eivid 1.0.7 → 1.0.11
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/concerns/main_app/video_concerns.rb +2 -0
- data/app/models/eivid/concerns/request_service/manage_folder.rb +6 -1
- data/app/models/eivid/owner.rb +3 -3
- data/lib/eivid/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c2573ee732c9660e3c9b52490c88794016a64f6ccd7a8c6597bc268b43a80ce
|
4
|
+
data.tar.gz: 0f64fccb5e8bfff65937a883fc6c1a35540744379d3dcad007a42e450759dc1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc28ea6273a2bdbe73813ef3010cf38f21923374c30e07aceeb41a0ccb0e23e6f322e28aff970ceea8163ffaa8ce83d84d7b99ba87932d5a509763ad8af580d4
|
7
|
+
data.tar.gz: d352dc738178f1cb2f154d2f95fcf0b46c3dce8eff280f6bca9721ff0e58c68f5725e5ff21161d64251ebad8495f2f34db53e3757a3f2cbd7a462fbdab7a8ceb
|
@@ -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
|
@@ -12,5 +12,7 @@ module Eivid::Concerns::MainApp::VideoConcerns
|
|
12
12
|
scope :has_processed_video, -> { joins(:videos).where('eivid_videos.uploaded': true).distinct }
|
13
13
|
scope :has_unprocessed_video, -> { joins(:videos).where('eivid_videos.uploaded' => false).distinct }
|
14
14
|
|
15
|
+
scope :has_video_from_user, -> (user_id) { joins(:videos).where('eivid_videos.user_id = ?', user_id) }
|
16
|
+
|
15
17
|
end
|
16
18
|
end
|
@@ -6,7 +6,7 @@ module Eivid::Concerns::RequestService::ManageFolder
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def create_folder(namespace:, id:)
|
9
|
-
body = { "name" => "#{
|
9
|
+
body = { "name" => "#{rails_environment}_#{namespace}_#{id}" }
|
10
10
|
|
11
11
|
@response = HTTParty.post Eivid::RequestService::FOLDER_URL, body: body.to_json, headers: default_headers
|
12
12
|
get_folder_id
|
@@ -20,6 +20,11 @@ module Eivid::Concerns::RequestService::ManageFolder
|
|
20
20
|
HTTParty.put endpoint, headers: default_headers
|
21
21
|
end
|
22
22
|
|
23
|
+
def rails_environment
|
24
|
+
return "test" if Figaro.env.IS_TEST_SERVER
|
25
|
+
Rails.env
|
26
|
+
end
|
27
|
+
|
23
28
|
private
|
24
29
|
|
25
30
|
def get_folder_id
|
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/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eivid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
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-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -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
|