def get_tmdb_config():
 global _tmdb_config
 if (_tmdb_config is None):
  log.debug(u'no tmdb configuration in memory, checking cache')
  with Session() as session:
   config = session.query(TMDBConfig).first()
   if ((not config) or config.expired):
    log.debug(u'no config cached or config expired, refreshing')
    config = session.merge(TMDBConfig())
   _tmdb_config = config.configuration
 return _tmdb_config

def get_tmdb_config ( ) : global _tmdb_config if ( _tmdb_config is None ) : log . debug ( u'no tmdb configuration in memory, checking cache' ) with Session ( ) as session : config = session . query ( TMDBConfig ) . first ( ) if ( ( not config ) or config . expired ) : log . debug ( u'no config cached or config expired, refreshing' ) config = session . merge ( TMDBConfig ( ) ) _tmdb_config = config . configuration return _tmdb_config
loads tmdb config and caches it in db and memory .