Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audiobook time tracking #1288

Merged
merged 27 commits into from
Aug 3, 2023
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b5e58f3
Time tracking models and model tests
RishiDiwanTT Jul 20, 2023
3d43dca
Time tracking route with api models added
RishiDiwanTT Jul 20, 2023
e1a00a5
Playtime summation script and tests
RishiDiwanTT Jul 21, 2023
22d74c2
Playtime reporting script added with a configurable email recipient
RishiDiwanTT Jul 21, 2023
22bcfe5
Changed API route
RishiDiwanTT Jul 21, 2023
d735181
Added time tracking links to feed entries
RishiDiwanTT Jul 24, 2023
4b0cfcd
Mypy fixes
RishiDiwanTT Jul 24, 2023
edf3756
Python 3.8 syntax fix
RishiDiwanTT Jul 24, 2023
0b51149
Alembic ordering fix
RishiDiwanTT Jul 28, 2023
0705167
Added collection and library information to the playtime entries and …
RishiDiwanTT Jul 28, 2023
23c5e51
Reporting summation groups on collection and library as well now
RishiDiwanTT Jul 28, 2023
1a1c9a0
Playtimes API validations
RishiDiwanTT Jul 28, 2023
e081f78
Modularized playtime entries
RishiDiwanTT Jul 28, 2023
4a35980
Fixed UTC date issue
RishiDiwanTT Jul 28, 2023
fd0e97a
PR updates
RishiDiwanTT Jul 31, 2023
30b0661
Added the 401 gone status for very old entries
RishiDiwanTT Jul 31, 2023
c5c942d
Playtime entries reaping cut off time
RishiDiwanTT Jul 31, 2023
87ad147
Time tracking rels only for specific collections
RishiDiwanTT Jul 31, 2023
6827875
Mypyp fixes
RishiDiwanTT Jul 31, 2023
6a93da8
Fixed 401 Gone to 410 Gone
RishiDiwanTT Aug 1, 2023
49170e5
Only a loans feed with active loans for a work will have time trackin…
RishiDiwanTT Aug 1, 2023
6e727b6
410 is now counted as a failure
RishiDiwanTT Aug 2, 2023
049696b
Fixed time tracking links
RishiDiwanTT Aug 3, 2023
3a0a689
Mypy fix
RishiDiwanTT Aug 3, 2023
c9e8a21
API spec for the route
RishiDiwanTT Aug 3, 2023
dc8d552
Switched from collection.name to colletion.id for the playtime route
RishiDiwanTT Aug 3, 2023
ba1fa75
Add missing API fields.
tdilauro Aug 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from werkzeug.exceptions import HTTPException

from api.model.patron_auth import PatronAuthAccessToken
from api.model.time_tracking import PlaytimeEntriesPost, PlaytimeEntriesPostResponse
from core.app_server import ErrorHandler, compressible, returns_problem_detail
from core.model import HasSessionCache
from core.util.problem_detail import ProblemDetail
Expand Down Expand Up @@ -675,10 +676,16 @@ def track_analytics_event(identifier_type, identifier, event_type):
@library_route(
"/playtimes/<collection_name>/<identifier_type>/<path:identifier>", methods=["POST"]
tdilauro marked this conversation as resolved.
Show resolved Hide resolved
)
@api_spec.validate(
resp=SpecResponse(HTTP_200=PlaytimeEntriesPostResponse),
body=PlaytimeEntriesPost,
tags=["analytics"],
)
@has_library
@allows_auth
@returns_problem_detail
def track_playtime_events(collection_name, identifier_type, identifier):
"""The actual response type is 207, but due to a bug in flask-pydantic-spec we must document it as a 200"""
tdilauro marked this conversation as resolved.
Show resolved Hide resolved
return app.manager.playtime_entries.track_playtimes(
collection_name, identifier_type, identifier
)
Expand Down