Skip to content

Commit

Permalink
remove station name from subjects
Browse files Browse the repository at this point in the history
CPCN-604
  • Loading branch information
petrjasek committed Feb 6, 2024
1 parent 5172143 commit 6498ad8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/cp/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def handle_transcripts(item):
media_type["name"] = get_media_type_name(media_type["code"], item["language"])

if media_source:
item["source"] = media_source["name"]
item["source"] = media_source.get("name") or media_source.get("code")
item["subject"] = [s for s in item["subject"] if s.get("scheme") != media_source_scheme]

if media_type and media_type["code"] in ("tvstation", "radionstation"):
# it might be already populated based on previous segment
Expand Down
1 change: 1 addition & 0 deletions server/tests/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,5 @@ def test_handle_transcripts(app):

transcript_item["language"] = "fr-CA"
signals.on_publish_item(None, transcript_item)
assert 1 == len(transcript_item["subject"])
assert "Station de télé" == transcript_item["subject"][0]["name"]

0 comments on commit 6498ad8

Please sign in to comment.