2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Allow variable count of download sessions.

This commit is contained in:
John Preston
2019-12-04 09:51:21 +03:00
parent cb2c6e4b89
commit 3ae2986c25
11 changed files with 32 additions and 25 deletions

View File

@@ -41,7 +41,7 @@ public:
[[nodiscard]] virtual MTP::DcId dcId() const = 0;
[[nodiscard]] virtual bool readyToRequest() const = 0;
[[nodiscard]] virtual void loadPart(int dcIndex) = 0;
virtual void loadPart(int dcIndex) = 0;
};
@@ -91,8 +91,7 @@ private:
base::Observable<void> _taskFinishedObservable;
using RequestedInDc = std::array<int64, MTP::kDownloadSessionsCount>;
base::flat_map<MTP::DcId, RequestedInDc> _requestedBytesAmount;
base::flat_map<MTP::DcId, std::vector<int>> _requestedBytesAmount;
base::flat_map<MTP::DcId, crl::time> _killDownloadSessionTimes;
base::Timer _killDownloadSessionsTimer;