← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~j-corwin/openlp/bug-929825 into lp:openlp

 

Jonathan Corwin has proposed merging lp:~j-corwin/openlp/bug-929825 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #929825 in OpenLP: "CCLI songselect beta change"
  https://bugs.launchpad.net/openlp/+bug/929825
  Bug #955477 in OpenLP: "Alternative CCLI USR file schema"
  https://bugs.launchpad.net/openlp/+bug/955477

For more details, see:
https://code.launchpad.net/~j-corwin/openlp/bug-929825/+merge/97815

Fix a few songselect file format issues
-- 
https://code.launchpad.net/~j-corwin/openlp/bug-929825/+merge/97815
Your team OpenLP Core is requested to review the proposed merge of lp:~j-corwin/openlp/bug-929825 into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/cclifileimport.py'
--- openlp/plugins/songs/lib/cclifileimport.py	2012-01-28 16:15:11 +0000
+++ openlp/plugins/songs/lib/cclifileimport.py	2012-03-16 09:25:22 +0000
@@ -159,6 +159,12 @@
         song_author = u''
         song_topics = u''
         for line in textList:
+            if line.startswith(u'[S '):
+                ccli, line = line.split(u']', 1)
+                if ccli.startswith(u'[S A'):
+                    self.ccliNumber = ccli[4:].strip()
+                else:
+                    self.ccliNumber = ccli[3:].strip()
             if line.startswith(u'Title='):
                 self.title = line[6:].strip()
             elif line.startswith(u'Author='):
@@ -166,9 +172,7 @@
             elif line.startswith(u'Copyright='):
                 self.copyright = line[10:].strip()
             elif line.startswith(u'Themes='):
-                song_topics = line[7:].strip()
-            elif line.startswith(u'[S A'):
-                self.ccliNumber = line[4:-3].strip()
+                song_topics = line[7:].strip().replace(u' | ', u'/t')
             elif line.startswith(u'Fields='):
                 # Fields contain single line indicating verse, chorus, etc,
                 # /t delimited, same as with words field. store seperately
@@ -193,6 +197,7 @@
                 check_first_verse_line = True
             verse_text = unicode(words_list[counter])
             verse_text = verse_text.replace(u'/n', u'\n')
+            verse_text = verse_text.replace(u' | ', u'\n')
             verse_lines = verse_text.split(u'\n', 1)
             if check_first_verse_line:
                 if verse_lines[0].startswith(u'(PRE-CHORUS'):
@@ -243,7 +248,7 @@
             <Empty line>
             Song CCLI number
                 # e.g. CCLI Number (e.g.CCLI-Liednummer: 2672885)
-            Song copyright
+            Song copyright (if it begins ©, otherwise after authors)
                 # e.g. © 1999 Integrity's Hosanna! Music | LenSongs Publishing
             Song authors                # e.g. Lenny LeBlanc | Paul Baloche
             Licencing info
@@ -322,11 +327,17 @@
                     #line_number=2, copyright
                     if line_number == 2:
                         line_number += 1
-                        self.copyright = clean_line
+                        if clean_line.startswith(u'©'):
+                            self.copyright = clean_line
+                        else:
+                            song_author = clean_line
                     #n=3, authors
                     elif line_number == 3:
                         line_number += 1
-                        song_author = clean_line
+                        if song_author:
+                            self.copyright = clean_line
+                        else:
+                            song_author = clean_line
                     #line_number=4, comments lines before last line
                     elif line_number == 4 and not clean_line.startswith(u'CCL'):
                         self.comments += clean_line


Follow ups