Ejemplo n.º 1
0
        public static void SetDefaultPoster(bool isDefault, PosterContainer poster, int animeID)
        {
            if (!JMMServerVM.Instance.ServerOnline)
            {
                return;
            }

            try
            {
                switch (poster.ImageType)
                {
                case ImageEntityType.TvDB_Cover:
                    TvDB_ImagePosterVM tvPoster = poster.PosterObject as TvDB_ImagePosterVM;
                    JMMServerVM.Instance.clientBinaryHTTP.SetDefaultImage(isDefault, animeID,
                                                                          tvPoster.TvDB_ImagePosterID, (int)ImageEntityType.TvDB_Cover, (int)ImageSizeType.Poster);
                    tvPoster.IsImageDefault = isDefault;
                    break;

                case ImageEntityType.Trakt_Poster:
                    Trakt_ImagePosterVM traktPoster = poster.PosterObject as Trakt_ImagePosterVM;
                    JMMServerVM.Instance.clientBinaryHTTP.SetDefaultImage(isDefault, animeID,
                                                                          traktPoster.Trakt_ImagePosterID, (int)ImageEntityType.Trakt_Poster, (int)ImageSizeType.Poster);
                    traktPoster.IsImageDefault = isDefault;
                    break;

                case ImageEntityType.AniDB_Cover:
                    AniDB_AnimeVM anime = poster.PosterObject as AniDB_AnimeVM;
                    JMMServerVM.Instance.clientBinaryHTTP.SetDefaultImage(isDefault, animeID,
                                                                          anime.AnimeID, (int)ImageEntityType.AniDB_Cover, (int)ImageSizeType.Poster);
                    anime.IsImageDefault = isDefault;
                    break;

                case ImageEntityType.MovieDB_Poster:
                    MovieDB_PosterVM moviePoster = poster.PosterObject as MovieDB_PosterVM;
                    JMMServerVM.Instance.clientBinaryHTTP.SetDefaultImage(isDefault, animeID,
                                                                          moviePoster.MovieDB_PosterID, (int)ImageEntityType.MovieDB_Poster, (int)ImageSizeType.Poster);
                    moviePoster.IsImageDefault = isDefault;
                    break;
                }
                poster.IsImageDefault = isDefault;
            }
            catch (Exception ex)
            {
                BaseConfig.MyAnimeLog.Write("SetDefaultPoster: " + ex.Message);
            }
        }
Ejemplo n.º 2
0
        public static void EnableDisablePoster(bool enabled, PosterContainer poster, int animeID)
        {
            try
            {
                if (!enabled && poster.IsImageDefault)
                {
                    SetDefaultPoster(false, poster, animeID);
                }

                switch (poster.ImageType)
                {
                case ImageEntityType.TvDB_Cover:
                    TvDB_ImagePosterVM tvPoster = poster.PosterObject as TvDB_ImagePosterVM;
                    JMMServerVM.Instance.clientBinaryHTTP.EnableDisableImage(enabled, tvPoster.TvDB_ImagePosterID, (int)ImageEntityType.TvDB_Cover);
                    tvPoster.Enabled = enabled ? 1 : 0;
                    break;

                case ImageEntityType.Trakt_Poster:
                    Trakt_ImagePosterVM traktPoster = poster.PosterObject as Trakt_ImagePosterVM;
                    JMMServerVM.Instance.clientBinaryHTTP.EnableDisableImage(enabled, traktPoster.Trakt_ImagePosterID, (int)ImageEntityType.Trakt_Poster);
                    traktPoster.Enabled = enabled ? 1 : 0;
                    break;

                case ImageEntityType.AniDB_Cover:
                    AniDB_AnimeVM anime = poster.PosterObject as AniDB_AnimeVM;
                    JMMServerVM.Instance.clientBinaryHTTP.EnableDisableImage(enabled, anime.AnimeID, (int)ImageEntityType.AniDB_Cover);
                    anime.ImageEnabled = enabled ? 1 : 0;
                    break;

                case ImageEntityType.MovieDB_Poster:
                    MovieDB_PosterVM moviePoster = poster.PosterObject as MovieDB_PosterVM;
                    JMMServerVM.Instance.clientBinaryHTTP.EnableDisableImage(enabled, moviePoster.MovieDB_PosterID, (int)ImageEntityType.MovieDB_Poster);
                    moviePoster.Enabled = enabled ? 1 : 0;
                    break;
                }
                poster.IsImageEnabled = enabled;
            }
            catch (Exception ex)
            {
                BaseConfig.MyAnimeLog.Write("SetDefaultPoster: " + ex.Message);
            }
        }
Ejemplo n.º 3
0
        public static void SetDefaultPoster(bool isDefault, PosterContainer poster, int animeID)
        {
            if (!JMMServerVM.Instance.ServerOnline) return;

            try
            {

                switch (poster.ImageType)
                {
                    case ImageEntityType.TvDB_Cover:
                        TvDB_ImagePosterVM tvPoster = poster.PosterObject as TvDB_ImagePosterVM;
                        JMMServerVM.Instance.clientBinaryHTTP.SetDefaultImage(isDefault, animeID,
                            tvPoster.TvDB_ImagePosterID, (int)ImageEntityType.TvDB_Cover, (int)ImageSizeType.Poster);
                        tvPoster.IsImageDefault = isDefault;
                        break;

                    case ImageEntityType.Trakt_Poster:
                        Trakt_ImagePosterVM traktPoster = poster.PosterObject as Trakt_ImagePosterVM;
                        JMMServerVM.Instance.clientBinaryHTTP.SetDefaultImage(isDefault, animeID,
                            traktPoster.Trakt_ImagePosterID, (int)ImageEntityType.Trakt_Poster, (int)ImageSizeType.Poster);
                        traktPoster.IsImageDefault = isDefault;
                        break;

                    case ImageEntityType.AniDB_Cover:
                        AniDB_AnimeVM anime = poster.PosterObject as AniDB_AnimeVM;
                        JMMServerVM.Instance.clientBinaryHTTP.SetDefaultImage(isDefault, animeID,
                            anime.AnimeID, (int)ImageEntityType.AniDB_Cover, (int)ImageSizeType.Poster);
                        anime.IsImageDefault = isDefault;
                        break;

                    case ImageEntityType.MovieDB_Poster:
                        MovieDB_PosterVM moviePoster = poster.PosterObject as MovieDB_PosterVM;
                        JMMServerVM.Instance.clientBinaryHTTP.SetDefaultImage(isDefault, animeID,
                            moviePoster.MovieDB_PosterID, (int)ImageEntityType.MovieDB_Poster, (int)ImageSizeType.Poster);
                        moviePoster.IsImageDefault = isDefault;
                        break;
                }
                poster.IsImageDefault = isDefault;

            }
            catch (Exception ex)
            {
                BaseConfig.MyAnimeLog.Write("SetDefaultPoster: " + ex.Message);
            }
        }
Ejemplo n.º 4
0
        private void SetPosterProperties(PosterContainer poster)
        {
            string isDefault = "No";
            if (poster.IsImageDefault) isDefault = "Yes";

            string isDisabled = "No";
            if (!poster.IsImageEnabled) isDisabled = "Yes";

            MainWindow.setGUIProperty("Posters.SelectedSource", poster.PosterSource);
            MainWindow.setGUIProperty("Posters.SelectedPosterIsDefault", isDefault);
            MainWindow.setGUIProperty("Posters.SelectedPosterIsDisabled", isDisabled);
        }
Ejemplo n.º 5
0
        public static void EnableDisablePoster(bool enabled, PosterContainer poster, int animeID)
        {
            try
            {
                if (!enabled && poster.IsImageDefault)
                    SetDefaultPoster(false, poster, animeID);

                switch (poster.ImageType)
                {
                    case ImageEntityType.TvDB_Cover:
                        TvDB_ImagePosterVM tvPoster = poster.PosterObject as TvDB_ImagePosterVM;
                        JMMServerVM.Instance.clientBinaryHTTP.EnableDisableImage(enabled, tvPoster.TvDB_ImagePosterID, (int)ImageEntityType.TvDB_Cover);
                        tvPoster.Enabled = enabled ? 1 : 0;
                        break;

                    case ImageEntityType.Trakt_Poster:
                        Trakt_ImagePosterVM traktPoster = poster.PosterObject as Trakt_ImagePosterVM;
                        JMMServerVM.Instance.clientBinaryHTTP.EnableDisableImage(enabled, traktPoster.Trakt_ImagePosterID, (int)ImageEntityType.Trakt_Poster);
                        traktPoster.Enabled = enabled ? 1 : 0;
                        break;

                    case ImageEntityType.AniDB_Cover:
                        AniDB_AnimeVM anime = poster.PosterObject as AniDB_AnimeVM;
                        JMMServerVM.Instance.clientBinaryHTTP.EnableDisableImage(enabled, anime.AnimeID, (int)ImageEntityType.AniDB_Cover);
                        anime.ImageEnabled = enabled ? 1 : 0;
                        break;

                    case ImageEntityType.MovieDB_Poster:
                        MovieDB_PosterVM moviePoster = poster.PosterObject as MovieDB_PosterVM;
                        JMMServerVM.Instance.clientBinaryHTTP.EnableDisableImage(enabled, moviePoster.MovieDB_PosterID, (int)ImageEntityType.MovieDB_Poster);
                        moviePoster.Enabled = enabled ? 1 : 0;
                        break;
                }
                poster.IsImageEnabled = enabled;
            }
            catch (Exception ex)
            {
                BaseConfig.MyAnimeLog.Write("SetDefaultPoster: " + ex.Message);
            }
        }