[Openlp-core] [Merge] lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp

2017-01-08 Thread Azaziah
Azaziah has proposed merging lp:~suutari-olli/openlp/fix-openlp-importer into 
lp:openlp.

Requested reviews:
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~suutari-olli/openlp/fix-openlp-importer/+merge/314297

- For diff (trunk)
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/songs/lib/importers/openlp.py'
--- openlp/plugins/songs/lib/importers/openlp.py	2016-12-31 11:01:36 +
+++ openlp/plugins/songs/lib/importers/openlp.py	2017-01-08 23:01:14 +
@@ -221,11 +221,18 @@
 if not existing_book:
 existing_book = Book.populate(name=entry.songbook.name, publisher=entry.songbook.publisher)
 new_song.add_songbook_entry(existing_book, entry.entry)
-elif song.book:
+elif hasattr(song, 'book') and song.book:
 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. (This is db structure from 2.2.1)
+# 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:

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp

2017-01-08 Thread Azaziah
The proposal to merge lp:~suutari-olli/openlp/fix-openlp-importer into 
lp:openlp has been updated.

Status: Needs review => Work in progress

For more details, see:
https://code.launchpad.net/~suutari-olli/openlp/fix-openlp-importer/+merge/314297
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp

2017-01-08 Thread Azaziah
The proposal to merge lp:~suutari-olli/openlp/fix-openlp-importer into 
lp:openlp has been updated.

Status: Work in progress => Superseded

For more details, see:
https://code.launchpad.net/~suutari-olli/openlp/fix-openlp-importer/+merge/314296
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp

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

Diff comments:

> === modified file 'openlp/plugins/songs/lib/importers/openlp.py'
> --- openlp/plugins/songs/lib/importers/openlp.py  2016-12-31 11:01:36 
> +
> +++ openlp/plugins/songs/lib/importers/openlp.py  2017-01-08 22:10:23 
> +
> @@ -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

"Why not test song.song_number instead of using an extra field.?"

I don't understand this.

> +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:


-- 
https://code.launchpad.net/~suutari-olli/openlp/fix-openlp-importer/+merge/314296
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp

2017-01-08 Thread Azaziah
The proposal to merge lp:~suutari-olli/openlp/fix-openlp-importer into 
lp:openlp has been updated.

Status: Needs review => Work in progress

For more details, see:
https://code.launchpad.net/~suutari-olli/openlp/fix-openlp-importer/+merge/314296
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp

2017-01-08 Thread Tim Bentley
Review: Needs Fixing

Question and no tests Sorry!

Diff comments:

> === modified file 'openlp/plugins/songs/lib/importers/openlp.py'
> --- openlp/plugins/songs/lib/importers/openlp.py  2016-12-31 11:01:36 
> +
> +++ openlp/plugins/songs/lib/importers/openlp.py  2017-01-08 22:10:23 
> +
> @@ -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

Why not test song.song_number instead of using an extra field.?

> +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:


-- 
https://code.launchpad.net/~suutari-olli/openlp/fix-openlp-importer/+merge/314296
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp/2.4

2017-01-08 Thread Azaziah
The proposal to merge lp:~suutari-olli/openlp/fix-openlp-importer into 
lp:openlp/2.4 has been updated.

Status: Work in progress => Superseded

For more details, see:
https://code.launchpad.net/~suutari-olli/openlp/fix-openlp-importer/+merge/314295
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp/2.4.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


[Openlp-core] [Merge] lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp/2.4

2017-01-08 Thread Azaziah
The proposal to merge lp:~suutari-olli/openlp/fix-openlp-importer into 
lp:openlp/2.4 has been updated.

Status: Needs review => Work in progress

For more details, see:
https://code.launchpad.net/~suutari-olli/openlp/fix-openlp-importer/+merge/314295
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~suutari-olli/openlp/fix-openlp-importer into lp:openlp/2.4.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp