Skip to content

Commit

Permalink
feat: Render credits in Wii Room
Browse files Browse the repository at this point in the history
  • Loading branch information
noahpistilli committed Jun 30, 2024
1 parent b65106a commit 7caf539
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions url1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
caldaily,
category_n,
category_search,
credits,
eula,
event_today,
mii,
Expand Down
24 changes: 24 additions & 0 deletions url1/credits.py
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}

0 comments on commit 7caf539

Please sign in to comment.