public void parserAnimeFromFile(string anime) { char[] delim = { '#' }; string[] animeInfo = anime.Split(delim); string title = animeInfo[0]; string[] tmpFansub = animeInfo[1].Split(','); List <string> fansub = arrayToList(tmpFansub); int episode = Convert.ToInt32(animeInfo[2]); string[] tmpSub = animeInfo[3].Split(','); List <string> sub = arrayToList(tmpSub); string[] tmpDub = animeInfo[4].Split(','); List <string> dub = arrayToList(tmpDub); string[] tmpSource = animeInfo[5].Split(','); List <string> source = arrayToList(tmpSource); string description = animeInfo[6]; string img = animeInfo[7]; string[] mediaFiles = animeInfo[8].Split(','); if (!animeList.checkIfAnimeIsAlreadyInTheList(title)) { animeList.addAnimeToList(title, episode, description, fansub, source, sub, dub, img, mediaFiles); } }
public void createAnimeObject(string path, string title) { int episodes = AmountOfEpisodes.getSumOfEpisodes(path); string img = PathOfImage.getPathOfImage(path); string[] mediaFiles = PathOfEpisode.getPathOfEpisode(path); string folder = RemoveFullPathFromFolder.getFolder(path); string description = Description.readFromFile(Description.getDescription(path)); char[] split = { '[', ']', '(', ')' }; string[] animeInfo = folder.Split(split); title = title.Replace("_", " "); List <string> sourceList = new List <string>(); List <string> voiceList = new List <string>(); List <string> subList = new List <string>(); List <string> fansubList = new List <string>(); if (animeInfo.Length == 1) { } else if (animeInfo.Length == 2 || animeInfo.Length == 3) { sourceList.Add(animeInfo[1]); } else if (animeInfo.Length == 4 || animeInfo.Length == 5) { sourceList.Add(animeInfo[1]); voiceList.Add(animeInfo[3]); } else if (animeInfo.Length == 7) { sourceList.Add(animeInfo[1]); voiceList.Add(animeInfo[3]); subList.Add(animeInfo[5]); } if (title.First() == ' ') //Check if the first character is a space then remove it { title = title.Substring(1, title.Count() - 1); } if (!instance.checkIfAnimeIsAlreadyInTheList(title)) { instance.addAnimeToList(title, episodes, description, fansubList, sourceList, subList, voiceList, img, mediaFiles); } else { instance.addSourceToAnime(title, sourceList[0]); instance.addVoiceOutputToAnime(title, voiceList); instance.addSubToAnime(title, subList); instance.addImgPath(title, img); instance.addMediaFiles(title, mediaFiles); } }
/* * return japanese dub anime */ public AnimeList getJapDubAnime() { AnimeList japDubAnime = new AnimeList(); foreach (Anime anime in animeList.Values) { if (anime.getVoiceOutput().Count != 0) { foreach (String dub in anime.getVoiceOutput()) { if (dub.Contains("Jap") || dub.Contains("Japanese") || dub.Contains("Jap") || dub.Contains("japanisch")) { japDubAnime.addAnimeToList(anime); } } } } return(japDubAnime); }
/* * return english dub anime */ public AnimeList getEngDubAnime() { AnimeList engDubAnime = new AnimeList(); foreach (Anime anime in animeList.Values) { if (anime.getVoiceOutput().Count != 0) { foreach (String dub in anime.getVoiceOutput()) { if (dub.Contains("Eng") || dub.Contains("English") || dub.Contains("ENG") || dub.Contains("englisch")) { engDubAnime.addAnimeToList(anime); } } } } return(engDubAnime); }
/* * * return german dub anime */ public AnimeList getGerDubAnime() { AnimeList gerDubAnime = new AnimeList(); foreach (Anime anime in animeList.Values) { if (anime.getVoiceOutput().Count != 0) { foreach (String dub in anime.getVoiceOutput()) { if (dub.Contains("Ger") || dub.Contains("German") || dub.Contains("GER") || dub.Contains("deutsch")) { gerDubAnime.addAnimeToList(anime); } } } } return(gerDubAnime); }
private void button1_Click(object sender, RoutedEventArgs e) { AnimeList filteredList = new AnimeList(); filteredList.addAnimeToList(animeList.getAnimeList()); MainWindow mWindow = Owner as MainWindow; if (checkBox1.IsChecked.Value) { filteredList.removeAnimeWhichIsNotInTheList(animeList.getGerSubAnime()); } if (checkBox2.IsChecked.Value) { filteredList.removeAnimeWhichIsNotInTheList(animeList.getEngSubAnime()); } if (checkBox3.IsChecked.Value) { filteredList.removeAnimeWhichIsNotInTheList(animeList.getJapDubAnime()); } if (checkBox4.IsChecked.Value) { filteredList.removeAnimeWhichIsNotInTheList(animeList.getEngDubAnime()); } if (checkBox5.IsChecked.Value) { filteredList.removeAnimeWhichIsNotInTheList(animeList.getGerDubAnime()); } if (!checkBox1.IsChecked.Value && !checkBox2.IsChecked.Value && !checkBox3.IsChecked.Value && !checkBox4.IsChecked.Value && !checkBox5.IsChecked.Value) { mWindow.listBox1.ItemsSource = animeList.getSortedAllTitle(); } else { mWindow.listBox1.ItemsSource = filteredList.getSortedAllTitle(); } this.Hide(); }
/* *return japanese dub anime */ public AnimeList getJapDubAnime() { AnimeList japDubAnime = new AnimeList(); foreach (Anime anime in animeList.Values) { if (anime.getVoiceOutput().Count != 0) { foreach (String dub in anime.getVoiceOutput()) { if (dub.Contains("Jap") || dub.Contains("Japanese") || dub.Contains("Jap") || dub.Contains("japanisch")) { japDubAnime.addAnimeToList(anime); } } } } return japDubAnime; }
/* *return anime with german subtitle */ public AnimeList getGerSubAnime() { AnimeList gerSubAnime = new AnimeList(); foreach (Anime anime in animeList.Values) { if (anime.getSub().Count != 0) { foreach (String sub in anime.getSub()) { if (sub.Contains("Ger") || sub.Contains("German") || sub.Contains("GER") || sub.Contains("deutsch")) { gerSubAnime.addAnimeToList(anime); } } } } return gerSubAnime; }
/* *return anime with english subtitle */ public AnimeList getEngSubAnime() { AnimeList engSubAnime = new AnimeList(); foreach (Anime anime in animeList.Values) { if (anime.getSub().Count != 0) { foreach (String sub in anime.getSub()) { if (sub.Contains("Eng") || sub.Contains("English") || sub.Contains("ENG") || sub.Contains("englisch")) { engSubAnime.addAnimeToList(anime); } } } } return engSubAnime; }
public void createAnimeObject(string path, string title) { int episodes = AmountOfEpisodes.getSumOfEpisodes(path); string img = PathOfImage.getPathOfImage(path); string[] mediaFiles = PathOfEpisode.getPathOfEpisode(path); string folder = RemoveFullPathFromFolder.getFolder(path); string description = Description.readFromFile(Description.getDescription(path)); char[] split = { '[', ']', '(', ')' }; string[] animeInfo = folder.Split(split); /*Important! When the seperator is at the beginning then an empty element will be added to the array, furthermore when two seperators are one after * then again an empty element will be added, last but not least when a seperator is at the end then again an empty element will be added to the array */ List <string> fansubList = new List <string>(); title = title.Replace("_", " "); List <string> voiceOutput = new List <string>(); List <string> sub = new List <string>(); List <string> sourceList = new List <string>(); if (animeInfo.Length == 3) { fansubList.Add(animeInfo[1]); } else if (animeInfo.Length == 4 || animeInfo.Length == 5) { fansubList.Add(animeInfo[1]); sourceList.Add(animeInfo[3]); } else if (animeInfo.Length == 6 || animeInfo.Length == 7) { fansubList.Add(animeInfo[1]); sourceList.Add(animeInfo[3]); if (animeInfo[5].Contains("Sub")) { sub.Add(animeInfo[5]); } else { voiceOutput.Add(animeInfo[5]); } } else if (animeInfo.Length == 9) { fansubList.Add(animeInfo[1]); sourceList.Add(animeInfo[3]); voiceOutput.Add(animeInfo[5]); sub.Add(animeInfo[7]); } if (title.First() == ' ') //Check if the first character is a space then remove it { title = title.Substring(1, title.Count() - 1); } if (!instance.checkIfAnimeIsAlreadyInTheList(title)) //If the anime is not in the list, then add it as new anime. { instance.addAnimeToList(title, episodes, description, fansubList, sourceList, sub, voiceOutput, img, mediaFiles); } else { instance.addFansubToAnime(title, fansubList.First()); //If the same anime is already in the list, then add parameters like fansub, source, sub, etc. to the anime. if (sourceList.Count != 0) { instance.addSourceToAnime(title, sourceList.First()); } instance.addSubToAnime(title, sub); instance.addVoiceOutputToAnime(title, voiceOutput); instance.addImgPath(title, img); instance.addMediaFiles(title, mediaFiles); } }