public BaseComicIndexer(ComicViewerConfiguration config, IComicBookFactory factory) { this.extensions = new[] { "*.cbr", "*.cbz", "*.rar", "*.zip" }; this.path = new DirectoryInfo(config.ComicRepositoryPath); this.config = config; this.factory = factory; }
static void Main(string[] args) { Parser.Default.ParseArguments <IndexerArguments>(args) .WithParsed(o => { var config = new ComicViewerConfiguration() { ComicRepositoryPath = o.IndexPath, DatabasePath = o.Database, ThumbnailHeight = new System.Collections.Generic.Dictionary <string, int> { { "small", 80 }, { "large", 300 } } }; var context = new ComicBookContext(config, new Microsoft.EntityFrameworkCore.DbContextOptions <ComicBookContext>()); var imgProcessor = new ImageSharpProcessor(config); var factory = new ComicBookFactory(imgProcessor, new IComicInterigator[] { new IdInterigator(), new ImageInterigator(config, context, imgProcessor), new VolumeInterigator(), new IssueInterigator(), new DateInterigator(), new PublisherInterigator(), new NameInterigator(), new TitleInterigator() }); var resolver = new StoreComicBookResolver(config, context); Console.WriteLine("Starting Index"); var indexer = new StoreIndexer(config, factory, resolver).Run(); }) .WithNotParsed((errs) => { Console.WriteLine("Could not parse arguments"); }); #if DEBUG Console.WriteLine("Press any key to close."); Console.ReadKey(); #endif }
public ComicBookContext(ComicViewerConfiguration config, DbContextOptions <ComicBookContext> options) : base(options) { this.config = config; this.Database.EnsureCreated(); }
public ImageSharpProcessor(ComicViewerConfiguration config) { this.config = config; }
public StoreComicBookResolver(ComicViewerConfiguration config, ComicBookContext context) { this.config = config; this.context = context; }
public StoreIndexer(ComicViewerConfiguration config, IComicBookFactory factory, IComicBookResolver resolver) : base(config, factory) { this.config = config; this.resolver = resolver; }
public InMemoryIndexer(ComicViewerConfiguration config, IComicBookFactory factory) : base(config, factory) { this.Files = new Dictionary <string, ComicBookFile>(); }
public ImageInterigator(ComicViewerConfiguration config, ComicBookContext context, IImageProcessor processor) { this.config = config; this.context = context; this.processor = processor; }