Skip to content

Commit df4625b

Browse files
committed
chore: add getFileById on download
1 parent 10ef101 commit df4625b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

TelegramDownloader/Data/FileService.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,11 @@ public async Task downloadFile(string dbName, List<FileManagerDirectoryContent>
715715
foreach (var itemFile in files)
716716
{
717717
var filterPath = itemFile.FilterPath == "Files/" ? "/" : itemFile.FilterPath;
718-
BsonFileManagerModel file = collectionId == null ? _db.getFileByPathSync(dbName, filterPath.Replace("\\", "/") + itemFile.Name) : _db.getFileByPathSync(dbName, filterPath.Replace("\\", "/") + itemFile.Name, collectionId);
718+
BsonFileManagerModel file = null;
719+
if (itemFile.Id != null)
720+
file = collectionId == null ? await _db.getFileById(dbName, itemFile.Id) : await _db.getFileById(dbName, itemFile.Id, collectionId);
721+
else
722+
file = collectionId == null ? _db.getFileByPathSync(dbName, filterPath.Replace("\\", "/") + itemFile.Name) : _db.getFileByPathSync(dbName, filterPath.Replace("\\", "/") + itemFile.Name, collectionId);
719723
string currentFilePath = currentTargetPath;
720724
if (!itemFile.IsFile)
721725
{

0 commit comments

Comments
 (0)