LogicGoInfotechSpaces commited on
Commit
58a620f
·
verified ·
1 Parent(s): 0b1f0d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -993,10 +993,12 @@ def sync_log_media_click(user_id_str: str, category_id_str: str):
993
  {
994
  "$set": {
995
  "updatedAt": now,
996
- "categories.$.lastClickedAt": now
 
997
  },
998
  "$inc": {
999
- "categories.$.click_count": 1
 
1000
  }
1001
  }
1002
  )
@@ -1006,8 +1008,11 @@ def sync_log_media_click(user_id_str: str, category_id_str: str):
1006
  _media_clicks_col.update_one(
1007
  { "userId": user_oid },
1008
  {
1009
- "$setOnInsert": { "createdAt": now },
1010
- "$set": { "updatedAt": now },
 
 
 
1011
  "$push": {
1012
  "categories": {
1013
  "categoryId": category_oid,
 
993
  {
994
  "$set": {
995
  "updatedAt": now,
996
+ "categories.$.lastClickedAt": now,
997
+ "ai_edit_last_date": now # 🔹 update date
998
  },
999
  "$inc": {
1000
+ "categories.$.click_count": 1,
1001
+ "ai_edit_complete": 1 # 🔹 increment counter
1002
  }
1003
  }
1004
  )
 
1008
  _media_clicks_col.update_one(
1009
  { "userId": user_oid },
1010
  {
1011
+ "$setOnInsert": { "createdAt": now,"ai_edit_complete": 0 },
1012
+ "$set": { "updatedAt": now,"ai_edit_last_date": now },
1013
+ "$inc": {
1014
+ "ai_edit_complete": 1 # 🔹 increment on use
1015
+ },
1016
  "$push": {
1017
  "categories": {
1018
  "categoryId": category_oid,