Skip to content

Commit 723479e

Browse files
committed
Merge pull request #16 from vise890/remove-full-transcripts-in-frontend
[RFC] Remove full transcripts in frontend
2 parents e0f0a98 + f74f59c commit 723479e

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

src/clj/cloujera/models/video.clj

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
(ns cloujera.models.video
22
(:require [schema.core :as s]))
33

4-
(def fake-video
5-
{:id "29"
6-
:title "Lecture 3 - Chapter 2: The industrial revolution starts in England"
7-
:transcript "The world we've seen is divided...(no timestamps!!)"
8-
:video-url "http://d396qusza40orc.cloudfront.net/susdev/recoded_videos%2Fsusdev_3_01.da6ff370809111e3af279b48f4519db4.webm"
9-
:_link "https://class.coursera.org/susdev-002/lecture/29"
10-
:course {:id "susdev-002"
11-
:title "The Age of Sustainable Development"
12-
:_link "https://class.coursera.org/susdev-002"}})
13-
14-
154
(def Course
165
"The schema for a Coursera Course (embedded in a video)"
176
{:id s/Str
@@ -25,7 +14,7 @@
2514
"The schema for a Coursera Video"
2615
{:id s/Str
2716
:title s/Str
28-
:transcript s/Str
17+
(s/optional-key :transcript) s/Str
2918
(s/optional-key :highlighted-transcript) s/Str
3019
:video-url s/Str
3120
:_link s/Str

src/clj/cloujera/search/core.clj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@
2424

2525
(defn- extract-video-result [elastic-video]
2626
(let [video (:_source elastic-video)
27-
elastic-highlight (get-in elastic-video [:highlight :transcript])]
28-
(assoc video
29-
:highlighted-transcript
30-
(elastic-highlight->highlighted-transcript elastic-highlight))))
27+
elastic-highlight (get-in elastic-video [:highlight :transcript])
28+
hl-transcript (elastic-highlight->highlighted-transcript elastic-highlight)
29+
video+hl-transcript (assoc video
30+
:highlighted-transcript
31+
hl-transcript)]
32+
(dissoc video :transcript)))
3133

3234
(defn- extract-results [videos]
3335
(let [found-videos (get-in videos [:hits :hits])]

0 commit comments

Comments
 (0)