Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cinemas/genesiscinema.co.uk/transform.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
const { getDay } = require("date-fns");
const attributes = require("./attributes");
const admitOneTransform = require("../../common/admit-one.co.uk/transform");
const { isNotSportShowing } = require("../../common/is-sport-showing");

const TUESDAY = 2;
const THURSDAY = 4;

async function transform(data, sourcedEvents) {
const movies = await admitOneTransform(attributes, data, sourcedEvents);
const events = await admitOneTransform(attributes, data, sourcedEvents);
const movies = events.filter(isNotSportShowing);

// "Our hard of hearing screenings are on Tuesdays and Thursdays."
// https://www.genesiscinema.co.uk/whatson/subtitled
Expand Down
4 changes: 3 additions & 1 deletion cinemas/olympiccinema.com/transform.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const attributes = require("./attributes");
const olympicStudiosTransform = require("../../common/olympicstudios.com/transform");
const { isNotSportShowing } = require("../../common/is-sport-showing");

async function transform(data, sourcedEvents) {
return olympicStudiosTransform(attributes, data, sourcedEvents);
const movies = await olympicStudiosTransform(attributes, data, sourcedEvents);
return movies.filter(isNotSportShowing);
}

module.exports = transform;
22 changes: 22 additions & 0 deletions common/is-sport-showing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const { basicNormalize } = require("./utils");

const sportShowings = [
/\s+Cup Screening$/i,
/\s+League Screening$/i,
/Union Jack Classic/i,
/Super Bowl/i,
/Six Nations/i,
/AFCON\s+/i,
/GRAND PRIX:/i,
/^\w+\s+FANPARK:/i,
];

const isSportShowing = ({ title }) =>
sportShowings.some((pattern) => basicNormalize(title).match(pattern));

const isNotSportShowing = (event) => !isSportShowing(event);

module.exports = {
isSportShowing,
isNotSportShowing,
};
3 changes: 3 additions & 0 deletions common/known-removable-phrases.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const knownRemovablePhrases = [
"and Johannas Traum",
": 4K World Premiere with Immersive Reception",
"(Live Immersive Virtual Experiment) Immersive Screening",
"30 Anniversary",
": 41st Anniversary",
"–40TH ANNIVERSARY",
": A Kabuki Salon",
Expand Down Expand Up @@ -329,6 +330,7 @@ const knownRemovablePhrases = [
"1956:",
"A24:",
"A FESTIVE FEAST",
"a film by Akinola Davies Jr.",
"a film by David Kew",
"a Screening and Talk of",
"Academy Awards Best Picture 2025:",
Expand Down Expand Up @@ -377,6 +379,7 @@ const knownRemovablePhrases = [
"Bar Trash:",
"BAR TRASH –",
"Barbican Library Rhyme Time",
"Baz Luhrmann Season",
"Best Of X-Men:",
"Best of 2025:",
"Belgrade Noir:",
Expand Down
17 changes: 2 additions & 15 deletions common/source-only/transform.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
const { basicNormalize } = require("../../common/utils");

const sportShowings = [
/\s+Cup Screening$/i,
/\s+League Screening$/i,
/Union Jack Classic/i,
/Super Bowl/i,
/Six Nations/i,
/AFCON\s+/i,
/GRAND PRIX:/i,
/^\w+\s+FANPARK:/i,
];
const { isNotSportShowing } = require("../../common/is-sport-showing");
const { basicNormalize } = require("../utils");

const nonFilmEvents = [/Community Pilates/i];

const isNotSportShowing = ({ title }) =>
!sportShowings.some((sports) => basicNormalize(title).match(sports));

const isNotNonFilmEvent = ({ title }) =>
!nonFilmEvents.some((nonFilm) => basicNormalize(title).match(nonFilm));

Expand Down
128 changes: 92 additions & 36 deletions common/tests/test-titles.json
Original file line number Diff line number Diff line change
Expand Up @@ -46891,38 +46891,6 @@
"input": "Oldboy",
"output": "oldboy"
},
{
"input": "ENGLAND V IRELAND: SIX NATIONS 2026",
"output": "england v ireland six nations"
},
{
"input": "ENGLAND V WALES: SIX NATIONS 2026",
"output": "england v wales six nations"
},
{
"input": "FRANCE V ITALY: SIX NATIONS 2026",
"output": "france v italy six nations"
},
{
"input": "IRELAND V ITALY: SIX NATIONS 2026",
"output": "ireland v italy six nations"
},
{
"input": "ITALY V SCOTLAND: SIX NATIONS 2026",
"output": "italy v scotland six nations"
},
{
"input": "SCOTLAND V ENGLAND: SIX NATIONS 2026",
"output": "scotland v england six nations"
},
{
"input": "WALES V FRANCE: SIX NATIONS 2026",
"output": "wales v france six nations"
},
{
"input": "WALES V SCOTLAND: SIX NATIONS 2026",
"output": "wales v scotland six nations"
},
{
"input": "The Live Ghost Tent – Quarterly Meeting March 2026",
"output": "live ghost tent quarterly meeting march"
Expand Down Expand Up @@ -53435,10 +53403,6 @@
"input": "Family Film Club: Spider-Man Into The Spider-Verse",
"output": "spiderman into the spiderverse"
},
{
"input": "Six Nations",
"output": "six nations"
},
{
"input": "Art Workshop + Drinks Social + Mystery Film",
"output": "mystery movie"
Expand Down Expand Up @@ -55770,5 +55734,97 @@
{
"input": "Documentary Film: 'Sage in Seclusion'",
"output": "sage in seclusion"
},
{
"input": "CARERS & BABIES: THE BRIDE!",
"output": "the bride"
},
{
"input": "PEAKY BLINDERS THE IMMORTAL MAN",
"output": "peaky blinders the immortal man"
},
{
"input": "HXR FEST: Day + Night Gallery Takeover",
"output": "hxr fest day"
},
{
"input": "The Voice of Hind Rajab + Q&A with director Kaouther Ben Hania and producer Nadim Cheikrouha",
"output": "voice of hind rajab"
},
{
"input": "Baz Luhrmann Season Romeo + Juliet 30 Anniversary",
"output": "romeo+juliet"
},
{
"input": "Baz Luhrmann Season The Great Gatsby (2013)",
"output": "great gatsby (2013)"
},
{
"input": "Elvis",
"output": "elvis"
},
{
"input": "Baz Luhrmann Season Moulin Rouge 25th Anniversary",
"output": "moulin rouge"
},
{
"input": "Zenith Collective",
"output": "zenith collective"
},
{
"input": "WePresent x Minute Shorts present: CKTRL “Spirit”, a film by Akinola Davies Jr.",
"output": "cktrl spirit"
},
{
"input": "BAFTAs",
"output": "baftas"
},
{
"input": "SCREENWRITING 101: AN INTRODUCTION TO WRITING FOR FILM & TV",
"output": "screenwriting 101 an introduction to writing for film tv"
},
{
"input": "Funny Girl - The Musical (2018)",
"output": "funny girl the musical (2018)"
},
{
"input": "ALL YOU NEED IS KILL (Dub)",
"output": "all you need is kill"
},
{
"input": "ALL YOU NEED IS KILL (Sub)",
"output": "all you need is kill"
},
{
"input": "Musik",
"output": "musik"
},
{
"input": "It Was Just an Accident + Recorded Intro from Jafar Panahi and Live Panel Discussion",
"output": "it was just an accident"
},
{
"input": "La Bohème + Robin Norton-Hale & Alice Farnham Q&A",
"output": "la boheme"
},
{
"input": "Drink & Dine: DANCE CRAZE - DANCE-ALONG + 2TONE AFTER PARTY",
"output": "dance craze"
},
{
"input": "Nish Kumar: Nish, Don’t Kill My Vibe + Q&A",
"output": "nish kumar nish dont kill my vibe"
},
{
"input": "Tar",
"output": "tar"
},
{
"input": "SIRÂT",
"output": "sirat"
},
{
"input": "Tender Mercies",
"output": "tender mercies"
}
]