def get_indexer_numbering(indexer_id, indexer, sceneSeason, sceneEpisode, fallback_to_xem=True):
 if ((indexer_id is None) or (sceneSeason is None) or (sceneEpisode is None)):
  return (sceneSeason, sceneEpisode)
 indexer_id = int(indexer_id)
 indexer = int(indexer)
 main_db_con = db.DBConnection()
 rows = main_db_con.select('SELECT season, episode FROM scene_numbering WHERE indexer = ? and indexer_id = ? and scene_season = ? and scene_episode = ?', [indexer, indexer_id, sceneSeason, sceneEpisode])
 if rows:
  return (int(rows[0]['season']), int(rows[0]['episode']))
 else:
  if fallback_to_xem:
   return get_indexer_numbering_for_xem(indexer_id, indexer, sceneSeason, sceneEpisode)
  return (sceneSeason, sceneEpisode)

def get_indexer_numbering ( indexer_id , indexer , sceneSeason , sceneEpisode , fallback_to_xem = True ) : if ( ( indexer_id is None ) or ( sceneSeason is None ) or ( sceneEpisode is None ) ) : return ( sceneSeason , sceneEpisode ) indexer_id = int ( indexer_id ) indexer = int ( indexer ) main_db_con = db . DBConnection ( ) rows = main_db_con . select ( 'SELECT season, episode FROM scene_numbering WHERE indexer = ? and indexer_id = ? and scene_season = ? and scene_episode = ?' , [ indexer , indexer_id , sceneSeason , sceneEpisode ] ) if rows : return ( int ( rows [ 0 ] [ 'season' ] ) , int ( rows [ 0 ] [ 'episode' ] ) ) else : if fallback_to_xem : return get_indexer_numbering_for_xem ( indexer_id , indexer , sceneSeason , sceneEpisode ) return ( sceneSeason , sceneEpisode )
returns a tuple .