Skip to content

Commit

Permalink
Update song conversion from CCLI Songselect to newest ccli format
Browse files Browse the repository at this point in the history
  • Loading branch information
reckel-jm committed Apr 5, 2024
1 parent 0a2f0b9 commit 8991d52
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/generics/lyrics.pas
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ procedure TSong.ConvertCCLIFile;
else
{ The Parts Vers/Strophe and Bridge normally do not get repeated. They are only used once at the printed position. However, after them, the repetitional parts should follow. }
if (pos('Strophe ', inputFile.Strings[i]) = 1) Or
(pos('Vers ', inputFile.Strings[i]) = 1) Or (inputFile.Strings[i] = 'Vers') then
(pos('Vers ', inputFile.Strings[i]) = 1) Or (inputFile.Strings[i] = 'Vers') Or
(pos('Verse ', inputFile.Strings[i]) = 1) Or (inputFile.Strings[i] = 'Verse') then
begin
if RefrainState = True then
IncludeRepetitionalParts;
Expand All @@ -224,17 +225,17 @@ procedure TSong.ConvertCCLIFile;
end
else
{ Handle the CCLI Copyright information }
if (pos('CCLI', inputFile.Strings[i]) = 1) then
if (pos('CCLI Song #', inputFile.Strings[i]) = 1) then
begin
if i < self.inputFile.Count - 1 then
begin
self.MetaDict.Add('ccli-songnumber', self.inputFile.Strings[i].Split(' ')[1]);
self.MetaDict.Add('author', self.inputFile.Strings[i + 1]);
end
else
begin
self.MetaDict.Add('ccli-licensenumber', self.inputFile.Strings[i].Split(' ')[1]);
self.MetaDict.Add('ccli-songnumber', StringReplace(self.inputFile.Strings[i], 'CCLI Song #', '', [rfReplaceAll]));
self.MetaDict.Add('author', self.inputFile.Strings[i - 1]);
end;
end
else if i = self.inputFile.Count-1 then
begin
self.MetaDict.Add('ccli-licensenumber', StringReplace(self.inputFile.Strings[i], 'CCLI License #', '', [rfReplaceAll]));
end;
end;
{ Add Closing Refrain if needed }
Expand Down

0 comments on commit 8991d52

Please sign in to comment.