@ -62,19 +62,21 @@ def update_series():
seriesListLength = len ( r . json ( ) )
for i , show in enumerate ( r . json ( ) , 1 ) :
notifications . write ( msg = " Getting series data from Sonarr... " , queue = ' get_series ' , item = i , length = seriesListLength )
try :
overview = six . text_type ( show [ ' overview ' ] )
except :
overview = " "
try :
poster_big = show [ ' images ' ] [ 2 ] [ ' url ' ] . split ( ' ? ' ) [ 0 ]
poster = os . path . splitext ( poster_big ) [ 0 ] + ' -250 ' + os . path . splitext ( poster_big ) [ 1 ]
except :
poster = " "
try :
fanart = show [ ' images ' ] [ 0 ] [ ' url ' ] . split ( ' ? ' ) [ 0 ]
except :
fanart = " "
if ' overview ' in show :
overview = show [ ' overview ' ]
else :
overview = ' '
poster = ' '
fanart = ' '
for image in show [ ' images ' ] :
if image [ ' coverType ' ] == ' poster ' :
poster_big = image [ ' url ' ] . split ( ' ? ' ) [ 0 ]
poster = os . path . splitext ( poster_big ) [ 0 ] + ' -250 ' + os . path . splitext ( poster_big ) [ 1 ]
if image [ ' coverType ' ] == ' fanart ' :
fanart = image [ ' url ' ] . split ( ' ? ' ) [ 0 ]
if show [ ' alternateTitles ' ] != None :
alternateTitles = str ( [ item [ ' title ' ] for item in show [ ' alternateTitles ' ] ] )
@ -85,17 +87,17 @@ def update_series():
current_shows_sonarr . append ( show [ ' id ' ] )
if show [ ' id ' ] in current_shows_db_list :
series_to_update . append ( { ' title ' : s ix. text_type ( s how[ " title " ] ) ,
' path ' : s ix. text_type ( s how[ " path " ] ) ,
series_to_update . append ( { ' title ' : s how[ " title " ] ,
' path ' : s how[ " path " ] ,
' tvdbId ' : int ( show [ " tvdbId " ] ) ,
' sonarrSeriesId ' : int ( show [ " id " ] ) ,
' overview ' : six. text_type ( overview) ,
' poster ' : six. text_type ( poster) ,
' fanart ' : six. text_type ( fanart) ,
' audio_language ' : six. text_type ( profile_id_to_language( ( show [ ' qualityProfileId ' ] if get_sonarr_version ( ) . startswith ( ' 2 ' ) else show [ ' languageProfileId ' ] ) , audio_profiles ) ) ,
' sortTitle ' : s ix. text_type ( s how[ ' sortTitle ' ] ) ,
' year ' : s ix. text_type ( s how[ ' year ' ] ) ,
' alternateTitles ' : six. text_type ( alternateTitles) } )
' overview ' : overview,
' poster ' : poster,
' fanart ' : fanart,
' audio_language ' : profile_id_to_language( ( show [ ' qualityProfileId ' ] if get_sonarr_version ( ) . startswith ( ' 2 ' ) else show [ ' languageProfileId ' ] ) , audio_profiles ) ,
' sortTitle ' : s how[ ' sortTitle ' ] ,
' year ' : s how[ ' year ' ] ,
' alternateTitles ' : alternateTitles} )
else :
if serie_default_enabled is True :
series_to_add . append ( { ' title ' : show [ " title " ] ,