1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Fixed issue with theTVDB IndexerAPI _parseActors method improperly parsing the data returned from the api causing an exception to occur during metadata refreshes.

Fixed issues with Backup/Restore.

Fixed issues with banners, posters, images via showPoster method.
This commit is contained in:
echel0n 2014-12-13 04:14:29 -08:00
parent 4fd92a8631
commit c8b050704b
7 changed files with 36 additions and 32 deletions

View File

@ -5,7 +5,7 @@ $(document).ready(function(){
$("#Backup").attr("disabled", true);
$('#Backup-result').html(loading);
var backupDir = $("#backupDir").val();
$.get(sbRoot + "/config/backup", {'backupDir': backupDir})
$.get(sbRoot + "/config/backup/", {'backupDir': backupDir})
.done(function (data) {
$('#Backup-result').html(data);
$("#Backup").attr("disabled", false);
@ -15,7 +15,7 @@ $(document).ready(function(){
$("#Restore").attr("disabled", true);
$('#Restore-result').html(loading);
var backupFile = $("#backupFile").val();
$.get(sbRoot + "/config/restore", {'backupFile': backupFile})
$.get(sbRoot + "/config/restore/", {'backupFile': backupFile})
.done(function (data) {
$('#Restore-result').html(data);
$("#Restore").attr("disabled", false);

View File

@ -797,18 +797,20 @@ class Tvdb:
return
cur_actors = Actors()
for curActorItem in actorsEt["actor"].items():
for cur_actor in actorsEt['actor']:
curActor = Actor()
for k, v in curActorItem:
for k, v in cur_actor.items():
if k is None or v is None:
continue
k = k.lower()
if v is not None:
if k == "image":
v = self.config['url_artworkPrefix'] % (v)
else:
v = self._cleanData(v)
if k == "image":
v = self.config['url_artworkPrefix'] % (v)
else:
v = self._cleanData(v)
curActor[k] = v
cur_actors.append(curActor)
self._setShowData(sid, '_actors', cur_actors)
def _getShowData(self, sid, language, getEpInfo=False):

View File

@ -189,19 +189,16 @@ class KODI_12PlusMetadata(generic.GenericMetadata):
cur_actor = etree.SubElement(tv_node, "actor")
cur_actor_name = etree.SubElement(cur_actor, "name")
cur_actor_name_text = actor['name']
if isinstance(cur_actor_name_text, basestring):
cur_actor_name.text = cur_actor_name_text.strip()
if getattr(actor, 'name', None) is not None:
cur_actor_name.text = actor['name'].strip()
cur_actor_role = etree.SubElement(cur_actor, "role")
cur_actor_role_text = actor['role']
if cur_actor_role_text != None:
cur_actor_role.text = cur_actor_role_text
if getattr(actor, 'role', None) is not None:
cur_actor_role.text = actor['role']
cur_actor_thumb = etree.SubElement(cur_actor, "thumb")
cur_actor_thumb_text = actor['image']
if cur_actor_thumb_text != None:
cur_actor_thumb.text = cur_actor_thumb_text
if getattr(actor, 'image', None) is not None:
cur_actor_thumb.text = actor['image']
# Make it purdy
helpers.indentXML(tv_node)

View File

@ -199,8 +199,7 @@ class Mede8erMetadata(mediabrowser.MediaBrowserMetadata):
if getattr(myShow, '_actors', None) is not None:
for actor in myShow['_actors']:
cur_actor_name_text = actor['name']
cur_actor_name_text = getattr(actor, 'name', None)
if cur_actor_name_text != None and cur_actor_name_text.strip():
cur_actor = etree.SubElement(cast, "actor")
cur_actor.text = cur_actor_name_text.strip()

View File

@ -362,14 +362,17 @@ class MediaBrowserMetadata(generic.GenericMetadata):
if getattr(myShow, 'actors', None) is not None:
for actor in myShow['_actors']:
cur_actor = etree.SubElement(Persons, "Person")
cur_actor_name = etree.SubElement(cur_actor, "Name")
cur_actor_name.text = actor['name'].strip()
if getattr(actor, 'name', None):
cur_actor_name.text = actor['name'].strip()
cur_actor_type = etree.SubElement(cur_actor, "Type")
cur_actor_type.text = "Actor"
cur_actor_role = etree.SubElement(cur_actor, "Role")
cur_actor_role_text = actor['role']
if cur_actor_role_text != None:
cur_actor_role.text = cur_actor_role_text
if getattr(actor, 'role', None):
cur_actor_role.text = actor['role']
helpers.indentXML(tv_node)

View File

@ -275,12 +275,14 @@ class WDTVMetadata(generic.GenericMetadata):
if getattr(myShow, '_actors', None) is not None:
for actor in myShow['_actors']:
cur_actor = etree.SubElement(episode, "actor")
cur_actor_name = etree.SubElement(cur_actor, "name")
cur_actor_name.text = actor['name']
if getattr(actor, 'name', None):
cur_actor_name.text = actor['name']
cur_actor_role = etree.SubElement(cur_actor, "role")
cur_actor_role_text = actor['role']
if cur_actor_role_text != None:
cur_actor_role.text = cur_actor_role_text
if getattr(actor, 'role', None):
cur_actor_role.text = actor['role']
overview = etree.SubElement(episode, "overview")
if curEpToWrite.description != None:

View File

@ -24,6 +24,7 @@ import time
import urllib
import re
import datetime
import urlparse
import sickbeard
from sickbeard import config, sab
@ -371,7 +372,7 @@ class WebRoot(WebHandler):
default_image_name = 'banner.png'
#image_path = ek.ek(os.path.join, sickbeard.PROG_DIR, 'gui', 'slick', 'images', default_image_name)
static_image_path = '/images/' + default_image_name
static_image_path = os.path.join('/images', default_image_name)
if show and sickbeard.helpers.findCertainShow(sickbeard.showList, int(show)):
cache_obj = image_cache.ImageCache()
@ -386,9 +387,9 @@ class WebRoot(WebHandler):
image_file_name = cache_obj.banner_thumb_path(show)
if ek.ek(os.path.isfile, image_file_name):
image_path = image_file_name
static_image_path = '/cache' + image_path.replace(sickbeard.CACHE_DIR, '')
static_image_path = os.path.normpath(image_file_name.replace(sickbeard.CACHE_DIR, '/cache'))
static_image_path = static_image_path.replace('\\', '/')
return self.redirect(static_image_path)
def setHomeLayout(self, layout):