mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
parent
7a08a9e132
commit
96ec75fc7f
3 changed files with 24 additions and 0 deletions
|
|
@ -154,6 +154,19 @@ proc getShortTime*(tweet: Tweet): string =
|
|||
else:
|
||||
result = "now"
|
||||
|
||||
proc getDuration*(video: Video): string =
|
||||
let
|
||||
ms = video.durationMs
|
||||
sec = int(ms / 1000)
|
||||
min = int(sec / 60)
|
||||
hour = int(min / 60)
|
||||
if hour > 1:
|
||||
return &"{hour}:{min mod 60}:{sec mod 60:02}"
|
||||
elif min > 1:
|
||||
return &"{min mod 60}:{sec mod 60:02}"
|
||||
else:
|
||||
return &"0:{sec mod 60:02}"
|
||||
|
||||
proc getLink*(tweet: Tweet; focus=true): string =
|
||||
if tweet.id == 0: return
|
||||
var username = tweet.user.username
|
||||
|
|
|
|||
Loading…
Reference in a new issue