mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Merge pull request #103 from oddstr13/pr-ipv6-input-brackets-1
Enclose address input in square brackets if it is an IPv6 address
This commit is contained in:
commit
417d89f2ee
2 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import ipaddress
|
||||||
|
|
||||||
import xbmcgui
|
import xbmcgui
|
||||||
import xbmcaddon
|
import xbmcaddon
|
||||||
|
@ -114,6 +115,12 @@ class ServerManual(xbmcgui.WindowXMLDialog):
|
||||||
return control
|
return control
|
||||||
|
|
||||||
def _connect_to_server(self, server, port):
|
def _connect_to_server(self, server, port):
|
||||||
|
try:
|
||||||
|
addr = ipaddress.ip_address(server.decode('utf-8') if not isinstance(server, type(u'')) else server)
|
||||||
|
if addr.version == 6:
|
||||||
|
server = u"[%s]" % (addr.compressed)
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
server_address = "%s:%s" % (server, port) if port else server
|
server_address = "%s:%s" % (server, port) if port else server
|
||||||
self._message("%s %s..." % (_(30610), server_address))
|
self._message("%s %s..." % (_(30610), server_address))
|
||||||
|
|
|
@ -456,6 +456,7 @@ class ConnectionManager(object):
|
||||||
else:
|
else:
|
||||||
return servers
|
return servers
|
||||||
|
|
||||||
|
# TODO: Make IPv6 compatable
|
||||||
def _convert_endpoint_address_to_manual_address(self, info):
|
def _convert_endpoint_address_to_manual_address(self, info):
|
||||||
|
|
||||||
if info.get('Address') and info.get('EndpointAddress'):
|
if info.get('Address') and info.get('EndpointAddress'):
|
||||||
|
|
Loading…
Reference in a new issue