Merge lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp

Proposed by Azaziah
Status: Superseded
Proposed branch: lp:~suutari-olli/openlp/fix-openlp-importer
Merge into: lp:openlp
Diff against target: 24 lines (+9/-2)
1 file modified
openlp/plugins/songs/lib/importers/openlp.py (+9/-2)
To merge this branch: bzr merge lp:~suutari-olli/openlp/fix-openlp-importer
Reviewer Review Type Date Requested Status
Tim Bentley Needs Fixing
Review via email: mp+314296@code.launchpad.net

This proposal supersedes a proposal from 2017-01-08.

This proposal has been superseded by a proposal from 2017-01-08.

Description of the change

- For diff (trunk)

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote :

Question and no tests Sorry!

review: Needs Fixing
Revision history for this message
Azaziah (suutari-olli) wrote :

I don't understand the question, and this branch is still a work in progress
- "proposals" are only for diff for now.

2717. By Azaziah

- Fixed bug #1632567

2718. By Azaziah

- This is broken, attempted to fix author types on import

Unmerged revisions

2718. By Azaziah

- This is broken, attempted to fix author types on import

2717. By Azaziah

- Fixed bug #1632567

2716. By Azaziah

- Better fix, now checks for songbook entry 1st.

2715. By Azaziah

- Fixed bug: 1652003

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/plugins/songs/lib/importers/openlp.py'
2--- openlp/plugins/songs/lib/importers/openlp.py 2016-12-31 11:01:36 +0000
3+++ openlp/plugins/songs/lib/importers/openlp.py 2017-01-08 23:00:41 +0000
4@@ -221,11 +221,18 @@
5 if not existing_book:
6 existing_book = Book.populate(name=entry.songbook.name, publisher=entry.songbook.publisher)
7 new_song.add_songbook_entry(existing_book, entry.entry)
8- elif song.book:
9+ elif hasattr(song, 'book') and song.book:
10 existing_book = self.manager.get_object_filtered(Book, Book.name == song.book.name)
11 if not existing_book:
12 existing_book = Book.populate(name=song.book.name, publisher=song.book.publisher)
13- new_song.add_songbook_entry(existing_book, '')
14+ # Get the song_number from "songs" table "song_number" field. (This is db structure from 2.2.1)
15+ # If there's a number, add it to the song, otherwise it will be "".
16+ existing_number = song.song_number
17+ if existing_number:
18+ new_song.add_songbook_entry(existing_book, existing_number)
19+ else:
20+ new_song.add_songbook_entry(existing_book, "")
21+
22 # Find or create all the media files and add them to the new song object
23 if has_media_files and song.media_files:
24 for media_file in song.media_files: