Skip to content

Commit

Permalink
force document type for jpeg files
Browse files Browse the repository at this point in the history
  • Loading branch information
TheodoreKrypton committed Jun 3, 2024
1 parent 6acfef6 commit 44bb55b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/api/impl/gramjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export class GramJSApi implements ITDLibClient {
name: req.file.name,
}),
caption: req.caption,
forceDocument: true,
});
return {
messageId: rsp.id,
Expand All @@ -243,6 +244,7 @@ export class GramJSApi implements ITDLibClient {
md5Checksum: '',
}),
caption: req.caption,
forceDocument: true,
});
return {
messageId: rsp.id,
Expand Down
8 changes: 4 additions & 4 deletions src/server/webdav/tgfs-filesystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,15 @@ export class TGFSFileSystem extends VirtualFileSystem {

callback(null, stream);

if ( estimatedSize <= 0 ) {
if (estimatedSize <= 0) {
Logger.info('skip upload because file is 0 bytes');
return;
}

try {
// this.resources[path.toString()] = new TGFSFileResource({
// size: estimatedSize,
// });
this.resources[path.toString()] = new TGFSFileResource({
size: estimatedSize,
});

const fd = await uploadFromStream(tgClient)(
stream,
Expand Down

0 comments on commit 44bb55b

Please sign in to comment.