Skip to content

Commit

Permalink
Merge pull request #8 from Panopto/stevielb/m/document-id-becomes-url…
Browse files Browse the repository at this point in the history
…-bad-hack

Fix Playlist URLs in coveo connector
  • Loading branch information
Stephen Lewis Bianamara authored Sep 20, 2021
2 parents cc4fd24 + 4ed8f79 commit 8fc5597
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/panoptoindexconnector/implementations/coveo_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def push_content_data(target_content, config):
field_mapping = config.field_mapping

url = '{coveourl}/push/v1/organizations/{org}/sources/{source}/documents?documentId=%s' % (
_get_document_id(config.panopto_site_address, target_content[field_mapping['Id']]))
target_content[field_mapping['Url']])
_ = _send_coveo_request(config, url, 'put', json=target_content)


Expand Down Expand Up @@ -171,7 +171,7 @@ def delete_from_target(video_id, config):
"""

url = '{coveourl}/push/v1/organizations/{org}/sources/{source}/documents?documentId=' + \
_get_document_id(config.panopto_site_address, video_id)
target_content[field_mapping['Url']]
_ = _send_coveo_request(config, url, 'delete')


Expand Down Expand Up @@ -254,14 +254,6 @@ def should_map_security(key):
return key not in SECURITY_IDS_MAPPED_TO_PROVIDER


def _get_document_id(panopto_site_address, vid):
"""
Coveo document id must be formatted as a uri
"""
return '{site}/Panopto/Pages/Viewer.aspx?id={id}'.format(
site=panopto_site_address, id=vid)


def _get_default_headers(api_key):
"""
Gets the common headers
Expand Down

0 comments on commit 8fc5597

Please sign in to comment.