diff --git a/src/libdanbooru/danboorupost.cpp b/src/libdanbooru/danboorupost.cpp index c4b97f4..57559d1 100644 --- a/src/libdanbooru/danboorupost.cpp +++ b/src/libdanbooru/danboorupost.cpp @@ -59,11 +59,31 @@ DanbooruPost::DanbooruPost(QVariantMap postData, QPixmap pixmap, m_width = postData.value(QStringLiteral("width")).toString().toInt(); m_url = postData.value(QStringLiteral("file_url")).toUrl(); + + if (m_url.scheme().isEmpty()) { + // Konachan.com offers // for both http and https, but this + // just creates schemaless URLs + m_url.setScheme("http"); + } + m_thumbnailUrl = postData.value(QStringLiteral("preview_url")).toUrl(); + + if(m_thumbnailUrl.scheme().isEmpty()) { + // Konachan.com offers // for both http and https, but this + // just creates schemaless URLs + m_thumbnailUrl.setScheme("http"); + } + m_size = postData.value(QStringLiteral("file_size")).toInt(); m_rating = RATING_MAP.value(postData.value(QStringLiteral("rating")).toString()); m_sampleUrl = postData.value(QStringLiteral("sample_url")).toUrl(); + if (m_sampleUrl.scheme().isEmpty()) { + // Konachan.com offers // for both http and https, but this + // just creates schemaless URLs + m_sampleUrl.setScheme("http"); + } + } DanbooruPost::DanbooruPost(QXmlStreamAttributes &postData, QPixmap pixmap, QObject *parent):