Merge lp:~raoul-snyman/openlp/bug-863845 into lp:openlp

Proposed by Raoul Snyman
Status: Merged
Approved by: Tim Bentley
Approved revision: no longer in the source branch.
Merged at revision: 1811
Proposed branch: lp:~raoul-snyman/openlp/bug-863845
Merge into: lp:openlp
Diff against target: 28 lines (+8/-3)
1 file modified
openlp/plugins/songs/lib/olpimport.py (+8/-3)
To merge this branch: bzr merge lp:~raoul-snyman/openlp/bug-863845
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Review via email: mp+84162@code.launchpad.net

Description of the change

Fix importing of newer songs databases.

To post a comment you must log in.
lp:~raoul-snyman/openlp/bug-863845 updated
1810. By rimach

Rewrite of the multimedia stuff.

Revision history for this message
Tim Bentley (trb143) :
review: Approve
lp:~raoul-snyman/openlp/bug-863845 updated
1811. By Raoul Snyman

Fix importing of newer songs databases.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/plugins/songs/lib/olpimport.py'
2--- openlp/plugins/songs/lib/olpimport.py 2011-09-05 12:51:16 +0000
3+++ openlp/plugins/songs/lib/olpimport.py 2011-12-01 19:24:25 +0000
4@@ -124,7 +124,7 @@
5 if has_media_files:
6 source_media_files_table = source_meta.tables[u'media_files']
7 source_media_files_songs_table = \
8- source_meta.tables[u'media_files_songs']
9+ source_meta.tables.get(u'media_files_songs')
10 try:
11 class_mapper(OldMediaFile)
12 except UnmappedClassError:
13@@ -137,8 +137,13 @@
14 secondary=source_songs_topics_table)
15 }
16 if has_media_files:
17- song_props['media_files'] = relation(OldMediaFile, backref='songs',
18- secondary=source_media_files_songs_table)
19+ if source_media_files_songs_table:
20+ song_props['media_files'] = relation(OldMediaFile,
21+ backref='songs',
22+ secondary=source_media_files_songs_table)
23+ else:
24+ song_props['media_files'] = relation(OldMediaFile,
25+ backref='songs')
26 try:
27 class_mapper(OldAuthor)
28 except UnmappedClassError: