def get_indexer_absolute_numbering_for_xem(indexer_id, indexer, sceneAbsoluteNumber, scene_season=None):
 if ((indexer_id is None) or (sceneAbsoluteNumber is None)):
  return sceneAbsoluteNumber
 indexer_id = int(indexer_id)
 indexer = int(indexer)
 xem_refresh(indexer_id, indexer)
 main_db_con = db.DBConnection()
 if (scene_season is None):
  rows = main_db_con.select('SELECT absolute_number FROM tv_episodes WHERE indexer = ? and showid = ? and scene_absolute_number = ?', [indexer, indexer_id, sceneAbsoluteNumber])
 else:
  rows = main_db_con.select('SELECT absolute_number FROM tv_episodes WHERE indexer = ? and showid = ? and scene_absolute_number = ? and scene_season = ?', [indexer, indexer_id, sceneAbsoluteNumber, scene_season])
 if rows:
  return int(rows[0]['absolute_number'])
 return sceneAbsoluteNumber

def get_indexer_absolute_numbering_for_xem ( indexer_id , indexer , sceneAbsoluteNumber , scene_season = None ) : if ( ( indexer_id is None ) or ( sceneAbsoluteNumber is None ) ) : return sceneAbsoluteNumber indexer_id = int ( indexer_id ) indexer = int ( indexer ) xem_refresh ( indexer_id , indexer ) main_db_con = db . DBConnection ( ) if ( scene_season is None ) : rows = main_db_con . select ( 'SELECT absolute_number FROM tv_episodes WHERE indexer = ? and showid = ? and scene_absolute_number = ?' , [ indexer , indexer_id , sceneAbsoluteNumber ] ) else : rows = main_db_con . select ( 'SELECT absolute_number FROM tv_episodes WHERE indexer = ? and showid = ? and scene_absolute_number = ? and scene_season = ?' , [ indexer , indexer_id , sceneAbsoluteNumber , scene_season ] ) if rows : return int ( rows [ 0 ] [ 'absolute_number' ] ) return sceneAbsoluteNumber
reverse of find_xem_numbering: lookup a tvdb season and episode using scene numbering .