Show an episode by season number and episode number
This commit is contained in:
parent
b8e3b0323b
commit
4b66923620
|
@ -55,6 +55,14 @@ def season(number):
|
||||||
|
|
||||||
return jsonify(episodes=retEpisodes)
|
return jsonify(episodes=retEpisodes)
|
||||||
|
|
||||||
|
@app.route("/season/<snumber>/episode/<epnumber>")
|
||||||
|
def show_episode(snumber, epnumber):
|
||||||
|
for episode in episodes:
|
||||||
|
if str(episode["season"]) == snumber and str(episode["episode"]) == epnumber:
|
||||||
|
return jsonify(episode=episode)
|
||||||
|
|
||||||
|
abort(404)
|
||||||
|
|
||||||
@app.route("/random")
|
@app.route("/random")
|
||||||
def show_random_ep():
|
def show_random_ep():
|
||||||
return jsonify(episode=random.choice(episodes))
|
return jsonify(episode=random.choice(episodes))
|
||||||
|
|
Loading…
Reference in New Issue