Compare commits

..

No commits in common. '06931db26baa6c5f19b56609f48ce930842014c8' and 'b68abb92e2bdd0e2da567be4d0c7655dd82b1c56' have entirely different histories.

@ -182,7 +182,7 @@ class SheetSync(object):
assert sheet_row
worksheet = sheet_row["sheet_name"]
# No row currently in DB, create it.
self.logger.info("Inserting new DB row {}: {}".format(sheet_row['id'], sheet_row))
self.logger.info("Inserting new DB row {}".format(sheet_row['id']))
# Insertion conflict just means that another sheet sync beat us to the insert.
# We can ignore it.
insert_cols = {'id'} | self.input_columns

@ -66,8 +66,8 @@ class StreamLogPlaylistsMiddleware(Middleware):
"tags": [] if tag["tag"] == "<all>" else [tag["tag"]],
"description": tag["description"],
"playlist_id": None,
"name": "",
"show_in_description": False,
"name": None,
"show_in_description": None,
"first_event_id": None, # TODO missing in StreamLog
"last_event_id": None, # TODO missing in StreamLog
}
@ -107,14 +107,13 @@ class StreamLogEventsMiddleware(Middleware):
'event_start': parse_utc_only,
'event_end': lambda v: parse_utc_only(v["time"]) if v["type"] == "Time" else None,
'category': lambda v: v["name"],
'state': lambda v: v.upper() if v else None,
'state': lambda v: None if v is None else v.upper(),
'error': lambda v: None if v == '' else v,
'tags': lambda v: [tag["tag"] for tag in v],
}
# Maps DB column names to an encode function to convert from internal format to streamlog.
# Omitted columns act as the identity function.
self.column_encode = {
'state': lambda v: v[0].upper() + v[1:].lower() if v else None, # Titlecase
'state': lambda v: v[0].upper() + v[1:].lower(), # Titlecase
'error': lambda v: '' if v == None else v,
}
# Maps DB column names to the url part you need to write to to set it.

Loading…
Cancel
Save