Try to get ccli number even if there is text in the field

This commit is contained in:
Samuel Mehrbrodt 2014-05-03 10:47:31 +02:00
parent b993af2e90
commit e8c7547ab2
2 changed files with 5 additions and 4 deletions

View File

@ -147,10 +147,10 @@ class SongShowPlusImport(SongImport):
elif block_key == COPYRIGHT:
self.add_copyright(self.decode(data))
elif block_key == CCLI_NO:
try:
self.ccli_number = int(data)
except ValueError:
continue
# Try to get the CCLI number even if the field contains additional text
match = re.search(r'\d+', self.decode(data))
if match:
self.ccli_number = int(match.group())
elif block_key == VERSE:
self.add_verse(self.decode(data), "%s%s" % (VerseType.tags[VerseType.Verse], verse_no))
elif block_key == CHORUS:

View File

@ -2,6 +2,7 @@
"authors": [
"Martin Luther"
],
"ccli_number": 12456,
"comments": "",
"copyright": "Public Domain",
"song_number": 0,