Browse Source

print message now display media trace

feature/find_holes
Figg 9 months ago
parent
commit
2199dd99cb
1 changed files with 13 additions and 1 deletions
  1. 13
    1
      million/model/message.py

+ 13
- 1
million/model/message.py View File

57
 
57
 
58
     def __str__(self) -> str:
58
     def __str__(self) -> str:
59
         dt_str = self.date_time.strftime("%d/%m/%Y, %H:%M:%S")
59
         dt_str = self.date_time.strftime("%d/%m/%Y, %H:%M:%S")
60
-        return f"{self.sender_name}({dt_str}) : {self.content}"
60
+
61
+        msg_str = f"{self.sender_name}({dt_str})"
62
+
63
+        if self.content:
64
+            msg_str += " : " + self.content
65
+        if self.photos:
66
+            msg_str += f" [PHOTOS {len(self.photos)}]"
67
+        if self.videos:
68
+            msg_str += f" [VIDEOS {len(self.videos)}]"
69
+        if self.gifs:
70
+            msg_str += f" [GIFS {len(self.gifs)}]"
71
+
72
+        return msg_str
61
 
73
 
62
     def __hash__(self) -> int:
74
     def __hash__(self) -> int:
63
         return hash(self.item_id)
75
         return hash(self.item_id)

Loading…
Cancel
Save