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

allow using custom update channels #27

Merged
merged 1 commit into from Jun 24, 2016

Conversation

lrusak
Copy link
Member

@lrusak lrusak commented Jun 10, 2016

should be good to go, let me know if the strings make sense.

@MilhouseVH
Copy link
Contributor

MilhouseVH commented Jun 12, 2016

Something weird is going on when you cancel the Automatic Updates, Update Channel and Available Versions dialogs. Open these dialogs and then click Cancel (or back - you may need to repeat this a second time).

It looks like the System panel is being refreshed, and half of the time the focus is being "lost", returning to the main menu, ie. click on Update Channel, click cancel, click down and (half of the time) instead of the focus moving to Available Versions as expected, instead you move from System to Network...

url = url + '/releases.json'
data = self.oe.load_url(url)
if not data is None:
update_json = json.loads(self.oe.load_url(url))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is loading the url a second time if it worked the first time, doubling the network overhead... shouldn't this be:

+                update_json = json.loads(data)

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep that will work better

@lrusak
Copy link
Member Author

lrusak commented Jun 13, 2016

updated, I'm still not sure why the focus is being lost...

@MilhouseVH
Copy link
Contributor

MilhouseVH commented Jun 13, 2016

Thanks, updated version is working better (fewer downloads of releases.json).

However there's a problem when downloading:

22:31:52 3286.522217 T:1591735200   ERROR: ## LibreELEC Addon ## oe::download_file(http://milhouse.libreelec.tv/builds/master/RPi2/LibreELEC-RPi2.arm-8.0-Milhouse-20160613210617-#0613-g64949dd.tar, /storage/.kodi/temp/LibreELEC-RPi2.arm-8.0-Milhouse-20160613210617-#0613-g64949dd.tar) ## ERROR: (HTTPError())
22:31:52 3286.522949 T:1591735200   ERROR: Traceback (most recent call last):
                                              File "/home/neil/projects/LibreELEC.tv/build.LibreELEC-RPi2.arm-8.0-devel/LibreELEC-settings-168c183/.install_pkg/usr/share/kodi/addons/service.libreelec.settings/oe.py", line 284, in download_file
                                              File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
                                              File "/usr/lib/python2.7/urllib2.py", line 437, in open
                                              File "/usr/lib/python2.7/urllib2.py", line 550, in http_response
                                              File "/usr/lib/python2.7/urllib2.py", line 475, in error
                                              File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
                                              File "/usr/lib/python2.7/urllib2.py", line 558, in http_error_default
                                            HTTPError: HTTP Error 404: Not Found

I don't think you're escaping/quoting the url so the hash (#) isn't converted to %23.

There's also no visual indication that the download has failed - it fails silently.

@MilhouseVH
Copy link
Contributor

It also looks like it has created the download file in /storage/.kodi/temp which makes me wonder if the temp folder could slowly become full of partially downloaded .tar files. Maybe a better solution would be to use a single filename for the temp file thus overwriting any existing temp file, then use the correct download filename when copying to /storage/.update. This way you'd only have at most one tar file hanging around in the temp folder.

@lrusak
Copy link
Member Author

lrusak commented Jun 23, 2016

@MilhouseVH I updated this, it should now work properly if the user has no internet connection or if they input the wrong url.

@chewitt chewitt merged commit 9a56a7c into LibreELEC:master Jun 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants