41 static QString
makeModuleValue(
const QString &type,
const QString &module) noexcept
72 QNetworkRequest request;
73 if(!module.
m_ua.isEmpty())
78 request.setUrl(module.
m_url);
91 QVariantMap value = json.
toVariant().toMap();
92 if(value[
"code"].toInt() == 0 || value[
"code"].toInt() == 200)
95 prop.
m_url = value[
"data"].toString();
102 prop.
m_url = value[
"url"].toString();
110 const QVariantMap &extra = value[
"extra"].toMap();
116 value = value[
"quality"].toMap();
123 value[
"result"].toString().contains(module.
m_quality, Qt::CaseInsensitive))
143 QNetworkRequest request;
144 if(!module.
m_ua.isEmpty())
148 request.setUrl(module.
m_url);
161 QVariantMap value = json.
toVariant().toMap();
162 if(value.contains(
"url"))
165 prop.
m_url = value[
"url"].toString();
183 if(file.open(QIODevice::ReadOnly))
185 TTK_INFO_STREAM(
"Load server unity plugins using local resource config");
186 bytes = file.readAll();
199 const QVariantList &datas = json.
toVariant().toList();
200 for(
const QVariant &var :
qAsConst(datas))
207 const QVariantMap &value = var.toMap();
208 const bool option = value[
"option"].toBool();
215 const QString &ua = value[
"ua"].toString();
216 const QString &
key = value[
"key"].toString();
218 for(
const QString &module : value.keys())
221 v.
m_url = value[module].toString();
222 if(v.
m_url.isEmpty())
229 if(server.isEmpty() || quality.isEmpty())
static QString makeQualityValue(const QString &type, int bitrate) noexcept
TTK_MODULE_EXPORT void setSslConfiguration(QNetworkRequest *request, QSslSocket::PeerVerifyMode mode=QSslSocket::VerifyNone) noexcept
QVariant toVariant() const
The class of the music song property.
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error=0)
static constexpr const char * QUERY_PLUGINS_URL
static constexpr const char * QUERY_KG_INTERFACE
static constexpr const char * QUERY_MODULE_B
static QString makeModuleValue(const QString &type, const QString &module) noexcept
TTK_MODULE_EXPORT QByteArray syncNetworkQueryForGet(QNetworkRequest *request)
#define APPCACHE_DIR_FULL
static constexpr const char * QUERY_WY_INTERFACE
#define TTK_INFO_STREAM(msg)
static constexpr wchar_t key[]
bool isEmpty() const noexcept
static constexpr const char * QUERY_MODULE_A
static constexpr const char * QUERY_KW_INTERFACE
static void parseSongPropertyB(TTK::MusicSongInformation *info, const ServerModule &module)
TTK_MODULE_EXPORT QString toString(Record type) noexcept
void parseFromSongProperty(TTK::MusicSongInformation *info, const QString &type, const QString &id, int bitrate)
#define TTK_ERROR_STREAM(msg)
static void parseSongPropertyA(TTK::MusicSongInformation *info, const ServerModule &module)
TTK_MODULE_EXPORT QString mdII(const QString &data, bool encode)