Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wakefield-movie-recommender
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Frank Sauerburger
wakefield-movie-recommender
Compare revisions
7c9f5e889c4073143f386987b07d9c71838a0502 to b9a1b279fafc52c606c776350365ccf587646e9b
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
frank/wakefield-movie-recommender
Select target project
No results found
b9a1b279fafc52c606c776350365ccf587646e9b
Select Git revision
Branches
main
Swap
Target
frank/wakefield-movie-recommender
Select target project
frank/wakefield-movie-recommender
1 result
7c9f5e889c4073143f386987b07d9c71838a0502
Select Git revision
Branches
main
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Improve code style
· 9a8b7e66
Frank Sauerburger
authored
2 years ago
Verified
9a8b7e66
Make title-by-id endpoint multi-query
· b9a1b279
Frank Sauerburger
authored
2 years ago
Verified
b9a1b279
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
app.py
+23
-11
23 additions, 11 deletions
app.py
with
24 additions
and
12 deletions
Makefile
View file @
b9a1b279
TAG
=
0.
4
.0
TAG
=
0.
5
.0
build
:
DOCKER_DEFAULT_PLATFORM
=
linux/amd64 docker build
-t
gitlab.sauerburger.com:5049/frank/wakefield-movie-recommender:
$(
TAG
)
.
...
...
This diff is collapsed.
Click to expand it.
app.py
View file @
b9a1b279
...
...
@@ -50,18 +50,30 @@ def suggest():
}
@app.route
(
"
/titles/<int:mid>
"
)
def
byid
(
mid
):
"""
Show healthz status
"""
if
mid
not
in
movie_titles
:
abort
(
404
)
@app.route
(
"
/titles/<mids>
"
)
def
byid
(
mids
):
"""
Load movie data by id
"""
results
=
[]
for
mid
in
mids
.
split
(
"
,
"
):
try
:
mid
=
int
(
mid
)
if
mid
not
in
movie_titles
:
raise
ValueError
()
except
ValueError
:
results
.
append
({})
continue
res_title
,
res_year
=
movie_titles
[
mid
]
data
=
{
"
id
"
:
mid
,
"
title
"
:
res_title
,
"
year
"
:
res_year
}
results
.
append
(
data
)
return
{
"
movies
"
:
results
}
title
,
year
=
movie_titles
[
mid
]
return
{
"
id
"
:
mid
,
"
title
"
:
title
,
"
year
"
:
year
}
@app.route
(
"
/titles/healthz
"
)
def
healthz
():
...
...
This diff is collapsed.
Click to expand it.