← Back to team overview

openlp-core team mailing list archive

[Bug 1689934] Re: service load match authors

 

the chronology of song.authors may be still a problem... or switch the
json separator...

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1689934

Title:
  service load match authors

Status in OpenLP:
  New

Bug description:
  the service_load function in mediaitem.py match authors with
  _authors_match function. If the authors string includes commas like
  this: "Text: Mr. X, Alan Cross", the _authors_match function fails.
  The json.load uses by default commas for separation and split(', ')
  isn't a good choose...

  I'am a python noob, but here the modified function:

      def _authors_match(self, song, authors):
          """
          Checks whether authors from a song in the database match the authors of the song to be imported.

          :param song: A list of authors from the song in the database
          :param authors: A string with authors from the song to be imported
          :return: True when Authors do match, else False.
          """
     
          author_list = []
          for author in song.authors:
              author_list.append(author.display_name)
          authors_song = ', '.join(author_list)
          if authors_song == authors:
              return True
          else:
              return False


  
  Please fix the bug!

  Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1689934/+subscriptions


References