sheetsync: correct parsing for updated playlists

pull/305/head
Mike Lang 2 years ago committed by Mike Lang
parent a298087137
commit 32c72d6eb7

@ -364,20 +364,16 @@ class SheetSync(object):
overwriting the entire playlists table""" overwriting the entire playlists table"""
playlists = [] playlists = []
for row in rows: for row in rows:
# TODO redo sheet parsing for new columns if len(row) != 5:
# Defaults for now:
name = ""
show_in_description = false
if len(row) != 3:
continue continue
tags, _, playlist_id = row tags, _, name, playlist_id, show_in_desctiption = row
tags = self.column_parsers['tags'](tags) tags = self.column_parsers['tags'](tags)
if not tags: if not tags:
continue continue
playlist_id = playlist_id.strip() playlist_id = playlist_id.strip()
if len(playlist_id) != 34 or not playlist_id.startswith('PL'): if len(playlist_id) != 34 or not playlist_id.startswith('PL'):
continue continue
show_in_description = show_in_description == "[✓]"
playlists.append((playlist_id, tags, name, show_in_description)) playlists.append((playlist_id, tags, name, show_in_description))
# We want to wipe and replace all the current entries in the table. # We want to wipe and replace all the current entries in the table.
# The easiest way to do this is a DELETE then an INSERT, all within a transaction. # The easiest way to do this is a DELETE then an INSERT, all within a transaction.

Loading…
Cancel
Save