Example #1
0
        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;
        }
Example #2
0
        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
        }
Example #3
0
 public ComicBookContext(ComicViewerConfiguration config, DbContextOptions <ComicBookContext> options) : base(options)
 {
     this.config = config;
     this.Database.EnsureCreated();
 }
Example #4
0
 public ImageSharpProcessor(ComicViewerConfiguration config)
 {
     this.config = config;
 }
 public StoreComicBookResolver(ComicViewerConfiguration config, ComicBookContext context)
 {
     this.config  = config;
     this.context = context;
 }
Example #6
0
 public StoreIndexer(ComicViewerConfiguration config, IComicBookFactory factory, IComicBookResolver resolver) : base(config, factory)
 {
     this.config   = config;
     this.resolver = resolver;
 }
Example #7
0
 public InMemoryIndexer(ComicViewerConfiguration config, IComicBookFactory factory) : base(config, factory)
 {
     this.Files = new Dictionary <string, ComicBookFile>();
 }
Example #8
0
 public ImageInterigator(ComicViewerConfiguration config, ComicBookContext context,  IImageProcessor processor)
 {
     this.config = config;
     this.context = context;
     this.processor = processor;            
 }