openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #30945
[Merge] lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp
Azaziah has proposed merging lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~suutari-olli/openlp/fix-openlp-importer/+merge/314296
- For diff (trunk)
--
Your team OpenLP Core is requested to review the proposed merge of lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/importers/openlp.py'
--- openlp/plugins/songs/lib/importers/openlp.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/songs/lib/importers/openlp.py 2017-01-08 22:10:23 +0000
@@ -225,7 +225,13 @@
existing_book = self.manager.get_object_filtered(Book, Book.name == song.book.name)
if not existing_book:
existing_book = Book.populate(name=song.book.name, publisher=song.book.publisher)
- new_song.add_songbook_entry(existing_book, '')
+ # Get the song_number from "songs" table "song_number" field.
+ # If there's a number, add it to the song, otherwise it will be "".
+ existing_number = song.song_number
+ if existing_number:
+ new_song.add_songbook_entry(existing_book, existing_number)
+ else:
+ new_song.add_songbook_entry(existing_book, "")
# Find or create all the media files and add them to the new song object
if has_media_files and song.media_files:
for media_file in song.media_files:
Follow ups