Skip to content

Commit

Permalink
Merge pull request #223 from razeware/WEB-6559
Browse files Browse the repository at this point in the history
WEB-6559: Extract the vimeo_id from metadata, add to model, and push
  • Loading branch information
sammyd authored Oct 12, 2023
2 parents 8a236a7 + 89eb0fa commit fc7ff5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/lib/parser/video_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def initialize(video, metadata)
def apply!
check_captions_path
video.assign_attributes(simple_attributes)
# Need to extract the ID from the URL, if one has been provided
video.vimeo_id = metadata[:vimeo_id]&.to_s&.match(/(\d+)$/)&.values_at(1)&.first
video.authors += authors if authors.present?
end

Expand Down
4 changes: 2 additions & 2 deletions app/models/video.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Video
include Concerns::MarkdownRenderable

attr_accessor :title, :ordinal, :free, :description_md, :short_description, :authors_notes_md,
:authors, :script_file, :root_path, :captions_file, :ref
:authors, :script_file, :root_path, :captions_file, :ref, :vimeo_id

attr_markdown :description, source: :description_md, file: false
attr_markdown :authors_notes, source: :authors_notes_md, file: false
Expand Down Expand Up @@ -40,7 +40,7 @@ def segment_type
# Used for serialisation
def attributes
{ title: nil, ordinal: nil, free: false, description: nil, short_description: nil, authors_notes: nil,
authors: [], transcript: nil, ref: nil, episode_type:, segment_type: }.stringify_keys
authors: [], transcript: nil, ref: nil, vimeo_id: nil, episode_type:, segment_type: }.stringify_keys
end

# Used for linting
Expand Down

0 comments on commit fc7ff5f

Please sign in to comment.