mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02:00
Export media, updates and stream parts through media cluster.
This commit is contained in:
parent
0c627e7ca0
commit
0be320a6c7
3 changed files with 10 additions and 2 deletions
|
@ -62,6 +62,14 @@ inline constexpr bool isDownloadDcId(ShiftedDcId shiftedDcId) {
|
||||||
&& (shiftedDcId < details::downloadDcId(0, kMaxMediaDcCount - 1) + kDcShift);
|
&& (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) {
|
inline bool isCdnDc(MTPDdcOption::Flags flags) {
|
||||||
return (flags & MTPDdcOption::Flag::f_cdn);
|
return (flags & MTPDdcOption::Flag::f_cdn);
|
||||||
}
|
}
|
||||||
|
|
|
@ -604,7 +604,7 @@ DcType DcOptions::dcType(ShiftedDcId shiftedDcId) const {
|
||||||
return DcType::Cdn;
|
return DcType::Cdn;
|
||||||
}
|
}
|
||||||
const auto dcId = BareDcId(shiftedDcId);
|
const auto dcId = BareDcId(shiftedDcId);
|
||||||
if (isDownloadDcId(shiftedDcId) && hasMediaOnlyOptionsFor(dcId)) {
|
if (isMediaClusterDcId(shiftedDcId) && hasMediaOnlyOptionsFor(dcId)) {
|
||||||
return DcType::MediaCluster;
|
return DcType::MediaCluster;
|
||||||
}
|
}
|
||||||
return DcType::Regular;
|
return DcType::Regular;
|
||||||
|
|
|
@ -223,7 +223,7 @@ void SessionPrivate::appendTestConnection(
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const auto protocolForFiles = isDownloadDcId(_shiftedDcId)
|
const auto protocolForFiles = isMediaClusterDcId(_shiftedDcId)
|
||||||
//|| isUploadDcId(_shiftedDcId)
|
//|| isUploadDcId(_shiftedDcId)
|
||||||
|| (_realDcType == DcType::Cdn);
|
|| (_realDcType == DcType::Cdn);
|
||||||
const auto protocolDcId = getProtocolDcId();
|
const auto protocolDcId = getProtocolDcId();
|
||||||
|
|
Loading…
Add table
Reference in a new issue