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
17 changes: 8 additions & 9 deletions tests/core/jobs/test_playtime_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,14 @@ def test_do_run(self, db: DatabaseTransactionFixture):
playtime(db.session, identifier2, date3m(3), 5)
playtime(db.session, identifier2, date3m(4), 6)

with (
patch("core.jobs.playtime_entries.csv.writer") as writer,
patch("core.jobs.playtime_entries.EmailManager") as email,
patch(
"core.jobs.playtime_entries.os.environ",
new={
Configuration.REPORTING_EMAIL_ENVIRONMENT_VARIABLE: "reporting@test.email"
},
),
# Horrible unbracketted syntax for python 3.8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So glad this is fixed in more recent Python versions! Absolutely hideous and confusing.

with patch("core.jobs.playtime_entries.csv.writer") as writer, patch(
"core.jobs.playtime_entries.EmailManager"
) as email, patch(
"core.jobs.playtime_entries.os.environ",
new={
Configuration.REPORTING_EMAIL_ENVIRONMENT_VARIABLE: "reporting@test.email"
},
):
PlaytimeEntriesEmailReportsScript(db.session).run()

Expand Down