Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AddNewTorrentViewModel"/> class.
        /// </summary>
        /// <param name="dialogService">The dialog service.</param>
        /// <param name="torrentService">The torrent service.</param>
        public AddNewTorrentViewModel(IDialogService dialogService, ITorrentService torrentService)
        {
            DisplayName = "Add new torrent";

            _dialogService  = dialogService;
            _torrentService = torrentService;
        }
Ejemplo n.º 2
0
        public void DelayedInitialize()
        {
            bus = Bus.Session;

            try {
                // Get the service and call a method on it to ensure that it is
                // running and able to answer queries.
                service = bus.GetObject <ITorrentService> (BusName, ServicePath);
                service.GetAvailableEngines();
            } catch {
                // Try one more time
                try {
                    service = bus.GetObject <ITorrentService> (BusName, ServicePath);
                    service.GetAvailableEngines();
                } catch {
                    Log.Error("Torrent backend could not be found and could not be auto-started");
                    service = null;
                    return;
                }
            }

            // Register with Migo so we can handle .torrent downloads
            if (!RegisteredInMigo)
            {
                Migo.DownloadCore.DownloadManager.Register("torrent", typeof(TorrentFileDownloadTask));
            }
            RegisteredInMigo = true;

            // Get the engine from DBus which we will use to download torrents with
            // and load the details for any existing downloads
            engine = bus.GetObject <IEngine> (BusName, service.GetEngine(EngineName));
            CheckExistingDownloads();
        }
Ejemplo n.º 3
0
 public CreateTorrentWidgetController(ITorrentService torrentService,
                                      ITaxonomyService taxonomyService,
                                      IModelStateValidatorService modelStateValidatorService)
 {
     _torrentService             = torrentService;
     _taxonomyService            = taxonomyService;
     _modelStateValidatorService = modelStateValidatorService;
 }
Ejemplo n.º 4
0
        private const int UntrackedDelayIntervalMiliseconds   = 126_000;    // 2.1 minutes.

        public DownloaderService(IReadOnlyCollection <IFeed> feeds, ILogger <DownloaderService> log,
                                 TorrentService torrentService, HistoryRepository historyRepo, ITorrentClient torrentClient)
        {
            _feeds          = feeds;
            _log            = log;
            _torrentService = torrentService;
            _historyRepo    = historyRepo;
            _torrentClient  = torrentClient;
        }
Ejemplo n.º 5
0
        public TorrentController()
        {
            this.dynamicModuleManagerProvider = new DynamicModuleManagerProvider();
            this.imageManagerProvider         = new ImageManagerProvider();
            this.torrentManagerProvider       = new TorrentManagerProvider();

            this.torrentService = new TorrentService();
            this.userService    = new UserService();
        }
Ejemplo n.º 6
0
 public static Task RelocateTorrentsAsync(this ITorrentService svc,
                                          IList <RelocateTorrentCommand> relocateTorrentCommands, bool verifyAfterMoving)
 {
     return(svc.RelocateTorrentsAsync(new RelocateTorrentsRequest
     {
         RelocateTorrentCommands = relocateTorrentCommands,
         VerifyAfterMoving = verifyAfterMoving
     }));
 }
Ejemplo n.º 7
0
 public void Dispose()
 {
     if (service != null)
     {
         try {
             service.DestroyEngine(EngineName);
         } catch {}
         service = null;
     }
 }
Ejemplo n.º 8
0
        public TorrentServiceTests()
        {
            var torrentRepository     = MockInitializer.GetTorrentRepository();
            var subcategoryRepository = MockInitializer.GetSubcategoryRepository();
            var fileStorageService    = MockInitializer.GetFileStorageService();
            var unitOfWork            = MockInitializer.GetUnitOfWork();

            _torrentService =
                new TorrentService(torrentRepository, subcategoryRepository, fileStorageService, unitOfWork);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dialogService">The dialog service.</param>
        /// <param name="torrentService">The torrent service.</param>
        /// <param name="messenger">The messenger.</param>
        /// <param name="serviceManager">The service manager.</param>
        public MainViewModel(IDialogService dialogService, ITorrentService torrentService, IMessageService messenger,
                             IServiceManager serviceManager)
        {
            DisplayName = "Torrentific.Gui";

            _dialogService  = dialogService;
            _torrentService = torrentService;
            _messenger      = messenger;
            _serviceManager = serviceManager;
        }
Ejemplo n.º 10
0
 public CheckNewResourcesBackgroundService(IRulesContainer rulesContainer,
                                           IResApi resApi, IDownloader downloader, ITorrentService torrentService,
                                           IConfiguration configuration,
                                           ILogger <CheckNewResourcesBackgroundService> logger)
 {
     _rulesContainer = rulesContainer;
     _resApi         = resApi;
     _downloader     = downloader;
     _torrentService = torrentService;
     _configuration  = configuration;
     _logger         = logger;
     _checkPeriod    = int.Parse(configuration["CheckPeriod"]);
 }
Ejemplo n.º 11
0
 public TorrentController(ITorrentService torrentService, IMapper mapper)
 {
     _torrentService = torrentService;
     _mapper         = mapper;
 }
Ejemplo n.º 12
0
 public HomeController(ITorrentService torrentService)
 {
     this.TorrentService = torrentService;
 }
Ejemplo n.º 13
0
 public TorrentsController(ITorrentService torrentService, IMapper mapper) : base(mapper)
 {
     _torrentService = torrentService;
 }
Ejemplo n.º 14
0
 public void Dispose ()
 {
     if (service != null) {
         try {
             service.DestroyEngine (EngineName);
         } catch {}
         service = null;
     }
 }
Ejemplo n.º 15
0
        public void DelayedInitialize ()
        {
            bus = Bus.Session;

            try {
                // Get the service and call a method on it to ensure that it is
                // running and able to answer queries.
                service = bus.GetObject<ITorrentService> (BusName, ServicePath);
                service.GetAvailableEngines ();
            } catch {
                // Try one more time
                try {
                    service = bus.GetObject<ITorrentService> (BusName, ServicePath);
                    service.GetAvailableEngines ();
                } catch {
                    Log.Error ("Torrent backend could not be found and could not be auto-started");
                    service = null;
                    return;
                }
            }

            // Register with Migo so we can handle .torrent downloads
            if (!RegisteredInMigo)
                Migo.DownloadCore.DownloadManager.Register ("torrent", typeof (TorrentFileDownloadTask));
            RegisteredInMigo = true;

            // Get the engine from DBus which we will use to download torrents with
            // and load the details for any existing downloads
            engine = bus.GetObject <IEngine> (BusName, service.GetEngine (EngineName));
            CheckExistingDownloads ();
        }
Ejemplo n.º 16
0
 public TorrentsController(ITorrentService torrentService)
 {
     this.torrentService = torrentService;
 }
Ejemplo n.º 17
0
 public TorrentController(ITorrentService torrentService)
 {
     this.torrentService = torrentService;
 }
        public MainWindowViewModel(IUnityContainer container, IEpisodeRepository episodeRepository, ITorrentService torrentService, IEventAggregator eventAggregator, IServerRepository serverRepository, ITvShowDatabase tvShowDatabaseService, ITvShowRepository tvShowRepository, IMessageService messageService, IInternetService internetService)
        {
            this._container             = container;
            this._episodeRepository     = episodeRepository;
            this._torrentService        = torrentService;
            this._eventAggregator       = eventAggregator;
            this._serverRepository      = serverRepository;
            this._tvShowDatabaseService = tvShowDatabaseService;
            this._tvShowRepository      = tvShowRepository;
            this._messageService        = messageService;
            this._internetService       = internetService;

            this.SearchCommand                  = new DelegateCommand <object>(this.Execute_Search);
            this.StartDownloadCommand           = new DelegateCommand <object>(this.Execute_StartDownloadCommand);
            this.LoadedCommand                  = new DelegateCommand <Episode>(this.Execute_LoadedCommand);
            this.ExitCommand                    = new DelegateCommand <object>(this.Execute_ExitCommand);
            this.UpdateCommand                  = new DelegateCommand <object>(this.Execute_UpdateCommand);
            this.MarkEpisodeAsDownloadedCommand = new DelegateCommand <object>(this.Execute_MarkEpisodeAsDownloadedCommand);
            this.DeleteEpisodeCommand           = new DelegateCommand <object>(this.Execute_DeleteEpisodeCommand);
            this.GroupByCommand                 = new DelegateCommand <string>(this.Execute_GroupByCommand);
            this.EditEpisodeCommand             = new DelegateCommand <EpisodeDTO>(this.Execute_EditEpisodeCommand);
            this.SearchFilesCommand             = new DelegateCommand <object>(this.Execute_SearchFilesCommand);
            this.Episodes = new ObservableCollection <EpisodeDTO>();
            this.InitializeEpisodesViewSource();

            this.SearchAndDownloadButtonLabel = "Search Torrents";
            this.SearchAndDownloadButtonImage = "/images/TorrentIcon128x128.png";
        }
Ejemplo n.º 19
0
 public static Task <List <RelocatableTorrentCandidate> > FindRelocatableTorrentCandidatesAsync(this ITorrentService svc, IEnumerable <string> pathsToScan, IEnumerable <int> torrentIds)
 {
     return(svc.FindRelocatableTorrentCandidatesAsync(new MapTorrentsToDiskRequest
     {
         PathsToScan = pathsToScan,
         TorrentIds = torrentIds
     }));
 }
Ejemplo n.º 20
0
 public TorrentRepository(IDataService dataService, ITorrentService torrentService)
 {
     this.DataService    = dataService;
     this.TorrentService = torrentService;
 }
Ejemplo n.º 21
0
 public TorrentsController(ITorrentService service)
 {
     _torrentService = service;
 }