mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-10 20:08:47 -06:00
start adding HTML viewing options
This commit is contained in:
@@ -1,6 +1,22 @@
|
|||||||
|
from flask import send_from_directory, redirect, url_for, render_template, request
|
||||||
|
from app.models import Season, Episode
|
||||||
from app import app
|
from app import app
|
||||||
from flask import send_from_directory, redirect, url_for, render_template
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def index():
|
def index():
|
||||||
return 'WIP'
|
return 'WIP'
|
||||||
|
|
||||||
|
@app.route('/view')
|
||||||
|
def view():
|
||||||
|
seasonID = request.args.get('season')
|
||||||
|
episodeNUM = request.args.get('episode')
|
||||||
|
|
||||||
|
season = Season.query.get(int(seasonID))
|
||||||
|
episode = Episode.query.filter_by(season_id=season.id, number=int(episodeNUM))
|
||||||
|
|
||||||
|
if season:
|
||||||
|
if episode:
|
||||||
|
return render_template('episode.html')
|
||||||
|
else:
|
||||||
|
return render_template('season.html', season=Season.query.get())
|
||||||
|
return redirect(url_for('index'))
|
||||||
Reference in New Issue
Block a user