Skip to content

Commit

Permalink
Merge pull request jellyfin#130 from TrueTechy/restructuring
Browse files Browse the repository at this point in the history
Restructuring
  • Loading branch information
oddstr13 authored Nov 8, 2019
2 parents 6be8213 + 7e8f344 commit 7212e13
Show file tree
Hide file tree
Showing 72 changed files with 27 additions and 45 deletions.
2 changes: 1 addition & 1 deletion context.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#################################################################################################

__addon__ = xbmcaddon.Addon(id='plugin.video.jellyfin')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'resources', 'lib')).decode('utf-8')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'jellyfin_kodi')).decode('utf-8')

sys.path.insert(0, __base__)

Expand Down
2 changes: 1 addition & 1 deletion context_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#################################################################################################

__addon__ = xbmcaddon.Addon(id='plugin.video.jellyfin')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'resources', 'lib')).decode('utf-8')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'jellyfin_kodi')).decode('utf-8')

sys.path.insert(0, __base__)

Expand Down
2 changes: 1 addition & 1 deletion default.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#################################################################################################

__addon__ = xbmcaddon.Addon(id='plugin.video.jellyfin')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'resources', 'lib')).decode('utf-8')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'jellyfin_kodi')).decode('utf-8')

sys.path.insert(0, __base__)

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions resources/lib/connect.py → jellyfin_kodi/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from dialogs import ServerConnect, UsersConnect, LoginManual, ServerManual
from helper import settings, addon_id, event, api, window
from jellyfin import Jellyfin
from jellyfin.core.connection_manager import CONNECTION_STATE
from jellyfin.core.exceptions import HTTPException
from jellyfin.connection_manager import CONNECTION_STATE
from jellyfin.exceptions import HTTPException

##################################################################################################

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import xbmcgui

from helper import _
from jellyfin.core.connection_manager import CONNECTION_STATE
from jellyfin.connection_manager import CONNECTION_STATE

##################################################################################################

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import xbmcaddon

from helper import _, addon_id
from jellyfin.core.connection_manager import CONNECTION_STATE
from jellyfin.connection_manager import CONNECTION_STATE

##################################################################################################

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions resources/lib/downloader.py → jellyfin_kodi/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import requests
from helper import settings, stop, event, window, create_id
from jellyfin import Jellyfin
from jellyfin.core import api
from jellyfin.core.exceptions import HTTPException
from jellyfin import api
from jellyfin.exceptions import HTTPException

#################################################################################################

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from utils import unzip
from utils import create_id
from utils import convert_to_local as Local
from utils import has_attribute

from wrapper import progress
from wrapper import catch
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import xbmcgui
import xbmcvfs

from .translate import _
from translate import _

#################################################################################################

Expand Down Expand Up @@ -484,3 +484,10 @@ def convert_to_local(date):
LOG.exception(error)

return str(date)

def has_attribute(obj, name):
try:
object.__getattribute__(obj, name)
return True
except AttributeError:
return False
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging

from client import JellyfinClient
from helpers import has_attribute
from helper import has_attribute

#################################################################################################

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

import logging

import core.api as api
from core.configuration import Config
from core.http import HTTP
from core.ws_client import WSClient
from core.connection_manager import ConnectionManager, CONNECTION_STATE
import api
from configuration import Config
from http import HTTP
from ws_client import WSClient
from connection_manager import ConnectionManager, CONNECTION_STATE

#################################################################################################

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import xbmc

from ..resources import websocket
import websocket

##################################################################################################

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion resources/__init__.py

This file was deleted.

Empty file.
7 changes: 0 additions & 7 deletions resources/lib/jellyfin/helpers/__init__.py

This file was deleted.

16 changes: 0 additions & 16 deletions resources/lib/jellyfin/helpers/utils.py

This file was deleted.

Empty file.
6 changes: 2 additions & 4 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#################################################################################################

__addon__ = xbmcaddon.Addon(id='plugin.video.jellyfin')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'resources', 'lib')).decode('utf-8')
__base__ = xbmc.translatePath(os.path.join(__addon__.getAddonInfo('path'), 'jellyfin_kodi')).decode('utf-8')

sys.path.insert(0, __base__)

#################################################################################################

from entrypoint import Service # noqa: F402
from helper import settings # noqa: F402
from helper.utils import settings # noqa: F402

#################################################################################################

Expand Down Expand Up @@ -65,12 +65,10 @@ def run(self):


if __name__ == "__main__":

LOG.info("-->[ service ]")
LOG.info("Delay startup by %s seconds.", DELAY)

while True:

if not settings('enableAddon.bool'):
LOG.warning("Jellyfin for Kodi is not enabled.")

Expand Down

0 comments on commit 7212e13

Please sign in to comment.