From b1e61f77536881dc60ef461da996e37074cfbbec Mon Sep 17 00:00:00 2001 From: bkfox Date: Wed, 30 Aug 2017 18:36:10 +0200 Subject: [PATCH] playlist import: more case for comments --- aircox/management/commands/import_playlist.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aircox/management/commands/import_playlist.py b/aircox/management/commands/import_playlist.py index 3ca21fd..61f1e35 100755 --- a/aircox/management/commands/import_playlist.py +++ b/aircox/management/commands/import_playlist.py @@ -47,7 +47,10 @@ class Importer: logger.info('start reading csv ' + path) self.path = path self.data = list(csv.DictReader( - (row for row in file if not row.startswith('#')), + (row for row in file + if not (row.startswith('#') or row.startswith('\ufeff#')) + and row.strip() + ), fieldnames = settings.AIRCOX_IMPORT_PLAYLIST_CSV_COLS, delimiter = settings.AIRCOX_IMPORT_PLAYLIST_CSV_DELIMITER, quotechar = settings.AIRCOX_IMPORT_PLAYLIST_CSV_TEXT_QUOTE,