def settings(settings=None): data = None if settings == None or settings == 'general': data = 'general' elif settings == 'display': data = 'display' elif settings == 'manage': data = library.get_manage_media() elif settings == 'client': data = 'download client' elif settings == 'torrent': data = 'torrent' elif settings == 'statistics': data = library.get_statistics() elif settings == 'about': data = 'about' else: return render_template('static/util/page_not_found.html'), 404 return render_template('settings.html', data=data, config=config.get_config())
def login(): error = None if request.method == 'POST': if request.form['username'] != app.config['USERNAME']: error = 'Invalid username' elif request.form['password'] != app.config['PASSWORD']: error = 'Invalid password' else: session['logged_in'] = True flash('You were logged in') return redirect(url_for('index')) return render_template('login.html', error=error)
def episode(tvshow, episode): data_episode = library.get_data_episode(tvshow, episode) return render_template('episode.html', tvshow=data_episode[0], episode=data_episode[1], config=config.get_config())
def tvshow(tvshow): data_tvshow = library.get_tvshow(tvshow) return render_template('tvshow.html', tvshow=data_tvshow[0], episodes=data_tvshow[1], config=config.get_config(), servertime=datetime.now())
def tvshows(): return render_template('tvshows.html', tvshows=library.get_tvshows(), fanart=library.get_random_tvshow_fanart(), config=config.get_config())
def index(): data_progress = library.get_progressed_media() data_recommended = None data_new = None return render_template('dash.html', progress=data_progress, recommended=data_recommended, new=data_new, fanart=library.get_random_tvshow_fanart(), config=config.get_config())
def page_not_found(error): return render_template('static/util/page_not_found.html'), 404
def music(): return render_template('music.html', config=config.get_config())
def pictures(): return render_template('pictures.html', config=config.get_config())
def movies(): return render_template('movies.html', config=config.get_config())
def episodeplayer(tvshow, episode): data_player = library.get_data_episode_player(tvshow, episode) return render_template('episodeplayer.html', tvshow=data_player[0], episode=data_player[1], videoinfo=data_player[2], config=config.get_config())