/// <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); }
/// <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(); }
/// <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); }
/// <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(); }
/// <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(); } }
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); } }
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); }
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); } }
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); }