示例#1
0
        /// <summary>
        /// Creates manga.txt, then calls Load()
        /// </summary>
        /// <param name="mangaUrl"></param>
        public override void _Create(string mangaUrl)
        {
            id = mangaUrl;
            string title     = KissMangaHelper.GetName(mangaUrl);
            string lang_code = "gb"; // Not that it matters for KissManga

            FileHelper.CreateFolder(FileHelper.APP_ROOT, KissMangaHelper.GetUrlName(mangaUrl));

            MangaInfo info = new MangaInfo()
            {
                Type     = "manga",
                Source   = "kissmanga",
                Id       = KissMangaHelper.GetUrlName(mangaUrl),
                Name     = title,
                LangCode = lang_code,
                Group    = "^any-group",
                UserName = title,
                Chapter  = "1",
                Page     = "1",
                Latest   = "1"
            };

            string output = JsonConvert.SerializeObject(info);

            File.WriteAllText(Path.Combine(mangaRoot.FullName, "manga.json"), output);

            _Load(false);
            GetSetPrunedChapters(true);
        }
示例#2
0
        /// <summary>
        /// Creates manga.txt, then calls Load()
        /// </summary>
        /// <param name="mangaUrl"></param>
        public override void _Create(string mangaUrl)
        {
            FileHelper.CreateFolder(FileHelper.APP_ROOT, "h" + id);

            MangaInfo info = new MangaInfo()
            {
                Type     = "hentai",
                Source   = "nhentai",
                Id       = id,
                Name     = name,
                UserName = usertitle,
                Chapter  = "1",
                Page     = "1"
            };

            string output = JsonConvert.SerializeObject(info);

            File.WriteAllText(Path.Combine(hentaiRoot.FullName, "manga.json"), output);

            DirectoryInfo chapDir = FileHelper.CreateFolder(hentaiRoot, "1");

            chapters.Add(new Chapter(chapDir, id, "1", true));

            _Load();
        }
示例#3
0
        /// <summary>
        /// Creates manga.txt, then calls Load()
        /// </summary>
        /// <param name="mangaUrl"></param>
        public override void _Create(string mangaUrl)
        {
            id = mangaUrl;
            string jsonText = MangaDexHelper.GetMangaJSON(mangaUrl);

            JObject jobj  = JObject.Parse(jsonText);
            string  title = (string)jobj["manga"]["title"];

            string lang_code = "gb";

            FileHelper.CreateFolder(FileHelper.APP_ROOT, MangaDexHelper.GetMangaID(mangaUrl));

            MangaInfo info = new MangaInfo()
            {
                Type     = "manga",
                Source   = "mangadex",
                Id       = MangaDexHelper.GetMangaID(mangaUrl),
                Name     = title,
                LangCode = lang_code,
                Group    = "^any-group",
                UserName = title,
                Chapter  = "1",
                Page     = "1",
                Latest   = "1"
            };

            string output = JsonConvert.SerializeObject(info);

            File.WriteAllText(Path.Combine(mangaRoot.FullName, "manga.json"), output);

            _Load(false);
            GetSetPrunedChapters(true);
        }
示例#4
0
        /// <summary>
        /// Loads Manga info from manga.txt
        /// </summary>
        public override void _Load()
        {
            string    input = File.ReadAllText(FileHelper.GetFilePath(hentaiRoot, "manga.json"));
            MangaInfo info  = JsonConvert.DeserializeObject <MangaInfo>(input);

            id          = info.Id;
            name        = info.Name;
            usertitle   = info.UserName;
            currentpage = info.Page;

            _PopulateChapters();
        }
示例#5
0
        /// <summary>
        /// Loads Manga info from manga.txt
        /// </summary>
        public override void _Load(bool doChapters)
        {
            string    input = File.ReadAllText(FileHelper.GetFilePath(mangaRoot, "manga.json"));
            MangaInfo info  = JsonConvert.DeserializeObject <MangaInfo>(input);

            id             = info.Id;
            name           = info.Name;
            userlang       = info.LangCode;
            usergroup      = info.Group;
            usertitle      = info.UserName;
            currentchapter = info.Chapter;
            currentpage    = info.Page;
            lastchapter    = info.Latest;

            if (doChapters)
            {
                _PopulateChapters();
            }
        }
示例#6
0
        public static HentaiType GetSource(DirectoryInfo dir)
        {
            try
            {
                string    input = File.ReadAllText(FileHelper.GetFilePath(dir, "manga.json"));
                MangaInfo info  = JsonConvert.DeserializeObject <MangaInfo>(input);
                switch (info.Source)
                {
                case "nhentai":
                    return(HentaiType.NHENTAI);

                default:
                    return(HentaiType.NULL);
                }
            }
            catch (Exception)
            {
                return(HentaiType.NULL);
            }
        }
示例#7
0
        public override void Save(string chapter, string page)
        {
            this.currentchapter = chapter;
            this.currentpage    = page;

            MangaInfo info = new MangaInfo()
            {
                Type     = "hentai",
                Source   = "nhentai",
                Id       = hentaiRoot.Name,
                Name     = name,
                UserName = usertitle,
                Chapter  = chapter,
                Page     = page
            };

            string output = JsonConvert.SerializeObject(info);

            File.WriteAllText(Path.Combine(hentaiRoot.FullName, "manga.json"), output);
        }
示例#8
0
        public static MangaType GetSource(DirectoryInfo dir)
        {
            try
            {
                string    input = File.ReadAllText(FileHelper.GetFilePath(dir, "manga.json"));
                MangaInfo info  = JsonConvert.DeserializeObject <MangaInfo>(input);
                switch (info.Source)
                {
                case "mangadex":
                    return(MangaType.MANGADEX);

                case "kissmanga":
                    return(MangaType.KISSMANGA);

                default:
                    return(MangaType.NULL);
                }
            }
            catch (Exception)
            {
                return(MangaType.NULL);
            }
        }
示例#9
0
        public override void Save(string chapter, string page)
        {
            this.currentchapter = chapter;
            this.currentpage    = page;

            MangaInfo info = new MangaInfo()
            {
                Type     = "manga",
                Source   = "kissmanga",
                Id       = mangaRoot.Name,
                Name     = name,
                LangCode = userlang,
                Group    = usergroup,
                UserName = usertitle,
                Chapter  = chapter,
                Page     = page,
                Latest   = lastchapter
            };

            string output = JsonConvert.SerializeObject(info);

            File.WriteAllText(Path.Combine(mangaRoot.FullName, "manga.json"), output);
        }