mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-01-26 09:56:11 +00:00
commit
00ba67772d
7 changed files with 11 additions and 10 deletions
|
@ -35,12 +35,12 @@ except IndexError:
|
||||||
dir_path = os.path.dirname(os.path.realpath(__file__))
|
dir_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
# Load template file
|
# Load template file
|
||||||
with open(f'{dir_path}/template.xml', 'r') as f:
|
with open('{dir_path}/template.xml'.format(**locals()), 'r') as f:
|
||||||
tree = ET.parse(f)
|
tree = ET.parse(f)
|
||||||
root = tree.getroot()
|
root = tree.getroot()
|
||||||
|
|
||||||
# Load version dependencies
|
# Load version dependencies
|
||||||
with open(f'{dir_path}/{py_version}.yaml', 'r') as f:
|
with open('{dir_path}/{py_version}.yaml'.format(**locals()), 'r') as f:
|
||||||
deps = yaml.safe_load(f)
|
deps = yaml.safe_load(f)
|
||||||
|
|
||||||
# Load version and changelog
|
# Load version and changelog
|
||||||
|
@ -53,7 +53,7 @@ for dep in deps:
|
||||||
|
|
||||||
# Update version string
|
# Update version string
|
||||||
addon_version = data.get('version')
|
addon_version = data.get('version')
|
||||||
root.attrib['version'] = f'{addon_version}+{py_version}'
|
root.attrib['version'] = '{addon_version}+{py_version}'.format(**locals())
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
date = datetime.today().strftime('%Y-%m-%d')
|
date = datetime.today().strftime('%Y-%m-%d')
|
||||||
|
@ -61,7 +61,7 @@ changelog = data.get('changelog')
|
||||||
for section in root.findall('extension'):
|
for section in root.findall('extension'):
|
||||||
news = section.findall('news')
|
news = section.findall('news')
|
||||||
if news:
|
if news:
|
||||||
news[0].text = f'v{addon_version} ({date}):\n{changelog}'
|
news[0].text = 'v{addon_version} ({date}):\n{changelog}'.format(**locals())
|
||||||
|
|
||||||
# Format xml tree
|
# Format xml tree
|
||||||
indent(root)
|
indent(root)
|
||||||
|
|
|
@ -183,6 +183,7 @@ def get_item_count(parent_id, item_type=None, params=None):
|
||||||
|
|
||||||
return result.get('TotalRecordCount', 1)
|
return result.get('TotalRecordCount', 1)
|
||||||
|
|
||||||
|
|
||||||
def get_items(parent_id, item_type=None, basic=False, params=None):
|
def get_items(parent_id, item_type=None, basic=False, params=None):
|
||||||
|
|
||||||
query = {
|
query = {
|
||||||
|
|
|
@ -69,7 +69,6 @@ class LogHandler(logging.StreamHandler):
|
||||||
|
|
||||||
xbmc.log(string, level=self.level)
|
xbmc.log(string, level=self.level)
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_log_level(cls, level):
|
def _get_log_level(cls, level):
|
||||||
|
|
||||||
|
|
|
@ -437,8 +437,7 @@ class Music(KodiDb):
|
||||||
''' This updates: Favorite, LastPlayedDate, Playcount, PlaybackPositionTicks
|
''' This updates: Favorite, LastPlayedDate, Playcount, PlaybackPositionTicks
|
||||||
Poster with progress bar
|
Poster with progress bar
|
||||||
'''
|
'''
|
||||||
server_address = self.server.auth.get_server_info(self.server.auth.server_id)['address']
|
|
||||||
API = api.API(item, server_address)
|
|
||||||
obj = self.objects.map(item, 'SongUserData')
|
obj = self.objects.map(item, 'SongUserData')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -410,7 +410,7 @@ class TVShows(KodiDb):
|
||||||
raise PathValidationException("Failed to validate path. User stopped.")
|
raise PathValidationException("Failed to validate path. User stopped.")
|
||||||
|
|
||||||
obj['Path'] = obj['Path'].replace(obj['Filename'], "")
|
obj['Path'] = obj['Path'].replace(obj['Filename'], "")
|
||||||
|
|
||||||
'''check dvd directries and point it to ./VIDEO_TS/VIDEO_TS.IFO'''
|
'''check dvd directries and point it to ./VIDEO_TS/VIDEO_TS.IFO'''
|
||||||
if validate_dvd_dir(obj['Path'] + obj['Filename']):
|
if validate_dvd_dir(obj['Path'] + obj['Filename']):
|
||||||
obj['Path'] = obj['Path'] + obj['Filename'] + '/VIDEO_TS/'
|
obj['Path'] = obj['Path'] + obj['Filename'] + '/VIDEO_TS/'
|
||||||
|
@ -422,7 +422,7 @@ class TVShows(KodiDb):
|
||||||
obj['Path'] = obj['Path'] + obj['Filename'] + '/BDMV/'
|
obj['Path'] = obj['Path'] + obj['Filename'] + '/BDMV/'
|
||||||
obj['Filename'] = 'index.bdmv'
|
obj['Filename'] = 'index.bdmv'
|
||||||
LOG.debug("Bluray directry %s", obj['Path'])
|
LOG.debug("Bluray directry %s", obj['Path'])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
obj['Path'] = "plugin://plugin.video.jellyfin/%s/" % obj['SeriesId']
|
obj['Path'] = "plugin://plugin.video.jellyfin/%s/" % obj['SeriesId']
|
||||||
params = {
|
params = {
|
||||||
|
|
|
@ -4,7 +4,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
|
||||||
import xml.etree.ElementTree as etree
|
import xml.etree.ElementTree as etree
|
||||||
|
|
||||||
from six.moves.urllib.parse import urlencode
|
from six.moves.urllib.parse import urlencode
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import division, absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
Loading…
Reference in a new issue