Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
37
Src/Plugins/Library/ml_wire/FeedUtil.cpp
Normal file
37
Src/Plugins/Library/ml_wire/FeedUtil.cpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
#include "main.h"
|
||||
#include "FeedUtil.h"
|
||||
#include "ChannelCheck.h"
|
||||
#include "FeedParse.h"
|
||||
#include "errors.h"
|
||||
#include "./defaults.h"
|
||||
|
||||
|
||||
int DownloadFeedInformation(Channel &newFeed)
|
||||
{
|
||||
ChannelCheck check;
|
||||
FeedParse downloader(&check, false);
|
||||
|
||||
int ret = downloader.DownloadURL(newFeed.url);
|
||||
if (ret != DOWNLOAD_SUCCESS)
|
||||
return ret;
|
||||
|
||||
if (!check.channel.title || !check.channel.title[0])
|
||||
return DOWNLOAD_NOTRSS;
|
||||
|
||||
newFeed.SetTitle(check.channel.title);
|
||||
if (check.channel.ttl)
|
||||
{
|
||||
newFeed.updateTime = check.channel.ttl * 60;
|
||||
newFeed.autoUpdate = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
newFeed.updateTime = ::updateTime;
|
||||
newFeed.autoUpdate = ::autoUpdate;
|
||||
}
|
||||
|
||||
if (check.channel.url && check.channel.url[0])
|
||||
newFeed.SetURL(check.channel.url);
|
||||
|
||||
return DOWNLOAD_SUCCESS;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue