Initial work for import from panopto
This commit is contained in:
parent
34c5f771ad
commit
0e0c6694ac
1
Gemfile
1
Gemfile
@ -73,3 +73,4 @@ end
|
|||||||
|
|
||||||
gem "tailwindcss-rails", "~> 2.0"
|
gem "tailwindcss-rails", "~> 2.0"
|
||||||
gem "font-awesome-sass"
|
gem "font-awesome-sass"
|
||||||
|
gem "httparty"
|
||||||
|
|||||||
@ -93,6 +93,9 @@ GEM
|
|||||||
sassc (~> 2.0)
|
sassc (~> 2.0)
|
||||||
globalid (1.2.1)
|
globalid (1.2.1)
|
||||||
activesupport (>= 6.1)
|
activesupport (>= 6.1)
|
||||||
|
httparty (0.21.0)
|
||||||
|
mini_mime (>= 1.0.0)
|
||||||
|
multi_xml (>= 0.5.2)
|
||||||
i18n (1.14.1)
|
i18n (1.14.1)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
importmap-rails (1.2.1)
|
importmap-rails (1.2.1)
|
||||||
@ -119,6 +122,7 @@ GEM
|
|||||||
mini_mime (1.1.5)
|
mini_mime (1.1.5)
|
||||||
minitest (5.20.0)
|
minitest (5.20.0)
|
||||||
msgpack (1.7.2)
|
msgpack (1.7.2)
|
||||||
|
multi_xml (0.6.0)
|
||||||
net-imap (0.3.7)
|
net-imap (0.3.7)
|
||||||
date
|
date
|
||||||
net-protocol
|
net-protocol
|
||||||
@ -229,6 +233,7 @@ DEPENDENCIES
|
|||||||
capybara
|
capybara
|
||||||
debug
|
debug
|
||||||
font-awesome-sass
|
font-awesome-sass
|
||||||
|
httparty
|
||||||
importmap-rails
|
importmap-rails
|
||||||
jbuilder
|
jbuilder
|
||||||
pg (~> 1.1)
|
pg (~> 1.1)
|
||||||
|
|||||||
8
app/lib/Panopto.rb
Normal file
8
app/lib/Panopto.rb
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
module Panopto
|
||||||
|
# @param [String] folder_id
|
||||||
|
def self.list_folder(folder_id)
|
||||||
|
HTTParty.get("https://lectures.joshuacoles.me/list", query: {
|
||||||
|
folderId: folder_id
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -18,6 +18,8 @@ class Lecture < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def recording_url
|
def recording_url
|
||||||
"https://google.com"
|
return nil if recording_id.nil?
|
||||||
|
|
||||||
|
"https://uniofbath.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=#{recording_id}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
class MakeLectureRecordingIdUnique < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
add_index :lectures, :recording_id, unique: true
|
||||||
|
end
|
||||||
|
end
|
||||||
3
db/schema.rb
generated
3
db/schema.rb
generated
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.0].define(version: 2023_09_29_171856) do
|
ActiveRecord::Schema[7.0].define(version: 2023_09_29_181725) do
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
||||||
@ -32,6 +32,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_09_29_171856) do
|
|||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.bigint "course_id"
|
t.bigint "course_id"
|
||||||
t.index ["course_id"], name: "index_lectures_on_course_id"
|
t.index ["course_id"], name: "index_lectures_on_course_id"
|
||||||
|
t.index ["recording_id"], name: "index_lectures_on_recording_id", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user