changed to 80 max column
This commit is contained in:
@@ -20,8 +20,8 @@ Url getEmoteLink(const QJsonObject &urls, const QString &emoteScale)
|
||||
return {"https:" + emote.toString()};
|
||||
}
|
||||
|
||||
void fillInEmoteData(const QJsonObject &urls, const EmoteName &name, const QString &tooltip,
|
||||
Emote &emoteData)
|
||||
void fillInEmoteData(const QJsonObject &urls, const EmoteName &name,
|
||||
const QString &tooltip, Emote &emoteData)
|
||||
{
|
||||
auto url1x = getEmoteLink(urls, "1");
|
||||
auto url2x = getEmoteLink(urls, "2");
|
||||
@@ -30,7 +30,8 @@ void fillInEmoteData(const QJsonObject &urls, const EmoteName &name, const QStri
|
||||
//, code, tooltip
|
||||
emoteData.name = name;
|
||||
emoteData.images =
|
||||
ImageSet{Image::fromUrl(url1x, 1), Image::fromUrl(url2x, 0.5), Image::fromUrl(url3x, 0.25)};
|
||||
ImageSet{Image::fromUrl(url1x, 1), Image::fromUrl(url2x, 0.5),
|
||||
Image::fromUrl(url3x, 0.25)};
|
||||
emoteData.tooltip = {tooltip};
|
||||
}
|
||||
} // namespace
|
||||
@@ -67,8 +68,9 @@ void FfzEmotes::loadGlobalEmotes()
|
||||
NetworkRequest request(url);
|
||||
request.setCaller(QThread::currentThread());
|
||||
request.setTimeout(30000);
|
||||
request.onSuccess(
|
||||
[this](auto result) -> Outcome { return this->parseGlobalEmotes(result.parseJson()); });
|
||||
request.onSuccess([this](auto result) -> Outcome {
|
||||
return this->parseGlobalEmotes(result.parseJson());
|
||||
});
|
||||
|
||||
request.execute();
|
||||
}
|
||||
@@ -90,10 +92,12 @@ Outcome FfzEmotes::parseGlobalEmotes(const QJsonObject &jsonRoot)
|
||||
auto urls = jsonEmote.value("urls").toObject();
|
||||
|
||||
auto emote = Emote();
|
||||
fillInEmoteData(urls, name, name.string + "<br/>Global FFZ Emote", emote);
|
||||
emote.homePage = Url{QString("https://www.frankerfacez.com/emoticon/%1-%2")
|
||||
.arg(id.string)
|
||||
.arg(name.string)};
|
||||
fillInEmoteData(urls, name, name.string + "<br/>Global FFZ Emote",
|
||||
emote);
|
||||
emote.homePage =
|
||||
Url{QString("https://www.frankerfacez.com/emoticon/%1-%2")
|
||||
.arg(id.string)
|
||||
.arg(name.string)};
|
||||
|
||||
replacement.add(name, emote);
|
||||
}
|
||||
@@ -105,7 +109,8 @@ Outcome FfzEmotes::parseGlobalEmotes(const QJsonObject &jsonRoot)
|
||||
void FfzEmotes::loadChannelEmotes(const QString &channelName,
|
||||
std::function<void(EmoteMap &&)> callback)
|
||||
{
|
||||
// printf("[FFZEmotes] Reload FFZ Channel Emotes for channel %s\n", qPrintable(channelName));
|
||||
// printf("[FFZEmotes] Reload FFZ Channel Emotes for channel %s\n",
|
||||
// qPrintable(channelName));
|
||||
|
||||
// QString url("https://api.frankerfacez.com/v1/room/" + channelName);
|
||||
|
||||
@@ -145,10 +150,11 @@ Outcome parseChannelEmotes(const QJsonObject &jsonRoot)
|
||||
|
||||
// QJsonObject urls = emoteObject.value("urls").toObject();
|
||||
|
||||
// auto emote = this->channelEmoteCache_.getOrAdd(id, [id, &code, &urls] {
|
||||
// auto emote = this->channelEmoteCache_.getOrAdd(id, [id, &code,
|
||||
// &urls] {
|
||||
// EmoteData emoteData;
|
||||
// fillInEmoteData(urls, code, code + "<br/>Channel FFZ Emote", emoteData);
|
||||
// emoteData.pageLink =
|
||||
// fillInEmoteData(urls, code, code + "<br/>Channel FFZ Emote",
|
||||
// emoteData); emoteData.pageLink =
|
||||
// QString("https://www.frankerfacez.com/emoticon/%1-%2").arg(id).arg(code);
|
||||
|
||||
// return emoteData;
|
||||
|
||||
Reference in New Issue
Block a user