Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to export Favourite song list as OpenLP service #243

Closed
sskjames opened this issue Mar 18, 2021 · 35 comments · Fixed by #244, #251 or #253
Closed

Ability to export Favourite song list as OpenLP service #243

sskjames opened this issue Mar 18, 2021 · 35 comments · Fixed by #244, #251 or #253
Assignees
Labels
Milestone

Comments

@sskjames
Copy link
Contributor

Ref: WorshipSongs Android Issue 221

@sskjames sskjames self-assigned this Mar 18, 2021
@sskjames sskjames added this to the 3.0.0 milestone Mar 18, 2021
sskjames added a commit that referenced this issue Mar 19, 2021
… header json.

Elements not fully supported yet: footer, audit, data, xml_version
sskjames added a commit that referenced this issue Mar 19, 2021
sskjames added a commit that referenced this issue Mar 19, 2021
sskjames added a commit that referenced this issue Mar 22, 2021
…iceitem:header:data correctly when there are multiple authors

 - Added support to build the serviceitem:header:audit element correctly when there are multiple authors
@sskjames sskjames linked a pull request Mar 25, 2021 that will close this issue
sskjames added a commit that referenced this issue Mar 25, 2021
sskjames added a commit that referenced this issue Mar 30, 2021
@sskjames
Copy link
Contributor Author

sskjames commented Mar 30, 2021

service-file-created-by-app.osj.txt

As of now, this is the JSON created by the app.
I zipped this file with the extension oszl and tried to open it from OpenLP but got the following error:

Traceback (most recent call last):
  File "openlp/core/ui/servicemanager.py", line 440, in on_load_service_clicked
  File "openlp/core/ui/servicemanager.py", line 755, in load_file
  File "json/__init__.py", line 265, in load
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/encodings/ascii.py", line 26, in decode
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 801: ordinal not in range(128)

UPDATE:
This error was because by default, SwiftyJSON prints a pretty JSON. When switched to a compact output, I didn't see this error.

@sskjames
Copy link
Contributor Author

sskjames commented Mar 30, 2021

Interestingly, I got the same error when I extracted a oszl file created by OpenLP and re-zipped again with the extension oszl and tried to open it in OpenLP.

UPDATE:
This error was because I formatted the JSON to make it readable.

@sskjames
Copy link
Contributor Author

Now getting this error:

Traceback (most recent call last):
  File "openlp/core/common/openlpmixin.py", line 58, in wrapped
  File "openlp/core/common/openlpmixin.py", line 54, in wrapped
  File "openlp/core/ui/servicemanager.py", line 440, in on_load_service_clicked
  File "openlp/core/common/openlpmixin.py", line 58, in wrapped
  File "openlp/core/common/openlpmixin.py", line 54, in wrapped
  File "openlp/core/ui/servicemanager.py", line 766, in load_file
  File "openlp/core/common/openlpmixin.py", line 58, in wrapped
  File "openlp/core/common/openlpmixin.py", line 54, in wrapped
  File "openlp/core/ui/servicemanager.py", line 825, in process_service_items
  File "openlp/plugins/songs/lib/mediaitem.py", line 555, in service_load
  File "openlp/plugins/songs/lib/openlyricsxml.py", line 371, in xml_to_song
  File "src/lxml/lxml.objectify.pyx", line 1801, in lxml.objectify.fromstring (src/lxml/lxml.objectify.c:25171)
  File "src/lxml/lxml.etree.pyx", line 3213, in lxml.etree.fromstring (src/lxml/lxml.etree.c:77697)
  File "src/lxml/parser.pxi", line 1819, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:116494)
  File "src/lxml/parser.pxi", line 1700, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:115040)
  File "src/lxml/parser.pxi", line 1040, in lxml.etree._BaseParser._parseUnicodeDoc (src/lxml/lxml.etree.c:109165)
  File "src/lxml/parser.pxi", line 573, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:103404)
  File "src/lxml/parser.pxi", line 683, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:105058)
  File "src/lxml/parser.pxi", line 613, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:103967)
  File "<string>", line None
lxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1

@sskjames
Copy link
Contributor Author

Facing the encoding issue again.

Traceback (most recent call last):
  File "openlp/core/ui/servicemanager.py", line 440, in on_load_service_clicked
  File "openlp/core/ui/servicemanager.py", line 755, in load_file
  File "json/__init__.py", line 265, in load
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/encodings/ascii.py", line 26, in decode
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 1994: ordinal not in range(128)

The osj file which I created had the encoding utf-8

@sskjames
Copy link
Contributor Author

sskjames commented Apr 1, 2021

Observed the the service file json created by OpenLP 2.4.6 has the encoding "us-ascii" even when Tamil language songs are included.

service-with-tamil-song.osj.txt

@sskjames
Copy link
Contributor Author

sskjames commented Apr 1, 2021

Does OpenLP 2.4.6 support service data files with utf-8 encoding?
We have a few options:

  • Use "us-ascii" encoding and encode the data in ascii.
  • Check whether the latest version of OpenLP (2.9.x but is not public yet) supports "utf-8" encoding.

@sskjames
Copy link
Contributor Author

sskjames commented Apr 1, 2021

Raised this concern as a question in the OpenLP forum

@sskjames
Copy link
Contributor Author

sskjames commented Apr 5, 2021

Installing OpenLP 2.9.2 aka 3.0 Beta 1 to check whether the service files can be opened in it.

@sskjames
Copy link
Contributor Author

sskjames commented Apr 5, 2021

Tried to open the service file (created by the app) in OpenLP 2.9.2 and didn't get the encoding error. However, the xml error was still thrown.
Created a service with a Tamil song in OpenLP 2.9.2 and found the encoding to be us-ascii.
Looks like OpenLP expects the service_data json file with the encoding us-ascii.

@sskjames sskjames reopened this Apr 16, 2021
@sskjames
Copy link
Contributor Author

Observed some problems in the build uploaded to TestFlight.

@melissadarsh
Copy link

melissadarsh commented Apr 16, 2021

Performed the steps below during testing:

  1. Added 6 songs into favourites
  2. Tapped on the share option and shared as OpenLP Service.
  3. Shared the file through email.
  4. Downloaded the file and opened it in the OpenLP Service desktop app.
  5. Observed: Favourite songs appear on the service manager and songs were successfully presented.
  6. Repeated the above steps with another favourite list.
  7. Same is observed.

Tested on iOS14.4.

Note: The sharing option should include sharing through airdrop & sharing to the iOS OpenLP app

sskjames added a commit that referenced this issue Apr 16, 2021
sskjames added a commit that referenced this issue Apr 16, 2021
…es-as-openlp-service

#243 Ensured that the i18nTitle and mediaUrl are set properly for a song
@sskjames sskjames reopened this Apr 16, 2021
@sskjames
Copy link
Contributor Author

As part of the refactoring, I introduced another bug which causes only the i18nTitle to be displayed for the songs irrespective of the language they selected. Need to fix this.

@sskjames
Copy link
Contributor Author

As part of the refactoring, I introduced another bug which causes only the i18nTitle to be displayed for the songs irrespective of the language they selected. Need to fix this.

Performed the steps below during testing:

1. Added 6 songs into favourites

2. Tapped on the share option and shared as OpenLP Service.

3. Shared the file through email.

4. Downloaded the file and opened it in the OpenLP Service desktop app.

5. Observed: Favourite songs appear on the service manager and songs were successfully presented.

6. Repeated the above steps with another favourite list.

7. Same is observed.

Tested on iOS14.4.

Note: The sharing option should include sharing through airdrop & sharing to the iOS OpenLP app

Thanks @melissadarsh for the testing and feedback. Can we address sharing through airdrop in a separate issue? And I think, the iOS OpenLP app is just a remote to the desktop app.

@sskjames
Copy link
Contributor Author

OpenLP couldn't open the service file created by the app if the favourites has a song without a verse order.
To be specific, in the JSON data, the [serviceitem][data] is not constructed properly if the song does not have a verse order.

sskjames added a commit that referenced this issue Apr 19, 2021
@sskjames sskjames linked a pull request Apr 19, 2021 that will close this issue
@sskjames sskjames added this to the 3.1.0 milestone Apr 23, 2021
@pixel2user
Copy link

pixel2user commented Apr 27, 2021

I exported an oszl file (favorite_renamed_extension.oszl.zip, renamed for upload) via the iOS app (installed via TestFlight today) and opened that file in OpenLP 2.4.6 (Windows). I got the following error message, but was able to see the lyrics of both songs afterwards.

Traceback (most recent call last):
File "openlp\core\ui\servicemanager.py", line 440, in on_load_service_clicked
File "openlp\core\ui\servicemanager.py", line 766, in load_file
File "openlp\core\ui\servicemanager.py", line 828, in process_service_items
File "openlp\core\ui\servicemanager.py", line 1408, in add_service_item
File "openlp\core\lib\serviceitem.py", line 259, in render
KeyError: 'raw_slide'

@sskjames
Copy link
Contributor Author

I exported an oszl file (favorite_renamed_extension.oszl.zip, renamed for upload) via the iOS app (installed via TestFlight today) and opened that file in OpenLP 2.4.6 (Windows). I got the following error message, but was able to see the lyrics of both songs afterwards.

Traceback (most recent call last):
File "openlp\core\ui\servicemanager.py", line 440, in on_load_service_clicked
File "openlp\core\ui\servicemanager.py", line 766, in load_file
File "openlp\core\ui\servicemanager.py", line 828, in process_service_items
File "openlp\core\ui\servicemanager.py", line 1408, in add_service_item
File "openlp\core\lib\serviceitem.py", line 259, in render
KeyError: 'raw_slide'

Hi @GermanGospel, thank you very much for taking time to test this out and report it to us.
I'll look into it.

@sskjames sskjames reopened this Apr 29, 2021
@sskjames
Copy link
Contributor Author

Hi @GermanGospel, I exported the same songs which you did (Amazing Grace, God of Grace and God of Glory) and I could open it without any issues in OpenLP 2.4.6 (Mac OS 10.15). I'll test this out in Windows as well.

Which build did you use from TestFlight? Is it 3.1.0 (17)?

@sskjames
Copy link
Contributor Author

Hit the problem with OpenLP 2.4.6 (Windows).

@sskjames
Copy link
Contributor Author

I tested this again in Windows and Mac with many different songs but I couldn't recreate the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment