1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-25 22:37:27 -04:00

Moved source code under src folder - massive change

This commit is contained in:
Mark McDowall
2013-10-02 18:01:32 -07:00
parent 2fc8123d6b
commit 5bf0e197ec
1499 changed files with 1054 additions and 1444 deletions
@@ -0,0 +1,47 @@
using System;
using System.Xml.Linq;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.Indexers
{
public class BasicTorrentRssParser : RssParserBase
{
protected override ReleaseInfo CreateNewReleaseInfo()
{
return new TorrentInfo();
}
protected override ReleaseInfo PostProcessor(XElement item, ReleaseInfo currentResult)
{
var torrentInfo = (TorrentInfo)currentResult;
torrentInfo.MagnetUrl = MagnetUrl(item);
torrentInfo.InfoHash = InfoHash(item);
return torrentInfo;
}
protected override long GetSize(XElement item)
{
var elementLength = GetTorrentElement(item).Element("contentLength");
return Convert.ToInt64(elementLength.Value);
}
protected virtual string MagnetUrl(XElement item)
{
var elementLength = GetTorrentElement(item).Element("magnetURI");
return elementLength.Value;
}
protected virtual string InfoHash(XElement item)
{
var elementLength = GetTorrentElement(item).Element("infoHash");
return elementLength.Value;
}
private static XElement GetTorrentElement(XElement item)
{
return item.Element("torrent");
}
}
}