public override object StoreData(string year, TempThread tempThred, MALData malData)
        {
            var list = TheMovieHelper.SearchQuary(activeMovie.title.name, core);

            if (!GetThredActive(tempThred))
            {
                return(null);
            }
            ;                                                 // COPY UPDATE PROGRESS
            return(list);
        }
예제 #2
0
        //public override bool HasAnimeMovie => false;

        public override object StoreData(bool isMovie, TempThread tempThred)
        {
            try {
                var list = TheMovieHelper.SearchQuary(activeMovie.title.name, core);
                if (!GetThredActive(tempThred))
                {
                    return(null);
                }
                ;                                                 // COPY UPDATE PROGRESS
                MovieType mType   = activeMovie.title.movieType;
                string    compare = ToDown(activeMovie.title.name, true, "");
                var       watchMovieSeasonsData = new Dictionary <int, string>();

                if (mType.IsMovie())
                {
                    //string mustContain = mType == MovieType.AnimeMovie ? "/anime-info/" : "/series/";
                    string mustContain = isMovie ? "/movie/" : "/series/";
                    TheMovieHelper.TheMovieTitle[] matching = list.Where(t => ToDown(t.name, true, "") == compare && t.season == -1 && t.href.Contains(mustContain)).ToArray();
                    if (matching.Length > 0)
                    {
                        TheMovieHelper.TheMovieTitle title = matching[0];
                        print("LOADED:::::::::-->>>1 " + title.href);

                        string d     = DownloadString(title.href);
                        int    maxEp = TheMovieHelper.GetMaxEp(d, title.href);
                        if (maxEp == 0 || maxEp == 1)
                        {
                            string rEp = title.href + "/" + (maxEp - 1); //+ "-episode-" + maxEp;
                            watchMovieSeasonsData[-1] = rEp;
                            print("LOADED:::::::::-->>>2 " + rEp);
                        }
                    }
                }
                else
                {
                    var episodes = list.Where(t => !t.isDub && t.season != -1 && ToDown(t.name, true, "") == compare && t.href.Contains("/series/")).ToList().OrderBy(t => t.season).ToArray();

                    for (int i = 0; i < episodes.Length; i++)
                    {
                        watchMovieSeasonsData[episodes[i].season] = episodes[i].href;
                    }
                }
                return(watchMovieSeasonsData);
            }
            catch { return(null); }
        }