@@ -61,10 +61,9 @@ async def get_pixel_history(
61
61
This call accepts positions with X, Y coordinates in specific canvases.
62
62
63
63
This call accepts authors to pull pixels changed by that author.
64
- """
65
64
66
- if all ( x is None for x in [ x , y , canvas_id , author ]):
67
- raise HTTPException ( status_code = 400 , detail = "Missing parameters." )
65
+ This call accepts no arguments to pull pixels for the entire dataset.
66
+ """
68
67
69
68
# GOOD ENOUGH HACK
70
69
if canvas_id is None :
@@ -85,28 +84,29 @@ async def get_pixel_history(
85
84
# Query all with limit.
86
85
filter_query = select (Pixel ).order_by (Pixel .modified ).limit (limit )
87
86
88
- if after :
87
+ if after is not None :
89
88
timestamp = float (after ) / 1000.0
90
89
timestamp = datetime .datetime .fromtimestamp (timestamp )
90
+ count_query = count_query .filter (Pixel .modified >= timestamp )
91
91
filter_query = filter_query .filter (Pixel .modified >= timestamp )
92
92
93
93
# Canvas
94
- if canvas_id :
94
+ if canvas_id is not None :
95
95
count_query = count_query .filter (Pixel .board_id == canvas_id )
96
96
filter_query = filter_query .filter (Pixel .board_id == canvas_id )
97
97
98
98
# X filters
99
- if x :
99
+ if x is not None :
100
100
count_query = count_query .filter (Pixel .x == x )
101
101
filter_query = filter_query .filter (Pixel .x == x )
102
102
103
103
# Y filters
104
- if y :
104
+ if y is not None :
105
105
count_query = count_query .filter (Pixel .y == y )
106
106
filter_query = filter_query .filter (Pixel .y == y )
107
107
108
108
# Filter: Author
109
- if author :
109
+ if author is not None :
110
110
count_query = count_query .filter (Pixel .user == author )
111
111
filter_query = filter_query .filter (Pixel .user == author )
112
112
0 commit comments