From 2f2476964fbe8cde9a0c850abb8e3732cfabf574 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Thu, 13 Oct 2022 08:24:39 +1100 Subject: [PATCH] sheetsync: correct parsing for updated playlists --- sheetsync/sheetsync/main.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sheetsync/sheetsync/main.py b/sheetsync/sheetsync/main.py index 868f943..1e66813 100644 --- a/sheetsync/sheetsync/main.py +++ b/sheetsync/sheetsync/main.py @@ -364,20 +364,16 @@ class SheetSync(object): overwriting the entire playlists table""" playlists = [] for row in rows: - # TODO redo sheet parsing for new columns - # Defaults for now: - name = "" - show_in_description = false - - if len(row) != 3: + if len(row) != 5: continue - tags, _, playlist_id = row + tags, _, name, playlist_id, show_in_desctiption = row tags = self.column_parsers['tags'](tags) if not tags: continue playlist_id = playlist_id.strip() if len(playlist_id) != 34 or not playlist_id.startswith('PL'): continue + show_in_description = 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. # The easiest way to do this is a DELETE then an INSERT, all within a transaction.