forked from openlp/openlp
Fix MediaShout import issue when an expected table is missing. Fixes bug 1590657.
Fixes: https://launchpad.net/bugs/1590657
This commit is contained in:
parent
8057d13db6
commit
8f04f587ec
@ -59,6 +59,7 @@ class MediaShoutImport(SongImport):
|
|||||||
songs = cursor.fetchall()
|
songs = cursor.fetchall()
|
||||||
self.import_wizard.progress_bar.setMaximum(len(songs))
|
self.import_wizard.progress_bar.setMaximum(len(songs))
|
||||||
for song in songs:
|
for song in songs:
|
||||||
|
topics = []
|
||||||
if self.stop_import_flag:
|
if self.stop_import_flag:
|
||||||
break
|
break
|
||||||
cursor.execute('SELECT Type, Number, Text FROM Verses WHERE Record = %s ORDER BY Type, Number'
|
cursor.execute('SELECT Type, Number, Text FROM Verses WHERE Record = %s ORDER BY Type, Number'
|
||||||
@ -66,9 +67,10 @@ class MediaShoutImport(SongImport):
|
|||||||
verses = cursor.fetchall()
|
verses = cursor.fetchall()
|
||||||
cursor.execute('SELECT Type, Number, POrder FROM PlayOrder WHERE Record = %s ORDER BY POrder' % song.Record)
|
cursor.execute('SELECT Type, Number, POrder FROM PlayOrder WHERE Record = %s ORDER BY POrder' % song.Record)
|
||||||
verse_order = cursor.fetchall()
|
verse_order = cursor.fetchall()
|
||||||
cursor.execute('SELECT Name FROM Themes INNER JOIN SongThemes ON SongThemes.ThemeId = Themes.ThemeId '
|
if cursor.tables(table='TableName', tableType='TABLE').fetchone():
|
||||||
'WHERE SongThemes.Record = %s' % song.Record)
|
cursor.execute('SELECT Name FROM Themes INNER JOIN SongThemes ON SongThemes.ThemeId = Themes.ThemeId '
|
||||||
topics = cursor.fetchall()
|
'WHERE SongThemes.Record = %s' % song.Record)
|
||||||
|
topics = cursor.fetchall()
|
||||||
cursor.execute('SELECT Name FROM Groups INNER JOIN SongGroups ON SongGroups.GroupId = Groups.GroupId '
|
cursor.execute('SELECT Name FROM Groups INNER JOIN SongGroups ON SongGroups.GroupId = Groups.GroupId '
|
||||||
'WHERE SongGroups.Record = %s' % song.Record)
|
'WHERE SongGroups.Record = %s' % song.Record)
|
||||||
topics += cursor.fetchall()
|
topics += cursor.fetchall()
|
||||||
|
Loading…
Reference in New Issue
Block a user