mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Merge pull request #434 from TrueTechy/delete-items-fix
Delete items from addon
This commit is contained in:
commit
b2aa57aafa
2 changed files with 17 additions and 1 deletions
|
@ -159,7 +159,7 @@ class Context(object):
|
||||||
self.delete_item()
|
self.delete_item()
|
||||||
|
|
||||||
def delete_item(self):
|
def delete_item(self):
|
||||||
if settings('skipContextMenu.bool') and dialog("yesno", "{jellyfin}", translate(33015)):
|
if settings('skipContextMenu.bool') or dialog("yesno", "{jellyfin}", translate(33015)):
|
||||||
self.api_client.delete_item(self.item['Id'])
|
self.api_client.delete_item(self.item['Id'])
|
||||||
|
|
||||||
def transcode(self):
|
def transcode(self):
|
||||||
|
|
|
@ -3,7 +3,10 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
from helper import LazyLogger
|
from helper import LazyLogger
|
||||||
|
from kodi_six.xbmc import translatePath
|
||||||
|
|
||||||
from . import api
|
from . import api
|
||||||
from .configuration import Config
|
from .configuration import Config
|
||||||
|
@ -42,6 +45,19 @@ class JellyfinClient(object):
|
||||||
self.callback_ws = callback
|
self.callback_ws = callback
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
|
|
||||||
|
addon_data = translatePath("special://profile/addon_data/plugin.video.jellyfin/data.json")
|
||||||
|
with open(addon_data, 'rb') as infile:
|
||||||
|
data = json.load(infile)
|
||||||
|
|
||||||
|
try:
|
||||||
|
server_data = data['Servers'][0]
|
||||||
|
self.jellyfin.config.data['auth.server'] = server_data.get('address')
|
||||||
|
self.jellyfin.config.data['auth.server-name'] = server_data.get('Name')
|
||||||
|
self.jellyfin.config.data['auth.user_id'] = server_data.get('UserId')
|
||||||
|
self.jellyfin.config.data['auth.token'] = server_data.get('AccessToken')
|
||||||
|
except Exception as e:
|
||||||
|
LOG.warning('Addon appears to not be configured yet: {}'.format(e))
|
||||||
|
|
||||||
def set_credentials(self, credentials=None):
|
def set_credentials(self, credentials=None):
|
||||||
self.auth.credentials.set_credentials(credentials or {})
|
self.auth.credentials.set_credentials(credentials or {})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue