Skip to content

Commit 436d1d7

Browse files
committed
Fix film formats test
[skip ci]
1 parent 31c5069 commit 436d1d7

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎_content/av/buddhism-and-environmental-protection_sheng-yen.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors:
55
external_url: "https://www.youtube.com/watch?v=-sULY8kX6Z8"
66
drive_links:
77
- "https://drive.google.com/file/d/18G2uylsfPRRVY2E1v4jqUsEBlp7CdzKI/view?usp=share_link"
8+
formats: [mp4]
89
course: nature
910
status: featured
1011
tags:

‎_content/av/meaning-of-eating-vegetarian-diet_sheng-yen.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors:
55
external_url: "https://www.youtube.com/watch?v=0mzZ6xAtarU"
66
drive_links:
77
- "https://drive.google.com/file/d/1GxvWWsDNReBPq1zAKwzcsc0h2KkESRmj/view?usp=drive_link"
8+
formats: [mp4]
89
course: animals
910
tags:
1011
- vegetarianism

‎_tests/content.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ A series of tests checking the integrity of the _content data
2121
| Unlinked Authors | {% assign authors = site.authors | map: "title" %}{% assign dupes = '' | split: '' %}{% for cont in site.content %}{% for auth in cont.authors %}{% if authors contains auth %}{% assign dupes = dupes | push: cont %}{% break %}{% endif %}{% endfor %}{% endfor %}{% if dupes.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | Found {{ dupes.size }} works with unlinked authors{% if dupes.size > 0 %}: {{ dupes | map: "url" | array_to_sentence_string }}{% endif %}
2222
| Dangling Authors | {% assign authors = site.authors | map: "slug" %}{% for auth in found %}{% assign authors = authors | where_exp: "a", "a != auth" %}{% endfor %}{% assign unfound = '' | split: '' %}{% for auth in authors %}{% assign c = site.content | where: "translator", auth | size %}{% if c > 0 %}{% continue %}{% endif %}{% assign c = site.content | where: "editor", auth | size %}{% if c > 0 %}{% continue %}{% endif %}{% assign c = site.content | where: "reader", auth | size %}{% if c == 0 %}{% assign unfound = unfound | push: auth %}{% endif %}{% endfor %}{% if unfound.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | There are {{ unfound.size }} authors with no works attributed to them{% if unfound.size == 0 %}.{% else %}: {{ unfound | array_to_sentence_string }}.{% endif %}
2323
| Content unexpectedly missing links | {% assign failures = site.content | where_exp: "c", "c.external_url == nil" | where_exp: "c", "c.drive_links == nil" | where_exp: "c", "c.source_url == nil" | where_exp: "c", "c.file_links == nil" | where_exp: "c", "c.category != 'monographs'" | where_exp: "c", "c.status != 'rejected'" | where_exp: "c", "c.slug != 'historical-dictionary-of-chan_wang-youru'" | where_exp: "c", "c.subcat != 'film'" %}{% if failures.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | There are {{ failures.size }} missing links{% if failures.size >0 %}: {{ failures | map: "slug" | array_to_sentence_string }}{% endif %}.
24-
| Films have video files | {% assign failures = site.content | where: "subcat", "film" | where_exp: "c", "c.drive_links[0]" | where: "formats[0]", "mp3" %}{% if failures.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | There are {{ failures.size }} films with mp3s{% if failures.size > 0 %}: {{ failures | map: "slug" | array_to_sentence_string }}{% endif %}.
24+
| Films have video files | {% assign failures = site.content | where: "subcat", "film" | where_exp: "c", "c.drive_links[0]" | where_exp: "c", "c.formats[0] == 'mp3'" %}{% if failures.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | There are {{ failures.size }} films with mp3s{% if failures.size > 0 %}: {{ failures | map: "slug" | array_to_sentence_string }}{% endif %}.
2525
| https error | {% assign ec = site.content | where_exp: "c", "c.external_url contains 'http://'" %}{% assign ed = "" | split: "" %}{% for c in ec %}{% unless c.external_url contains "https://" %}{% assign ed = ed | push: c %}{% endunless %}{% endfor %}{% assign failures = ed | where_exp: "c", "c.external_url contains '.pdf'" %}{% assign ec = ed | where_exp: "c", "c.external_url contains 'download'" %}{% assign failures = failures | concat: ec %}{% if failures.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | There are {{ failures.size }} links that need to be https{% if failures.size >0 %}: {{ failures | map: "slug" | array_to_sentence_string }}{% endif %}.
2626
| Content missing year | {% assign failures = site.content | where_exp: "c", "c.year == nil" %}{% if failures.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | There are {{ failures.size }} missing years{% if failures.size >0 %}: {{ failures | map: "slug" | array_to_sentence_string }}{% endif %}.
2727
| Invalid months | {% assign failures = "" | split: "" %}{% for cont in site.content %}{% if cont.month %}{% unless site.data.bibtex.months contains cont.month %}{% assign failures = failures | push: cont.path %}{% endunless %}{% endif %}{% endfor %}{% if failures.size == 0 %}Pass ✅{% else %}FAIL ❌{% endif %} | {{ failures.size }} bad months found{% if failures.size >0 %}: {{ failures | array_to_sentence_string }}{% endif %}

0 commit comments

Comments
 (0)