Skip to content

Commit

Permalink
fix: hasEnglishSubtitles
Browse files Browse the repository at this point in the history
  • Loading branch information
ckuijjer committed Jun 28, 2024
1 parent 8de953e commit 3befdf0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cloud/scrapers/filmhuisdenhaag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ const cleanTitle = (title: string) =>
.replace(/ -(.*?)$/, ''), // actually remove the last dash and everything after it (bit questionable)
)

const hasEnglishSubtitles = (item) => {
return (
item.subtitle === 'Engels' ||
item.subtitle === 'English' ||
item.characteristics.includes('EN subs')
)
}

const extractFromMainPage = async (): Promise<Screening[]> => {
const apiResponse: FilmhuisDenhaagAPIResponse = await got(
'https://filmhuisdenhaag.nl/api/program',
Expand All @@ -91,8 +99,7 @@ const extractFromMainPage = async (): Promise<Screening[]> => {
})

const screenings: Screening[] = programs
// .filter((item) => item.subtitle === 'Engels' || item.subtitle === 'English') // removed as it seems to always show "Nederlands" now
.filter((item) => item.subs === 'EN subs')
.filter(hasEnglishSubtitles)
.map((item) => {
const [year, month, day] = item.starts_at_date
.split('-')
Expand Down

0 comments on commit 3befdf0

Please sign in to comment.