From 4266d9cbdf7ce03ab300edd35833fce6f9950e1c Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 25 May 2015 12:11:04 +0100 Subject: [PATCH] For worshipassistant add a default verse-id for lyrics to use if none is given. Fixes bug 1458056. Fixes: https://launchpad.net/bugs/1458056 --- .../songs/lib/importers/worshipassistant.py | 1 + .../songs/test_worshipassistantimport.py | 2 + .../lift_up_your_heads.csv | 40 +++++++++++++++++++ .../lift_up_your_heads.json | 13 ++++++ 4 files changed, 56 insertions(+) create mode 100644 tests/resources/worshipassistantsongs/lift_up_your_heads.csv create mode 100644 tests/resources/worshipassistantsongs/lift_up_your_heads.json diff --git a/openlp/plugins/songs/lib/importers/worshipassistant.py b/openlp/plugins/songs/lib/importers/worshipassistant.py index f5254be5b..9d59a2e81 100644 --- a/openlp/plugins/songs/lib/importers/worshipassistant.py +++ b/openlp/plugins/songs/lib/importers/worshipassistant.py @@ -131,6 +131,7 @@ class WorshipAssistantImport(SongImport): return verse = '' used_verses = [] + verse_id = VerseType.tags[VerseType.Verse] + '1' for line in lyrics.splitlines(): if line.startswith('['): # verse marker # Add previous verse diff --git a/tests/functional/openlp_plugins/songs/test_worshipassistantimport.py b/tests/functional/openlp_plugins/songs/test_worshipassistantimport.py index c84ce8342..42c3a87bc 100644 --- a/tests/functional/openlp_plugins/songs/test_worshipassistantimport.py +++ b/tests/functional/openlp_plugins/songs/test_worshipassistantimport.py @@ -49,3 +49,5 @@ class TestWorshipAssistantFileImport(SongImportTestHelper): self.load_external_result_data(os.path.join(TEST_PATH, 'would_you_be_free.json'))) self.file_import(os.path.join(TEST_PATH, 'would_you_be_free2.csv'), self.load_external_result_data(os.path.join(TEST_PATH, 'would_you_be_free.json'))) + self.file_import(os.path.join(TEST_PATH, 'lift_up_your_heads.csv'), + self.load_external_result_data(os.path.join(TEST_PATH, 'lift_up_your_heads.json'))) diff --git a/tests/resources/worshipassistantsongs/lift_up_your_heads.csv b/tests/resources/worshipassistantsongs/lift_up_your_heads.csv new file mode 100644 index 000000000..18be3110b --- /dev/null +++ b/tests/resources/worshipassistantsongs/lift_up_your_heads.csv @@ -0,0 +1,40 @@ +"SongID","SongNr","Title","Author","Copyright","FirstLine","PriKey","AltKey","Tempo","Focus","Theme","Scripture","Active","Songbook","TimeSig","Introduced","LastUsed","TimesUsed","CCLINr","User1","User2","User3","User4","User5","Roadmap","Overmap","FileLink1","FileLink2","Updated","Lyrics","Info","Lyrics2","Background" +"000013ab-0000-0000-0000-000000000000","0","Lift Up Your Heads"," Bryan Mierau","Public Domain","Lift up your heads and the doors","Em","NULL","NULL","NULL","NULL","NULL","1","1","NULL","NULL","NULL","0","NULL","NULL","NULL","NULL","NULL","NULL","NULL","NULL","NULL","NULL","2004-04-07 06:36:18.952",".Em D C D + Lift up your heads and the doors of your heart +. Am B7 Em + And the King of glory will come in +(Repeat) + +.G Am D + Who is this King of Glory? +. B7 Em + The Lord strong and mighty! +.G Am D + Who is this King of Glory? +. B7 + The Lord, mighty in battle! + +.G Am D + Who is this King of Glory? +.B7 Em + Jesus our Messiah! +.G Am D + Who is this King of Glory? +.B7 Em + Jesus, Lord of Lords! + +","NULL","Lift up your heads and the doors of your heart +And the King of glory will come in +(Repeat) + +Who is this King of Glory? +The Lord strong and mighty! +Who is this King of Glory? +The Lord, mighty in battle! + +Who is this King of Glory? +Jesus our Messiah! +Who is this King of Glory? +Jesus, Lord of Lords! + +","NULL" diff --git a/tests/resources/worshipassistantsongs/lift_up_your_heads.json b/tests/resources/worshipassistantsongs/lift_up_your_heads.json new file mode 100644 index 000000000..d3ef07f44 --- /dev/null +++ b/tests/resources/worshipassistantsongs/lift_up_your_heads.json @@ -0,0 +1,13 @@ +{ + "authors": [ + "Bryan Mierau" + ], + "title": "Lift Up Your Heads", + "verse_order_list": [], + "verses": [ + [ + "Lift up your heads and the doors of your heart\nAnd the King of glory will come in\n(Repeat)\n\nWho is this King of Glory?\nThe Lord strong and mighty!\nWho is this King of Glory?\nThe Lord, mighty in battle!\n\nWho is this King of Glory?\nJesus our Messiah!\nWho is this King of Glory?\nJesus, Lord of Lords!\n", + "v1" + ] + ] +}