Exemple #1
0
        public CL_AniDB_Anime_DefaultImage GetFanartContractNoBlanks(CL_AniDB_Anime anime)
        {
            if (anime == null)
            {
                throw new ArgumentNullException(nameof(anime));
            }

            if (Fanart != null)
            {
                return(Fanart.ToContract());
            }

            List <CL_AniDB_Anime_DefaultImage> fanarts = anime.Fanarts;

            if (fanarts == null || fanarts.Count == 0)
            {
                return(null);
            }
            if (fanarts.Count == 1)
            {
                return(fanarts[0]);
            }

            Random random = new Random();

            return(fanarts[random.Next(0, fanarts.Count - 1)]);
        }
        protected override async Task RefreshInternal()
        {
            MovieSet set = await _metadataService.GetMovieSet(DisplayName);

            SetName     = DisplayNameInternal = set.Name;
            Fanart.Path = set.BackdropPath;
            Poster.Path = set.PosterPath;
            Fanart.RefreshImage();
            Poster.RefreshImage();
        }
        private void LoadFanart()
        {
            Fanart fanart = new Fanart(MainAnime);

            if (fanart.FileName.Length > 0)
            {
                SetGUIProperty(GuiProperty.AnimeInfo_Fanart, fanart.FileName);
            }
            else
            {
                ClearGUIProperty(GuiProperty.AnimeInfo_Fanart);
            }
        }
Exemple #4
0
        private void LoadFanart()
        {
            clearGUIProperty("AnimeInfo.Fanart");
            Fanart fanart = new Fanart(MainAnime);;

            if (fanart == null)
            {
                return;
            }

            if (fanart.FileName.Length > 0)
            {
                setGUIProperty("AnimeInfo.Fanart", fanart.FileName);
            }
        }
Exemple #5
0
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity <User>().Property(User.MiniAvatarFileNameExpression);

            modelBuilder.Entity <FanartTag>().ToTable("fanart_tags");
            modelBuilder.Entity <FanartTags>().ToTable("fanarts_tags");

            Ability.OnModelCreating(modelBuilder);
            Attack.OnModelCreating(modelBuilder);
            Berry.OnModelCreating(modelBuilder);
            Pokefans.Data.Pokedex.Pokemon.OnModelCreating(modelBuilder);
            Offer.OnModelCreating(modelBuilder);
            Item.OnModelCreating(modelBuilder);
            Fanart.OnModelCreating(modelBuilder);

            base.OnModelCreating(modelBuilder);
        }
Exemple #6
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Banner.Length != 0)
            {
                hash ^= Banner.GetHashCode();
            }
            if (Fanart.Length != 0)
            {
                hash ^= Fanart.GetHashCode();
            }
            if (Poster.Length != 0)
            {
                hash ^= Poster.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemple #7
0
 public void Dispose()
 {
     if (BoxFront != null)
     {
         try
         { BoxFront.Dispose(); }
         catch { }
         BoxFront = null;
     }
     if (BoxBack != null)
     {
         try
         { BoxBack.Dispose(); }
         catch { }
         BoxBack = null;
     }
     if (TitleScreen != null)
     {
         try
         { TitleScreen.Dispose(); }
         catch { }
         TitleScreen = null;
     }
     if (InGame != null)
     {
         try
         { InGame.Dispose(); }
         catch { }
         InGame = null;
     }
     if (Fanart != null)
     {
         try
         { Fanart.Dispose(); }
         catch { }
         Fanart = null;
     }
 }
        private void SetEpisode(VM_AnimeEpisode_User ep)
        {
            if (ep == null)
            {
                return;
            }

            /*AniDB_AnimeVM anime = ep.AnimeSeries.AniDB_Anime;
             *
             *    Dictionary<int, TvDB_Episode> dictTvDBEpisodes = anime.DictTvDBEpisodes;
             *    Dictionary<int, int> dictTvDBSeasons = anime.DictTvDBSeasons;
             *    Dictionary<int, int> dictTvDBSeasonsSpecials = anime.DictTvDBSeasonsSpecials;
             *    CrossRef_AniDB_TvDBVM tvDBCrossRef = anime.CrossRefTvDB;
             *    ep.SetTvDBInfo(dictTvDBEpisodes, dictTvDBSeasons, dictTvDBSeasonsSpecials, tvDBCrossRef);*/


            clearGUIProperty("Watching.Series.Title");
            clearGUIProperty("Watching.Series.Description");
            clearGUIProperty("Watching.Series.LastWatched");
            clearGUIProperty("Watching.Series.EpisodesAvailable");
            clearGUIProperty("Watching.Episode.Title");
            clearGUIProperty("Watching.Episode.AirDate");
            clearGUIProperty("Watching.Episode.RunTime");
            clearGUIProperty("Watching.Episode.FileInfo");
            clearGUIProperty("Watching.Episode.Overview");
            clearGUIProperty("Watching.Episode.Image");
            clearGUIProperty("Watching.Episode.Logos");


            setGUIProperty("Watching.Series.Title", ep.AnimeSeries.SeriesName);
            setGUIProperty("Watching.Series.Description", ep.AnimeSeries.Description);
            setGUIProperty("Watching.Series.LastWatched", ep.AnimeSeries.WatchedDate.HasValue ? ep.AnimeSeries.WatchedDate.Value.ToString("dd MMM yy", Globals.Culture) : "-");
            setGUIProperty("Watching.Series.EpisodesAvailable", ep.AnimeSeries.UnwatchedEpisodeCount.ToString());

            setGUIProperty("Watching.Episode.Title", ep.EpisodeNumberAndNameWithType);
            setGUIProperty("Watching.Episode.AirDate", ep.AirDateAsString);
            setGUIProperty("Watching.Episode.RunTime", Utils.FormatSecondsToDisplayTime(ep.AniDB_LengthSeconds));


            setGUIProperty("Watching.Series.Poster", ImageAllocator.GetSeriesImageAsFileName(ep.AnimeSeries, GUIFacadeControl.Layout.List));

            if (ep.EpisodeImageLocation.Length > 0)
            {
                setGUIProperty("Watching.Episode.Image", ep.EpisodeImageLocation);
            }

            try
            {
                Fanart fanart = new Fanart(ep.AnimeSeries);
                if (!string.IsNullOrEmpty(fanart.FileName))
                {
                    setGUIProperty("Watching.Series.Fanart", fanart.FileName);
                }
                else
                {
                    setGUIProperty("Watching.Series.Fanart", "-");
                }
            }
            catch (Exception ex)
            {
                BaseConfig.MyAnimeLog.Write(ep.AnimeSeries.SeriesName + " - " + ex);
            }

            // Overview
            string overview = ep.EpisodeOverview;

            if (BaseConfig.Settings.HidePlot)
            {
                if (ep.EpisodeOverview.Trim().Length > 0 && ep.IsWatched())
                {
                    overview = "*** Hidden to prevent spoilers ***";
                }
            }
            setGUIProperty("Watching.Episode.Overview", overview);

            // File Info
            List <VM_VideoDetailed> filesForEpisode = VM_ShokoServer.Instance.ShokoServices.GetFilesForEpisode(ep.AnimeEpisodeID,
                                                                                                               VM_ShokoServer.Instance.CurrentUser.JMMUserID).CastList <VM_VideoDetailed>();


            string finfo = "";

            foreach (VM_VideoDetailed vid in filesForEpisode)
            {
                finfo = vid.FileSelectionDisplay;
            }

            if (filesForEpisode.Count > 1)
            {
                finfo = filesForEpisode.Count + " Files Available";
            }

            setGUIProperty("Watching.Episode.FileInfo", finfo);

            // Logos
            string logos = Logos.buildLogoImage(ep);

            BaseConfig.MyAnimeLog.Write(logos);
            setGUIProperty("Watching.Episode.Logos", logos);
        }
Exemple #9
0
        private void LoadFanart()
        {
            clearGUIProperty("AnimeInfo.Fanart");
            Fanart fanart = new Fanart(MainAnime); ;

            if (fanart == null) return;

            if (fanart.FileName.Length > 0)
            {
                setGUIProperty("AnimeInfo.Fanart", fanart.FileName);
            }
        }
        private void SetEpisode(AnimeEpisodeVM ep)
        {
            if (ep == null) return;

            /*AniDB_AnimeVM anime = ep.AnimeSeries.AniDB_Anime;

            Dictionary<int, TvDB_EpisodeVM> dictTvDBEpisodes = anime.DictTvDBEpisodes;
            Dictionary<int, int> dictTvDBSeasons = anime.DictTvDBSeasons;
            Dictionary<int, int> dictTvDBSeasonsSpecials = anime.DictTvDBSeasonsSpecials;
            CrossRef_AniDB_TvDBVM tvDBCrossRef = anime.CrossRefTvDB;
            ep.SetTvDBInfo(dictTvDBEpisodes, dictTvDBSeasons, dictTvDBSeasonsSpecials, tvDBCrossRef);*/

            clearGUIProperty("Watching.Series.Title");
            clearGUIProperty("Watching.Series.Description");
            clearGUIProperty("Watching.Series.LastWatched");
            clearGUIProperty("Watching.Series.EpisodesAvailable");
            clearGUIProperty("Watching.Episode.Title");
            clearGUIProperty("Watching.Episode.AirDate");
            clearGUIProperty("Watching.Episode.RunTime");
            clearGUIProperty("Watching.Episode.FileInfo");
            clearGUIProperty("Watching.Episode.Overview");
            clearGUIProperty("Watching.Episode.Image");
            clearGUIProperty("Watching.Episode.Logos");

            setGUIProperty("Watching.Series.Title", ep.AnimeSeries.SeriesName);
            setGUIProperty("Watching.Series.Description", ep.AnimeSeries.Description);
            setGUIProperty("Watching.Series.LastWatched", ep.AnimeSeries.WatchedDate.HasValue ? ep.AnimeSeries.WatchedDate.Value.ToString("dd MMM yy", Globals.Culture) : "-");
            setGUIProperty("Watching.Series.EpisodesAvailable", ep.AnimeSeries.UnwatchedEpisodeCount.ToString());

            setGUIProperty("Watching.Episode.Title", ep.EpisodeNumberAndNameWithType);
            setGUIProperty("Watching.Episode.AirDate", ep.AirDateAsString);
            setGUIProperty("Watching.Episode.RunTime", Utils.FormatSecondsToDisplayTime(ep.AniDB_LengthSeconds));

            setGUIProperty("Watching.Series.Poster", ImageAllocator.GetSeriesImageAsFileName(ep.AnimeSeries, GUIFacadeControl.Layout.List));

            if (ep.EpisodeImageLocation.Length > 0)
                setGUIProperty("Watching.Episode.Image", ep.EpisodeImageLocation);

            try
            {
                Fanart fanart = new Fanart(ep.AnimeSeries);
                if (!string.IsNullOrEmpty(fanart.FileName))
                    setGUIProperty("Watching.Series.Fanart", fanart.FileName);
                else
                    setGUIProperty("Watching.Series.Fanart", "-");
            }
            catch (Exception ex)
            {
                BaseConfig.MyAnimeLog.Write(ep.AnimeSeries.SeriesName + " - "  + ex.ToString());
            }

            // Overview
            string overview = ep.EpisodeOverview;
            if (BaseConfig.Settings.HidePlot)
            {
                if (ep.EpisodeOverview.Trim().Length > 0 && ep.IsWatched == 0)
                    overview = "*** Hidden to prevent spoilers ***";
            }
            setGUIProperty("Watching.Episode.Overview", overview);

            // File Info
            List<VideoDetailedVM>  filesForEpisode = new List<VideoDetailedVM>();
            List<JMMServerBinary.Contract_VideoDetailed> contracts = JMMServerVM.Instance.clientBinaryHTTP.GetFilesForEpisode(ep.AnimeEpisodeID,
                JMMServerVM.Instance.CurrentUser.JMMUserID);

            foreach (JMMServerBinary.Contract_VideoDetailed fi in contracts)
                filesForEpisode.Add(new VideoDetailedVM(fi));

            string finfo = "";
            foreach (VideoDetailedVM vid in filesForEpisode)
                finfo = vid.FileSelectionDisplay;

            if (filesForEpisode.Count > 1)
                finfo = filesForEpisode.Count.ToString() + " Files Available";

            setGUIProperty("Watching.Episode.FileInfo", finfo);

            // Logos
            string logos = Logos.buildLogoImage(ep);

            BaseConfig.MyAnimeLog.Write(logos);
            setGUIProperty("Watching.Episode.Logos", logos);
        }
 private void LoadFanart()
 {
     Fanart fanart = new Fanart(MainAnime);
     if (fanart.FileName.Length > 0)
         SetGUIProperty(GuiProperty.AnimeInfo_Fanart, fanart.FileName);
     else
         ClearGUIProperty(GuiProperty.AnimeInfo_Fanart);
 }
        private void RefreshImage()
        {
            string fanartPath = _musicFileService.GetArtistImage(Path);

            Fanart.RefreshImage(fanartPath);
        }