Example #1
0
        public static void ScanForMatches()
        {
            IReadOnlyList <SVR_AnimeSeries> allSeries = RepoFactory.AnimeSeries.GetAll();

            foreach (SVR_AnimeSeries ser in allSeries)
            {
                SVR_AniDB_Anime anime = ser.GetAnime();
                if (anime == null)
                {
                    continue;
                }

                if (anime.GetIsMovieDBLinkDisabled())
                {
                    continue;
                }

                // don't scan if it is associated on the TvDB
                if (anime.GetCrossRefTvDBV2().Count > 0)
                {
                    continue;
                }

                // don't scan if it is associated on the MovieDB
                if (anime.GetCrossRefMovieDB() != null)
                {
                    continue;
                }

                // don't scan if it is not a movie
                if (!anime.GetSearchOnMovieDB())
                {
                    continue;
                }

                logger.Trace("Found anime movie without MovieDB association: " + anime.MainTitle);

                CommandRequest_MovieDBSearchAnime cmd = new CommandRequest_MovieDBSearchAnime(ser.AniDB_ID, false);
                cmd.Save();
            }
        }