|
|
|
|
@ -3,6 +3,7 @@ const { pathOr, unionWith, prop, eqBy, maxBy } = require('ramda');
|
|
|
|
|
const url = require('url'); |
|
|
|
|
const path = require('path'); |
|
|
|
|
const fs = require('fs').promises; |
|
|
|
|
const filesystem = require('fs'); |
|
|
|
|
const gm = require('gm').subClass({ imageMagick: true }); |
|
|
|
|
|
|
|
|
|
const { graphql_endpoint } = require('./constants'); |
|
|
|
|
@ -13,6 +14,8 @@ const get_upcoming_events = pathOr(
|
|
|
|
|
'data.page.upcoming_events'.split('.'), |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
const get_past_events = pathOr(null, 'data.page.past_events'.split('.')); |
|
|
|
|
|
|
|
|
|
const merge_edges = unionWith(eqBy(prop('event_id'))); |
|
|
|
|
|
|
|
|
|
const load_event = async (page, event_id) => { |
|
|
|
|
@ -154,6 +157,12 @@ const register_upcoming_events_listener = (endpoint, page) => {
|
|
|
|
|
resolve(responses); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
const past_events = get_past_events(json); |
|
|
|
|
if (past_events !== null) { |
|
|
|
|
if (!past_events.page_info.has_next_page) { |
|
|
|
|
resolve(responses); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (err) { |
|
|
|
|
reject(err); |
|
|
|
|
} |
|
|
|
|
|