Skip to content

Commit

Permalink
Merge pull request #907 from WGBH-MLA/new_annotation
Browse files Browse the repository at this point in the history
Update annotation_types.yml
  • Loading branch information
ekemeyer committed Aug 28, 2024
2 parents a435904 + 6a06f88 commit 2597935
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/indexers/asset_resource_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def to_solr
AnnotationTypesService.new.select_all_options.each do |type|
# Use the ID defined in the AnnotationType service
type_id = type[1]
index_document["#{type_id.underscore}_ssim"] = resource.try(type_id.to_sym) unless resource.try(type_id.to_sym).empty?
index_document["#{type_id.underscore}_ssim"] = resource.try(type_id.to_sym) unless resource.try(type_id.to_sym).blank?
end

#Indexing for search by batch_id
Expand Down
6 changes: 5 additions & 1 deletion app/models/asset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,11 @@ def canonical_meta_tag
def proxy_start_time
proxy_start_time ||= find_annotation_attribute("proxy_start_time")
end


def ams1_legacy_metadata
ams1_legacy_metadata ||= find_annotation_attribute("ams1_legacy_metadata")
end

def find_annotation_attribute(attribute)
if admin_data.annotations.select { |a| a.annotation_type == attribute }.present?
return admin_data.annotations.select { |a| a.annotation_type == attribute }.map(&:value)
Expand Down
6 changes: 5 additions & 1 deletion app/models/asset_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ def canonical_meta_tag
def proxy_start_time
proxy_start_time ||= find_annotation_attribute("proxy_start_time")
end


def ams1_legacy_metadata
ams1_legacy_metadata ||= find_annotation_attribute("ams1_legacy_metadata")
end

def find_annotation_attribute(attribute)
if admin_data.annotations.select { |a| a.annotation_type == attribute }.present?
return admin_data.annotations.select { |a| a.annotation_type == attribute }.map(&:value)
Expand Down
6 changes: 5 additions & 1 deletion app/models/solr_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,11 @@ def md5
# this nonsensical ':symbol' option indicates that I am selecting the _ssim suffix from down in solrizer - default was _tesim, which was wrong for this field
self[solr_name('md5', :symbol)]
end


def ams1_legacy_metadata
self[solr_name('ams1_legacy_metadata', :symbol)]
end

def proxy_start_time
self[solr_name('proxy_start_time', :symbol)]
end
Expand Down
2 changes: 2 additions & 0 deletions config/authorities/annotation_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ terms:
term: Transcript Source
- id: proxy_start_time
term: Proxy Start Time
- id: ams1_legacy_metadata
term: AMS1 Legacy Data

0 comments on commit 2597935

Please sign in to comment.