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

Remove show service #92

Merged
merged 75 commits into from
Nov 1, 2021
Merged
Changes from 1 commit
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
970c597
Add new api_info index
fulder Oct 28, 2021
7bb7353
Move cron and tvmaze api from show service
fulder Oct 28, 2021
7a1c98e
Add fastapi requirements to generate hashes file
fulder Oct 28, 2021
d3630b9
Create new show updates topic
fulder Oct 28, 2021
ad36e2a
Add config for new lambdas
fulder Oct 28, 2021
b5cb634
Add new func for getting item by id
fulder Oct 28, 2021
6f5327f
Start adding fastapi lambda
fulder Oct 28, 2021
d6e8cb0
Rename cron lambda and quickfix fastapi requirement
fulder Oct 28, 2021
2f7da83
Ignore temp installed requirements
fulder Oct 28, 2021
f7198ae
Use mangum in fastapi and change method to any
fulder Oct 28, 2021
aab38c2
Add needed base_path to mangum
fulder Oct 29, 2021
295218e
Add middelware for getting username from JWT
fulder Oct 29, 2021
69d60e3
Implement first try of api.get_item
fulder Oct 29, 2021
9b07163
Change relative import
fulder Oct 29, 2021
0f39537
Remove Bearer string from jwt data
fulder Oct 29, 2021
52c6f6a
Forgotten to add request param to call_next
fulder Oct 29, 2021
654eb68
Fix api_info in get_item_by_api_id
fulder Oct 29, 2021
326ff0e
Remove duplicated dict
fulder Oct 29, 2021
d57dcf8
Try returing dict directly
fulder Oct 29, 2021
bffc742
Change ANY to real verbs
fulder Oct 29, 2021
e075728
Implement new add_item with show support
fulder Oct 29, 2021
505beda
Return collection_name temporary
fulder Oct 29, 2021
1a03f8d
Add pydantic models file
fulder Oct 29, 2021
50708af
Return 204 code for post item
fulder Oct 29, 2021
92a05ac
Convert add_item data into watch histories items
fulder Oct 29, 2021
b10bdf9
Get show episodes count during add_item
fulder Oct 29, 2021
1687b61
Change reserved list keyword to List from typing
fulder Oct 29, 2021
f716e74
Let FastAPI handle CORS
fulder Oct 29, 2021
de9f168
Fix invalid import
fulder Oct 29, 2021
f9052cd
Revert CORS and fix base_path
fulder Oct 29, 2021
2054d55
Remove Bearer from auth header
fulder Oct 30, 2021
4f84497
Don't set None filterexpression
fulder Oct 30, 2021
0e1a964
Check if dates_watched is none
fulder Oct 30, 2021
835b188
Make dates_watched get consistent
fulder Oct 30, 2021
3594d20
Fix invalid dates_watched condition check
fulder Oct 30, 2021
e283043
Allow fastAPI lambda to update items
fulder Oct 30, 2021
44a0715
Remove api file to routes
fulder Oct 30, 2021
4c43c53
Fix issues with None data values in updat_item
fulder Oct 30, 2021
a4cd8e9
Change query params to path variabels and start adding delete route
fulder Oct 30, 2021
d2c6bac
Implement delete_item route
fulder Oct 30, 2021
1701058
Fix invalid name to repo func
fulder Oct 30, 2021
4fc8ede
Skip returning apidata in get item route
fulder Oct 30, 2021
7e48dc5
Implement put item route
fulder Oct 30, 2021
ce8058d
Set ep data only for episode collection items
fulder Oct 30, 2021
f91d137
Use update_item in put route
fulder Oct 30, 2021
053f92c
Rename update item func
fulder Oct 30, 2021
8bfe4a5
Add new indexes for episode table and api_info fields
fulder Oct 31, 2021
9be3a3b
Implement get episode by api id using new GSI and migrated data
fulder Oct 31, 2021
6c02691
Add route for getting all item episodes
fulder Oct 31, 2021
2b0cae2
Add permissions to episode_table for fastAPI lambda
fulder Oct 31, 2021
87e1fa4
Remove item_api_id from episode table
fulder Oct 31, 2021
3b14635
Include item api_id in one episode get
fulder Oct 31, 2021
0f18bf2
Rename api_id to item_api_id in all routes
fulder Oct 31, 2021
556acc4
Add first implementation of post episode
fulder Oct 31, 2021
2b3075f
Implement delete_episode route and add db wrappers for v2 operations
fulder Oct 31, 2021
77301bd
Remove dependency to show service in cron/subscribers
fulder Oct 31, 2021
108c271
Implement route for updating episode
fulder Oct 31, 2021
68b4359
Check if episode really exists in tvmaze
fulder Oct 31, 2021
eb1cd73
Rename Item model to ReviewData
fulder Oct 31, 2021
1901540
Use fastapi jsonable_encoder for boto data
fulder Oct 31, 2021
7257429
Add helper func to convert ReviewData into dict
fulder Oct 31, 2021
78b56f4
Ignore empty dates_watched properties
fulder Oct 31, 2021
24c8a7e
Fix colliding var names
fulder Oct 31, 2021
33656c1
Check for empty dates_watched
fulder Oct 31, 2021
b688f51
Fix invalid if conditions
fulder Oct 31, 2021
eacbdd2
Clear latest_watch_date on empty dates_watched put
fulder Oct 31, 2021
6316c36
Revert clearing latest_watch_date of item on episode update
fulder Oct 31, 2021
525a1ba
Shortcircut all show api calls
fulder Oct 31, 2021
3535fcb
Add missing 's' to items routes
fulder Oct 31, 2021
4a38990
Remove shows_api from api layer
fulder Oct 31, 2021
e0ac99e
Add first fastapi unittest for get item
fulder Oct 31, 2021
e994ae5
Add happy test case for post item
fulder Nov 1, 2021
36f5894
Cleanup old show tests and add new more simple route tests
fulder Nov 1, 2021
56ba8c8
Install watch_histories requirements before tests
fulder Nov 1, 2021
5422aec
Include new lambda in python path
fulder Nov 1, 2021
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
Prev Previous commit
Next Next commit
Fix invalid dates_watched condition check
fulder committed Oct 30, 2021
commit 3594d2044179c38912c5761b6d7aa6eb5101de9b
2 changes: 1 addition & 1 deletion src/layers/databases/python/watch_history_db.py
Original file line number Diff line number Diff line change
@@ -149,7 +149,7 @@ def update_item(username, collection_name, item_id, data,
data["collection_name"] = collection_name
data["updated_at"] = datetime.now().strftime("%Y-%m-%d %H:%M:%S")

if data.get("dates_watched") is None:
if data.get("dates_watched") is not None:
m_d = max([dateutil.parser.parse(d) for d in data["dates_watched"]])
m_d = m_d.strftime("%Y-%m-%dT%H:%M:%S.%fZ")
data["latest_watch_date"] = m_d.replace("000Z", "Z")