def get_indexer_absolute_numbering(indexer_id, indexer, sceneAbsoluteNumber, fallback_to_xem=True, scene_season=None):
 if ((indexer_id is None) or (sceneAbsoluteNumber is None)):
  return sceneAbsoluteNumber
 indexer_id = int(indexer_id)
 indexer = int(indexer)
 if (scene_season is None):
  dbData = [x[u'doc'] for x in sickrage.srCore.mainDB.db.get_many(u'scene_numbering', indexer_id, with_doc=True) if ((x[u'doc'][u'indexer'] == indexer) and (x[u'doc'][u'scene_absolute_number'] == sceneAbsoluteNumber))]
 else:
  dbData = [x[u'doc'] for x in sickrage.srCore.mainDB.db.get_many(u'scene_numbering', indexer_id, with_doc=True) if ((x[u'doc'][u'indexer'] == indexer) and (x[u'doc'][u'scene_absolute_number'] == sceneAbsoluteNumber) and (x[u'doc'][u'scene_season'] == scene_season))]
 if dbData:
  return int((dbData[0][u'absolute_number'] or 0))
 else:
  if fallback_to_xem:
   return get_indexer_absolute_numbering_for_xem(indexer_id, indexer, sceneAbsoluteNumber, scene_season)
  return sceneAbsoluteNumber

def get_indexer_absolute_numbering ( indexer_id , indexer , sceneAbsoluteNumber , fallback_to_xem = True , scene_season = None ) : if ( ( indexer_id is None ) or ( sceneAbsoluteNumber is None ) ) : return sceneAbsoluteNumber indexer_id = int ( indexer_id ) indexer = int ( indexer ) if ( scene_season is None ) : dbData = [ x [ u'doc' ] for x in sickrage . srCore . mainDB . db . get_many ( u'scene_numbering' , indexer_id , with_doc = True ) if ( ( x [ u'doc' ] [ u'indexer' ] == indexer ) and ( x [ u'doc' ] [ u'scene_absolute_number' ] == sceneAbsoluteNumber ) ) ] else : dbData = [ x [ u'doc' ] for x in sickrage . srCore . mainDB . db . get_many ( u'scene_numbering' , indexer_id , with_doc = True ) if ( ( x [ u'doc' ] [ u'indexer' ] == indexer ) and ( x [ u'doc' ] [ u'scene_absolute_number' ] == sceneAbsoluteNumber ) and ( x [ u'doc' ] [ u'scene_season' ] == scene_season ) ) ] if dbData : return int ( ( dbData [ 0 ] [ u'absolute_number' ] or 0 ) ) else : if fallback_to_xem : return get_indexer_absolute_numbering_for_xem ( indexer_id , indexer , sceneAbsoluteNumber , scene_season ) return sceneAbsoluteNumber
returns a tuple .