Export media, updates and stream parts through media cluster.

This commit is contained in:
John Preston 2022-02-24 19:14:37 +03:00
parent 0c627e7ca0
commit 0be320a6c7
3 changed files with 10 additions and 2 deletions

View file

@ -62,6 +62,14 @@ inline constexpr bool isDownloadDcId(ShiftedDcId shiftedDcId) {
&& (shiftedDcId < details::downloadDcId(0, kMaxMediaDcCount - 1) + kDcShift);
}
inline constexpr bool isMediaClusterDcId(ShiftedDcId shiftedDcId) {
const auto shift = GetDcIdShift(shiftedDcId);
return isDownloadDcId(shiftedDcId)
|| (shift == kGroupCallStreamDcShift)
|| (shift == kExportMediaDcShift)
|| (shift == kUpdaterDcShift);
}
inline bool isCdnDc(MTPDdcOption::Flags flags) {
return (flags & MTPDdcOption::Flag::f_cdn);
}

View file

@ -604,7 +604,7 @@ DcType DcOptions::dcType(ShiftedDcId shiftedDcId) const {
return DcType::Cdn;
}
const auto dcId = BareDcId(shiftedDcId);
if (isDownloadDcId(shiftedDcId) && hasMediaOnlyOptionsFor(dcId)) {
if (isMediaClusterDcId(shiftedDcId) && hasMediaOnlyOptionsFor(dcId)) {
return DcType::MediaCluster;
}
return DcType::Regular;

View file

@ -223,7 +223,7 @@ void SessionPrivate::appendTestConnection(
});
});
const auto protocolForFiles = isDownloadDcId(_shiftedDcId)
const auto protocolForFiles = isMediaClusterDcId(_shiftedDcId)
//|| isUploadDcId(_shiftedDcId)
|| (_realDcType == DcType::Cdn);
const auto protocolDcId = getProtocolDcId();