playlist import: more case for comments

This commit is contained in:
bkfox 2017-08-30 18:36:10 +02:00
parent d470ca39e6
commit b1e61f7753

View File

@ -47,7 +47,10 @@ class Importer:
logger.info('start reading csv ' + path) logger.info('start reading csv ' + path)
self.path = path self.path = path
self.data = list(csv.DictReader( 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, fieldnames = settings.AIRCOX_IMPORT_PLAYLIST_CSV_COLS,
delimiter = settings.AIRCOX_IMPORT_PLAYLIST_CSV_DELIMITER, delimiter = settings.AIRCOX_IMPORT_PLAYLIST_CSV_DELIMITER,
quotechar = settings.AIRCOX_IMPORT_PLAYLIST_CSV_TEXT_QUOTE, quotechar = settings.AIRCOX_IMPORT_PLAYLIST_CSV_TEXT_QUOTE,