public static List <Manga> getFavAndPopulateLB() { String[] lines = Outils.readTxtFile(Program._followedManga); List <Manga> mFollowedLst = new List <Manga>(); foreach (String l in lines) { String site = l.Substring(0, 1); String url = Outils.searchSite(site).ToString(); String[] s = l.Substring(1).Split(new[] { Program._separator }, StringSplitOptions.RemoveEmptyEntries); int.TryParse(s[2], out int nbrHigherChap); url += s[0]; Manga m = new Manga(new Uri(url)); m.MangaPath = s[1]; m.HigherChap = nbrHigherChap; mFollowedLst.Add(m); } return(mFollowedLst); }
public static List <Manga> updFavPath() { String[] lines = Outils.readTxtFile(Program._followedManga); List <Manga> mFollowedLst = new List <Manga>(); for (int i = 0; i < lines.Length; i++) { String site = lines[i].Substring(0, 1); String[] s = lines[i].Substring(1).Split(new[] { Program._separator }, StringSplitOptions.RemoveEmptyEntries); Manga m = new Manga(new Uri(s[0])); String number = s[2]; int.TryParse(number, out int nbrHigherChap); s[1] = m.MangaPath; m.HigherChap = nbrHigherChap; mFollowedLst.Add(m); Outils.reencodeSite(m.MangaUrl); lines[i] = m.MangaUrl.ToString() + Program._separator + m.MangaPath + Program._separator + number; } File.WriteAllLines(Program._followedManga, lines); return(mFollowedLst); }