public StandardXmlMediaHandler(XElement handlerElement)
        {
            try
            {
                Name              = handlerElement.Element("Name").Value;
                ContentDirectory  = handlerElement.Element("ContentDirectory").Value;
                SearchDirectories = new List <string>();

                //TODO: this one is volatile, make it safer
                var searchDirectoriesElement = handlerElement.Element("SearchDirectories");

                if (searchDirectoriesElement != null)
                {
                    SearchDirectories =
                        searchDirectoriesElement
                        .Elements("SearchDirectory")
                        .Select(element => element.Value).ToList();
                }
                else
                {
                    SearchDirectories = new List <string>();
                    Logging.Log.WarnFormat("No directores found for {0}", Name);
                }

                //TODO: volatile code, can easily crash. fix it
                FileActions    = new WindowsFileActions();
                ContentMatcher = HandlerXmlParser.ParseContentMatches(handlerElement.Element("MatchPatterns")).FirstOrDefault();
            }
            catch (Exception ex)
            {
                Logging.Log.Error("Failure loading showhandler", ex);
                throw;
            }
        }
        public StandardXmlMediaHandler(string name, List <string> searchDirectories, IContentMatcher contentMatcher)
        {
            ContentMatcher    = contentMatcher;
            SearchDirectories = searchDirectories;
            Name        = name;
            FileActions = new WindowsFileActions();

            Initialize();
        }
Exemplo n.º 3
0
 public RssDownloader(RssFeed feed, string name, string torrentApplication, IContentMatcher contentMatcher) : this(name, torrentApplication, contentMatcher)
 {
     _feed = feed;
 }
Exemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name"></param>
 /// <param name="torrentApplication">Full path of the .exe to run for torrents</param>
 /// <param name="feedLink">Link to the rss feed</param>
 /// <param name="contentMatcher"></param>
 public RssDownloader(string name, string torrentApplication, string feedLink, IContentMatcher contentMatcher) : this(name, torrentApplication, contentMatcher)
 {
     FeedLink = feedLink;
 }
Exemplo n.º 5
0
 private RssDownloader(string name, string torrentApplication, IContentMatcher contentMatcher)
 {
     Name = name;
     TorrentApplication = torrentApplication;
     ContentMatcher     = contentMatcher;
 }