forked from openlp/openlp
Fix importing of newer songs databases.
bzr-revno: 1811 Fixes: https://launchpad.net/bugs/863845
This commit is contained in:
commit
f8ea1349f4
@ -124,7 +124,7 @@ class OpenLPSongImport(SongImport):
|
|||||||
if has_media_files:
|
if has_media_files:
|
||||||
source_media_files_table = source_meta.tables[u'media_files']
|
source_media_files_table = source_meta.tables[u'media_files']
|
||||||
source_media_files_songs_table = \
|
source_media_files_songs_table = \
|
||||||
source_meta.tables[u'media_files_songs']
|
source_meta.tables.get(u'media_files_songs')
|
||||||
try:
|
try:
|
||||||
class_mapper(OldMediaFile)
|
class_mapper(OldMediaFile)
|
||||||
except UnmappedClassError:
|
except UnmappedClassError:
|
||||||
@ -137,8 +137,13 @@ class OpenLPSongImport(SongImport):
|
|||||||
secondary=source_songs_topics_table)
|
secondary=source_songs_topics_table)
|
||||||
}
|
}
|
||||||
if has_media_files:
|
if has_media_files:
|
||||||
song_props['media_files'] = relation(OldMediaFile, backref='songs',
|
if source_media_files_songs_table:
|
||||||
secondary=source_media_files_songs_table)
|
song_props['media_files'] = relation(OldMediaFile,
|
||||||
|
backref='songs',
|
||||||
|
secondary=source_media_files_songs_table)
|
||||||
|
else:
|
||||||
|
song_props['media_files'] = relation(OldMediaFile,
|
||||||
|
backref='songs')
|
||||||
try:
|
try:
|
||||||
class_mapper(OldAuthor)
|
class_mapper(OldAuthor)
|
||||||
except UnmappedClassError:
|
except UnmappedClassError:
|
||||||
|
Loading…
Reference in New Issue
Block a user