Esempio n. 1
0
        public async Task Load(IDatabaseConnector databaseConnector, IFtpClient ftpClient, Directory moduleDirectory, IModuleLogger moduleLogger)
        {
            this.connectionString =
                await databaseConnector.GetDatabaseConnectionStringAsync(Guid.Parse(Id), DatabasePassword);

            this.cache        = new AnimeSearchCache(this.connectionString, new CrunchyrollApiService());
            this.GrpcServices = new[] { CrunchyrollService.BindService(new CrunchyRollImplementation(this.cache)), };
            Console.WriteLine("Loaded CR");
        }
Esempio n. 2
0
        public async Task Load(IDatabaseConnector databaseConnector, IFtpClient ftpClient, Directory moduleDirectory, IModuleLogger moduleLogger)
        {
            this.connectionString =
                await databaseConnector.GetDatabaseConnectionStringAsync(Guid.Parse(Id), DatabasePassword);

            this.moduleDirectory   = moduleDirectory;
            this.downloadDirectory = new Directory("Files", moduleDirectory);

            using (var context = this.GetContext())
            {
                await context.Database.EnsureCreatedAsync();
            }

            this.searchService   = new SearchService(moduleLogger.CreateSubLogger("Search-Service"));
            this.downloadService = new DownloadService("irc.rizon.net", 6667, this.GetContext, ftpClient, downloadDirectory, moduleLogger);

            this.GrpcServices = new[] { IrcAnimeService.BindService(new IrcAnimeImplementation(this.searchService, this.downloadService, this.GetContext, ftpClient, downloadDirectory, moduleLogger.CreateSubLogger("GRPC-Implementation"))), };

            moduleLogger.Log(NLog.LogLevel.Info, "IrcAnime loaded successfully");
        }