Changes to support setting default templates based on tags

pull/449/head
Christopher Usher 3 weeks ago
parent a56f7e7ecb
commit 167f8e623c

@ -155,7 +155,9 @@ CREATE TABLE playlists (
-- because we don't want invalid input to cause integrity errors. -- because we don't want invalid input to cause integrity errors.
-- It's totally safe for these to point to non-existent events, it just does nothing. -- It's totally safe for these to point to non-existent events, it just does nothing.
first_event_id TEXT, first_event_id TEXT,
last_event_id TEXT last_event_id TEXT,
-- name of the thumbnail template to be applied by default to this tag
default_template TEXT NOT NULL DEFAULT ''
); );
-- This table records time series data gleaned from the bus cam (right now, just the odometer). -- This table records time series data gleaned from the bus cam (right now, just the odometer).

@ -375,6 +375,7 @@ class PlaylistsSync(SheetSync):
"first_event_id", "first_event_id",
"last_event_id", "last_event_id",
"show_in_description", "show_in_description",
"default_template",
} }

@ -198,6 +198,7 @@ class SheetsPlaylistsMiddleware(SheetsMiddleware):
"name": 2, "name": 2,
"playlist_id": 3, "playlist_id": 3,
"show_in_description": 4, "show_in_description": 4,
"default_template": 5,
"first_event_id": 6, "first_event_id": 6,
"last_event_id": 7, "last_event_id": 7,
"id": 8, "id": 8,
@ -327,6 +328,7 @@ class SheetsEventsMiddleware(SheetsMiddleware):
if 'tags' in row_dict: if 'tags' in row_dict:
row_dict['tags'] = ( row_dict['tags'] = (
[ [
calculate_shift(row_dict['event_start'])
row_dict['category'], # category name row_dict['category'], # category name
worksheet, # sheet name worksheet, # sheet name
] + (['Poster Moment'] if row_dict['poster_moment'] else []) ] + (['Poster Moment'] if row_dict['poster_moment'] else [])

Loading…
Cancel
Save