Added the 'preferred_instance" setting to allow the user to specify a

preferred peerinstance to connect to (defaults to 'https://framatube.org')
This commit is contained in:
Cyrille Bollu 2018-07-27 14:43:21 +02:00
parent 98fb894ab3
commit fe91fa4e90
3 changed files with 32 additions and 4 deletions

View File

@ -13,7 +13,7 @@
import time, sys
import urllib2, json
from urlparse import parse_qsl
import xbmc, xbmcgui, xbmcplugin, xbmcvfs
import xbmc, xbmcgui, xbmcaddon, xbmcplugin, xbmcvfs
import AddonSignals
# Get the plugin url in plugin:// notation.
@ -28,12 +28,14 @@ class PeertubeAddon():
def __init__(self):
"""
Initialisation of the PeertubeAddon class
"""
xbmc.log('PeertubeAddon: Initialising', xbmc.LOGDEBUG)
# Nothing to play at initialisation
self.play = 0
self.torrent_name = ''
self.addon = xbmcaddon.Addon()
return None
@ -44,9 +46,8 @@ class PeertubeAddon():
:return: None
"""
# TODO: Make the instance configurable
# Make it actuatly possible to use several instances
inst = 'https://peertube.cpy.re'
# Get the user's preferred peertube instance
inst = self.addon.getSetting('preferred_instance')
# Get the list of videos published by the instance
# TODO: Handle failures

View File

@ -0,0 +1,23 @@
# Kodi Media Center language file
# Addon Name: Peertube
# Addon id: plugin.video.peertube
# Addon Provider: Cyrille Bollu
msgid ""
msgstr ""
"Project-Id-Version: Kodi Addons\n"
"Report-Msgid-Bugs-To: alanwww1@kodi.org\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Cyrille Bollu\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
# Settings (from 30000 to 30019)
msgctxt "#30000"
msgid "Preferred instance"
msgstr ""

4
resources/settings.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<setting id="preferred_instance" type="text" default="https://framatube.org" label="30000"/>
</settings>