Better img extracting from feed content
This commit is contained in:
parent
31f13602d9
commit
825fd9388b
3 changed files with 6 additions and 3 deletions
|
|
@ -1615,7 +1615,8 @@ int NvFetcher::storeFeeds()
|
|||
QRegExp rx("<img\\s[^>]*src\\s*=\\s*(\"[^\"]*\"|'[^']*')", Qt::CaseInsensitive);
|
||||
if (rx.indexIn(e.content)!=-1) {
|
||||
QString imgSrc = rx.cap(1); imgSrc = imgSrc.mid(1,imgSrc.length()-2);
|
||||
if (imgSrc!="") {
|
||||
if (!imgSrc.isEmpty()) {
|
||||
imgSrc.replace("&","&", Qt::CaseInsensitive);
|
||||
if (!s->db->isCacheExistsByFinalUrl(Utils::hash(imgSrc))) {
|
||||
DatabaseManager::CacheItem item;
|
||||
item.origUrl = imgSrc;
|
||||
|
|
|
|||
|
|
@ -1454,7 +1454,8 @@ void OldReaderFetcher::storeStream()
|
|||
QRegExp rx("<img\\s[^>]*src\\s*=\\s*(\"[^\"]*\"|'[^']*')", Qt::CaseInsensitive);
|
||||
if (rx.indexIn(e.content)!=-1) {
|
||||
QString imgSrc = rx.cap(1); imgSrc = imgSrc.mid(1,imgSrc.length()-2);
|
||||
if (imgSrc!="") {
|
||||
if (!imgSrc.isEmpty()) {
|
||||
imgSrc.replace("&","&", Qt::CaseInsensitive);
|
||||
if (s->getCachingMode() == 2 || (s->getCachingMode() == 1 && s->dm->isWLANConnected())) {
|
||||
if (!s->db->isCacheExistsByFinalUrl(Utils::hash(imgSrc))) {
|
||||
DatabaseManager::CacheItem item;
|
||||
|
|
|
|||
|
|
@ -452,7 +452,8 @@ void TTRssFetcher::storeStream()
|
|||
QRegExp rx("<img\\s[^>]*src\\s*=\\s*(\"[^\"]*\"|'[^']*')", Qt::CaseInsensitive);
|
||||
if (rx.indexIn(e.content)!=-1) {
|
||||
QString imgSrc = rx.cap(1); imgSrc = imgSrc.mid(1,imgSrc.length()-2);
|
||||
if (imgSrc!="") {
|
||||
if (!imgSrc.isEmpty()) {
|
||||
imgSrc.replace("&","&", Qt::CaseInsensitive);
|
||||
if (s->getCachingMode() == 2 || (s->getCachingMode() == 1 && s->dm->isWLANConnected())) {
|
||||
if (!s->db->isCacheExistsByFinalUrl(Utils::hash(imgSrc))) {
|
||||
DatabaseManager::CacheItem item;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue