From c708bcd57f79f2bab47c8531ae90aeb1cc38fa58 Mon Sep 17 00:00:00 2001 From: Elia Doumerc Date: Fri, 21 Jun 2024 10:53:29 +0200 Subject: [PATCH 1/3] even more broken video send --- .squot-materialize | 11 +++++++++-- assets/default-video-thumbnail.png | Bin 0 -> 3343 bytes .../class/newSendDocumentMessage.to..st | 2 ++ .../TCCRequest.class/methodProperties.json | 2 +- .../TCCVideoMessage.class/class/newFrom..st | 7 +++++++ .../TCCVideoMessage.class/methodProperties.json | 2 +- .../TCCVideoStore.class/class/newWith..st | 7 +++++++ .../TCCVideoStore.class/methodProperties.json | 3 ++- 8 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 assets/default-video-thumbnail.png create mode 100644 packages/TelegramClient-Core.package/TCCVideoStore.class/class/newWith..st diff --git a/.squot-materialize b/.squot-materialize index 1ba7c640..d10b673c 100644 --- a/.squot-materialize +++ b/.squot-materialize @@ -20,6 +20,13 @@ ], #encoding : 'TXT' }, + SquotImageMapper { + #path : FSAbsolutePath [ + 'assets', + 'default-video-thumbnail.png' + ], + #encoding : Class [ #PNGReadWriter ] + }, SquotPlaintextMapper { #path : FSAbsolutePath [ '.gitignore' @@ -117,7 +124,7 @@ 'assets', 'logo.png' ], - #encoding : Class [ #PNGReadWriter ] + #encoding : @10 }, SquotCypressMapper { #package : MCPackage { @@ -182,6 +189,6 @@ 'assets', 'play_circle_outline_icon.png' ], - #encoding : @40 + #encoding : @10 } ] \ No newline at end of file diff --git a/assets/default-video-thumbnail.png b/assets/default-video-thumbnail.png new file mode 100644 index 0000000000000000000000000000000000000000..97d5c9c1b0ed22b5630546d47270e9572b2e2f17 GIT binary patch literal 3343 zcmeHJZA?>F7%ssdgvdx7%s`xE&cRwlGJ`^JP;q5S`CNNJCg{~MoZ86Obkd2CIi?wt zu_*6fC#2e3f!rssz_EYN1GXPT9|yWm!h{;r;XEp7*)$ z^S;k}?>YC=gt%R9uHLRR8qFs5@N7OyU2m`}^ezMQ>l9OfK&k9PB5_0i{wgFwm#d zjcc`|lat!fQH|YhhsmE^&m8y{Ibc<%WWo=FcAOK(g)i{``pTc1`j$p>kwmc~u-yIB zh$cf5;<4i`MN#I7jdz=G+U-JJbwEW>#_6ssS2{1uD*MPKTetg5rxW3X+%P+z_aB9Q zE8N+`(7)SG-wgpTT-^RmX}D!B(kvG>n8Yzp+H;z&mdPyLV$s-iiAeT9!EBP;5Kbqx zUn0yuq?Wv=VpqAzsX{tgd|Q4h}`x9{GQ$ULX%hK6sf5Q6}tv z$E$o!cwT3mZl2&_(%COMqq;R#(G&bOBYmCEB9<3h)qOwu){VwZ>X}ToiEC=gxs*pI zlh_uUh6BUJXQiZ9=@xw&o>D{v(ovXiySjUDVV64;9Zc;hLmH2pS3t*9KMwWhBtS_cNl8c zF#aT%2XG`m4+>H7^I$Q{(5c90gfj(eFK=%vwxBiEa_Be4)4>GpAf^$lLMgR?gUTFt?rD|?Mh7yY3rnIhZ4xqDaoBzN^n$+Xz##g;(Kyyu%GBILn2P%>$Tk z5ret&8Bm8Hp!Pq6g6~LY=t8c!Gd*$VrMP-t!s(}>7FW6umSeb@JTe)y4!x5 z(cSfV+txkk3%e^l=nKxvzkadc8WhAYVv?SXf;6AhzSblZt~6wSf1z37W*4LANIVN_t?H&N zaiL|m+e&9Fd*mC=U4f;HY*iKdu=Lr=@=Oa+zj}V0!14B^1?or-|LBjYC9k?aYynxv zC}YdjyinU49ptvMPNg>2+n2hD2c85uqMBKK$T~8gF44m+EobzK-@7M`t&s~qo!M-N zHb`wAz{LFKKL<0H=jf#w8 JiFY12^DEU7!4d!f literal 0 HcmV?d00001 diff --git a/packages/TelegramClient-Core.package/TCCRequest.class/class/newSendDocumentMessage.to..st b/packages/TelegramClient-Core.package/TCCRequest.class/class/newSendDocumentMessage.to..st index 182f956a..e8998bf9 100644 --- a/packages/TelegramClient-Core.package/TCCRequest.class/class/newSendDocumentMessage.to..st +++ b/packages/TelegramClient-Core.package/TCCRequest.class/class/newSendDocumentMessage.to..st @@ -1,5 +1,7 @@ instance creation newSendDocumentMessage: aDocumentPath to: aChatId + Transcript show: aDocumentPath. + self halt. ^ TCCRequest newWithType: 'sendMessage' diff --git a/packages/TelegramClient-Core.package/TCCRequest.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCRequest.class/methodProperties.json index 2db6c5b9..be4ea72b 100644 --- a/packages/TelegramClient-Core.package/TCCRequest.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCRequest.class/methodProperties.json @@ -16,7 +16,7 @@ "newRequestFile:" : "JB 8/1/2021 11:35", "newRequestSticker:" : "JK 5/16/2024 21:39", "newSearchChatFrom:" : "RS 6/23/2021 16:38", - "newSendDocumentMessage:to:" : "ED 6/19/2024 13:52", + "newSendDocumentMessage:to:" : "ED 6/19/2024 14:36", "newSendFileMessage:to:" : "ED 6/19/2024 13:51", "newSendMessage:to:" : "6/7/2024 09:02:10", "newSendMessage:to:asReplyTo:" : "JS 5/20/2022 10:02", diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/class/newFrom..st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/class/newFrom..st index 6738d4a0..2a1fe867 100644 --- a/packages/TelegramClient-Core.package/TCCVideoMessage.class/class/newFrom..st +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/class/newFrom..st @@ -3,6 +3,13 @@ newFrom: aJsonObject | thumbnailData | thumbnailData := ((aJsonObject at: 'video') at: 'thumbnail'). + "thumbnailData = nil ifTrue: [ + thumbnailData := Dictionary new + add: 'width' -> 810; + add: 'height' -> 452; + yourself. + thumbnailData add: ('file' -> (Dictionary new add: 'id' -> -1)) + ]." ^ self new caption: ((aJsonObject at: 'caption') at: 'text'); diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json index 97f21586..08b656e6 100644 --- a/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json @@ -1,6 +1,6 @@ { "class" : { - "newFrom:" : "JK 6/12/2024 11:28" }, + "newFrom:" : "ED 6/21/2024 10:49" }, "instance" : { "asSnippet" : "JK 6/12/2024 11:31", "asText" : "TR 6/20/2021 10:41", diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/class/newWith..st b/packages/TelegramClient-Core.package/TCCVideoStore.class/class/newWith..st new file mode 100644 index 00000000..0e163606 --- /dev/null +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/class/newWith..st @@ -0,0 +1,7 @@ +utility +newWith: aCore + + |obj| + obj := super newWith: aCore. + obj add: (Association key: -1 value: '/assets/default_video_thumbnail.png'). + ^ obj \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json index 18a5f48f..b34901b4 100644 --- a/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json @@ -1,7 +1,8 @@ { "class" : { "extractPathFrom:" : "pk 6/19/2021 16:23", - "imageFormFrom:" : "pk 8/5/2021 16:52" }, + "imageFormFrom:" : "pk 8/5/2021 16:52", + "newWith:" : "ED 6/21/2024 09:15" }, "instance" : { "getFormFor:" : "JK 6/12/2024 19:28", "getFormPromiseFor:" : "JK 6/12/2024 19:30", From ef6f604b062ad770ab9ea110ad81456bfbc10e86 Mon Sep 17 00:00:00 2001 From: Elia Doumerc Date: Wed, 26 Jun 2024 12:26:08 +0200 Subject: [PATCH 2/3] going from one error to the next --- .squot-materialize | 18 +++++++++--------- ...mbnail.png => default_video_thumbnail.png} | Bin 3343 -> 3343 bytes .../TCCVideoMessage.class/class/newFrom..st | 14 +++++++------- .../methodProperties.json | 2 +- .../TCCVideoStore.class/class/newWith..st | 6 ++++-- .../TCCVideoStore.class/methodProperties.json | 2 +- 6 files changed, 22 insertions(+), 20 deletions(-) rename assets/{default-video-thumbnail.png => default_video_thumbnail.png} (96%) diff --git a/.squot-materialize b/.squot-materialize index d10b673c..cf07ad7a 100644 --- a/.squot-materialize +++ b/.squot-materialize @@ -20,13 +20,6 @@ ], #encoding : 'TXT' }, - SquotImageMapper { - #path : FSAbsolutePath [ - 'assets', - 'default-video-thumbnail.png' - ], - #encoding : Class [ #PNGReadWriter ] - }, SquotPlaintextMapper { #path : FSAbsolutePath [ '.gitignore' @@ -124,7 +117,7 @@ 'assets', 'logo.png' ], - #encoding : @10 + #encoding : Class [ #PNGReadWriter ] }, SquotCypressMapper { #package : MCPackage { @@ -140,6 +133,13 @@ ], #encoding : 'TXT' }, + SquotImageMapper { + #path : FSAbsolutePath [ + 'assets', + 'default_video_thumbnail.png' + ], + #encoding : @40 + }, SquotPlaintextMapper { #path : FSAbsolutePath [ 'scripts', @@ -189,6 +189,6 @@ 'assets', 'play_circle_outline_icon.png' ], - #encoding : @10 + #encoding : @40 } ] \ No newline at end of file diff --git a/assets/default-video-thumbnail.png b/assets/default_video_thumbnail.png similarity index 96% rename from assets/default-video-thumbnail.png rename to assets/default_video_thumbnail.png index 97d5c9c1b0ed22b5630546d47270e9572b2e2f17..55f6c8b9ce96afc68a85a0a159c763de4649ccef 100644 GIT binary patch delta 45 zcmV+|0Mh@D8jl)~P#DqC&d|`!&(F-x&db);(bw0~)z#3_($BGI!2$#)idN&ZEd$~S DlVBTr delta 45 zcmV+|0Mh@D8jl)~P#DtE&(YD&(9q4#&&<}=(%0A1)z#6{)6lVK!2$&M+FNh4Ed$~S DoS7Uy diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/class/newFrom..st b/packages/TelegramClient-Core.package/TCCVideoMessage.class/class/newFrom..st index 2a1fe867..30f1307c 100644 --- a/packages/TelegramClient-Core.package/TCCVideoMessage.class/class/newFrom..st +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/class/newFrom..st @@ -3,13 +3,13 @@ newFrom: aJsonObject | thumbnailData | thumbnailData := ((aJsonObject at: 'video') at: 'thumbnail'). - "thumbnailData = nil ifTrue: [ - thumbnailData := Dictionary new - add: 'width' -> 810; - add: 'height' -> 452; - yourself. - thumbnailData add: ('file' -> (Dictionary new add: 'id' -> -1)) - ]." + thumbnailData = nil ifTrue: [ + thumbnailData := JsonObject newFrom: { + 'width' -> 810. + 'height' -> 452. + 'file' -> (JsonObject newFrom: {'id' -> -1}). + }. + ]. ^ self new caption: ((aJsonObject at: 'caption') at: 'text'); diff --git a/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json index 08b656e6..4c791d1c 100644 --- a/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCVideoMessage.class/methodProperties.json @@ -1,6 +1,6 @@ { "class" : { - "newFrom:" : "ED 6/21/2024 10:49" }, + "newFrom:" : "ED 6/26/2024 11:56" }, "instance" : { "asSnippet" : "JK 6/12/2024 11:31", "asText" : "TR 6/20/2021 10:41", diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/class/newWith..st b/packages/TelegramClient-Core.package/TCCVideoStore.class/class/newWith..st index 0e163606..59677bf2 100644 --- a/packages/TelegramClient-Core.package/TCCVideoStore.class/class/newWith..st +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/class/newWith..st @@ -2,6 +2,8 @@ utility newWith: aCore |obj| + "self halt." obj := super newWith: aCore. - obj add: (Association key: -1 value: '/assets/default_video_thumbnail.png'). - ^ obj \ No newline at end of file +" obj add: (Association key: -1 value: (Promise new initializeWithResolvedValue: ((GitAssetLoader for: 'TelegramClient') +'/assets/default_video_thumbnail.png')). +" ^ obj \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json index b34901b4..0b7d7a2a 100644 --- a/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json @@ -2,7 +2,7 @@ "class" : { "extractPathFrom:" : "pk 6/19/2021 16:23", "imageFormFrom:" : "pk 8/5/2021 16:52", - "newWith:" : "ED 6/21/2024 09:15" }, + "newWith:" : "ED 6/26/2024 12:24" }, "instance" : { "getFormFor:" : "JK 6/12/2024 19:28", "getFormPromiseFor:" : "JK 6/12/2024 19:30", From 9739c9d9a8f5bab4b3debd361a6b84de185535ec Mon Sep 17 00:00:00 2001 From: Elia Doumerc Date: Wed, 26 Jun 2024 14:56:24 +0200 Subject: [PATCH 3/3] Send videos. If video is not loaded in time, show thumbnail instead --- .../TCCVideoStore.class/class/newWith..st | 12 ++++++++---- .../TCCVideoStore.class/methodProperties.json | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/class/newWith..st b/packages/TelegramClient-Core.package/TCCVideoStore.class/class/newWith..st index 59677bf2..3a04884f 100644 --- a/packages/TelegramClient-Core.package/TCCVideoStore.class/class/newWith..st +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/class/newWith..st @@ -2,8 +2,12 @@ utility newWith: aCore |obj| - "self halt." obj := super newWith: aCore. -" obj add: (Association key: -1 value: (Promise new initializeWithResolvedValue: ((GitAssetLoader for: 'TelegramClient') -'/assets/default_video_thumbnail.png')). -" ^ obj \ No newline at end of file + + ((FileDirectory default / 'tdlib' / 'thumbnails') fileExists: 'default_video_thumbnail.png') ifFalse: [ + ((GitAssetLoader for: 'TelegramClient') loadForm: '/assets/default_video_thumbnail.png') writePNGfileNamed: ((FileDirectory default / 'tdlib' / 'thumbnails' / 'default_video_thumbnail.png') fullName). + ]. + + obj add: (Association key: -1 value: (Promise new initializeWithResolvedValue: ((FileDirectory default / 'tdlib' / 'thumbnails' / 'default_video_thumbnail.png') fullName))). + + ^ obj \ No newline at end of file diff --git a/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json b/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json index 0b7d7a2a..d1c9f45b 100644 --- a/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json +++ b/packages/TelegramClient-Core.package/TCCVideoStore.class/methodProperties.json @@ -2,7 +2,7 @@ "class" : { "extractPathFrom:" : "pk 6/19/2021 16:23", "imageFormFrom:" : "pk 8/5/2021 16:52", - "newWith:" : "ED 6/26/2024 12:24" }, + "newWith:" : "ED 6/26/2024 14:50" }, "instance" : { "getFormFor:" : "JK 6/12/2024 19:28", "getFormPromiseFor:" : "JK 6/12/2024 19:30",