-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b65106a
commit 7caf539
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
caldaily, | ||
category_n, | ||
category_search, | ||
credits, | ||
eula, | ||
event_today, | ||
mii, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from room import app | ||
from helpers import xml_node_name, RepeatedElement | ||
from models import MovieCredits | ||
from werkzeug import exceptions | ||
|
||
|
||
@app.route("/url1/movie/<md5>/<int:movie_id>.stf") | ||
@xml_node_name("MovieStaff") | ||
def _credits(md5, movie_id): | ||
queried_credits = ( | ||
MovieCredits.query.filter_by(movie_id=movie_id) | ||
.order_by(MovieCredits.order.asc()) | ||
.all() | ||
) | ||
if queried_credits is None: | ||
return exceptions.NotFound() | ||
|
||
results = [] | ||
for c in queried_credits: | ||
results.append( | ||
RepeatedElement({"seq": c.order, "role": c.role, "name": c.name}) | ||
) | ||
|
||
return {"staff": results} |