Example #1
0
 private void DisplaySeries()
 {
     if (MainWindow.RandomWindow_CurrentSeries == null)
     {
         SetGUIProperty(GuiProperty.Random_Status, Translation.NoMatchesFound);
         ClearGUIProperty(GuiProperty.Random_Series_Title);
         ClearGUIProperty(GuiProperty.Random_Series_Description);
         ClearGUIProperty(GuiProperty.Random_Series_LastWatched);
         ClearGUIProperty(GuiProperty.Random_Series_EpisodesWatched);
         ClearGUIProperty(GuiProperty.Random_Series_EpisodesUnwatched);
         ClearGUIProperty(GuiProperty.Random_Series_Poster);
         ClearGUIProperty(GuiProperty.Random_NumberOfMatches);
         MainWindow.RandomWindow_MatchesFound  = 0;
         MainWindow.RandomWindow_CurrentSeries = null;
     }
     else
     {
         SetGUIProperty(GuiProperty.Random_Series_Title, MainWindow.RandomWindow_CurrentSeries.SeriesName);
         SetGUIProperty(GuiProperty.Random_Series_Description, MainWindow.RandomWindow_CurrentSeries.Description);
         SetGUIProperty(GuiProperty.Random_Series_LastWatched, MainWindow.RandomWindow_CurrentSeries.WatchedDate.HasValue ? MainWindow.RandomWindow_CurrentSeries.WatchedDate.Value.ToString("dd MMM yy", Globals.Culture) : "-");
         SetGUIProperty(GuiProperty.Random_Series_EpisodesWatched, MainWindow.RandomWindow_CurrentSeries.WatchedEpisodeCount.ToString(Globals.Culture));
         SetGUIProperty(GuiProperty.Random_Series_EpisodesUnwatched, MainWindow.RandomWindow_CurrentSeries.UnwatchedEpisodeCount.ToString(Globals.Culture));
         SetGUIProperty(GuiProperty.Random_Series_Poster, ImageAllocator.GetSeriesImageAsFileName(MainWindow.RandomWindow_CurrentSeries, GUIFacadeControl.Layout.List));
         dummyNoData.Visible = false;
     }
 }
Example #2
0
        private void DisplaySeries()
        {
            clearGUIProperty("Series.Title");
            clearGUIProperty("Series.Description");
            clearGUIProperty("Series.LastWatched");
            clearGUIProperty("Series.EpisodesWatched");
            clearGUIProperty("Series.EpisodesUnwatched");
            clearGUIProperty("Series.Poster");

            clearGUIProperty("NumberOfMatches");

            if (MainWindow.RandomWindow_CurrentSeries == null)
            {
                setGUIProperty("Status", "No Matches Found");
                MainWindow.RandomWindow_MatchesFound  = 0;
                MainWindow.RandomWindow_CurrentSeries = null;
            }
            else
            {
                setGUIProperty("Series.Title", MainWindow.RandomWindow_CurrentSeries.SeriesName);
                setGUIProperty("Series.Description", MainWindow.RandomWindow_CurrentSeries.Description);
                setGUIProperty("Series.LastWatched", MainWindow.RandomWindow_CurrentSeries.WatchedDate.HasValue ? MainWindow.RandomWindow_CurrentSeries.WatchedDate.Value.ToString("dd MMM yy", Globals.Culture) : "-");
                setGUIProperty("Series.EpisodesWatched", MainWindow.RandomWindow_CurrentSeries.WatchedEpisodeCount.ToString());
                setGUIProperty("Series.EpisodesUnwatched", MainWindow.RandomWindow_CurrentSeries.UnwatchedEpisodeCount.ToString());
                setGUIProperty("Series.Poster", ImageAllocator.GetSeriesImageAsFileName(MainWindow.RandomWindow_CurrentSeries, GUIFacadeControl.Layout.List));

                dummyNoData.Visible = false;
            }
        }
Example #3
0
        private void SetSkinProperties()
        {
            setGUIProperty("AnimeInfo.Title", "-");
            setGUIProperty("AnimeInfo.PageTitle", "Information");

            if (serMain != null)
            {
                setGUIProperty("AnimeInfo.Poster", ImageAllocator.GetSeriesImageAsFileName(serMain, GUIFacadeControl.Layout.List));
                setGUIProperty("AnimeInfo.Title", serMain.SeriesName);
            }
        }
        private void SetSkinProperties()
        {
            SetGUIProperty(GuiProperty.AnimeInfo_PageTitle, Translation.Information);

            if (serMain != null)
            {
                SetGUIProperty(GuiProperty.AnimeInfo_Poster, ImageAllocator.GetSeriesImageAsFileName(serMain, GUIFacadeControl.Layout.List));
                SetGUIProperty(GuiProperty.AnimeInfo_Title, serMain.SeriesName);
            }
            else
            {
                ClearGUIProperty(GuiProperty.AnimeInfo_Title);
            }
        }
        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);
        }
Example #6
0
        private void DisplayEpisode()
        {
            if (MainWindow.RandomWindow_CurrentEpisode == null)
            {
                SetGUIProperty(GuiProperty.Random_Status, Translation.NoMatchesFound);
                MainWindow.RandomWindow_MatchesFound   = 0;
                MainWindow.RandomWindow_CurrentSeries  = null;
                MainWindow.RandomWindow_CurrentEpisode = null;
            }
            else
            {
                SetGUIProperty(GuiProperty.Random_Series_Description, MainWindow.RandomWindow_CurrentSeries.Description);
                SetGUIProperty(GuiProperty.Random_Series_Title, MainWindow.RandomWindow_CurrentSeries.SeriesName);
                SetGUIProperty(GuiProperty.Random_Series_LastWatched, MainWindow.RandomWindow_CurrentSeries.WatchedDate.HasValue ? MainWindow.RandomWindow_CurrentSeries.WatchedDate.Value.ToString("dd MMM yy", Globals.Culture) : "-");
                SetGUIProperty(GuiProperty.Random_Series_EpisodesWatched, MainWindow.RandomWindow_CurrentSeries.WatchedEpisodeCount.ToString(Globals.Culture));
                SetGUIProperty(GuiProperty.Random_Series_EpisodesUnwatched, MainWindow.RandomWindow_CurrentSeries.UnwatchedEpisodeCount.ToString(Globals.Culture));
                SetGUIProperty(GuiProperty.Random_Series_Poster, ImageAllocator.GetSeriesImageAsFileName(MainWindow.RandomWindow_CurrentSeries, GUIFacadeControl.Layout.List));

                SetGUIProperty(GuiProperty.Random_Episode_Title, MainWindow.RandomWindow_CurrentEpisode.EpisodeNumberAndNameWithType);
                SetGUIProperty(GuiProperty.Random_Episode_AirDate, MainWindow.RandomWindow_CurrentEpisode.AirDateAsString);
                SetGUIProperty(GuiProperty.Random_Episode_RunTime, Utils.FormatSecondsToDisplayTime(MainWindow.RandomWindow_CurrentEpisode.AniDB_LengthSeconds));


                if (MainWindow.RandomWindow_CurrentEpisode.EpisodeImageLocation.Length > 0)
                {
                    SetGUIProperty(GuiProperty.Random_Episode_Image, MainWindow.RandomWindow_CurrentEpisode.EpisodeImageLocation);
                }
                else
                {
                    ClearGUIProperty(GuiProperty.Random_Episode_Image);
                }

                // Overview
                string overview = MainWindow.RandomWindow_CurrentEpisode.EpisodeOverview;
                if (BaseConfig.Settings.HidePlot)
                {
                    if (MainWindow.RandomWindow_CurrentEpisode.EpisodeOverview.Trim().Length > 0 &&
                        !MainWindow.RandomWindow_CurrentEpisode.IsWatched())
                    {
                        overview = "*** " + Translation.HiddenToPreventSpoiles + " ***";
                    }
                    SetGUIProperty(GuiProperty.Random_Episode_Overview, overview);
                }

                // File Info
                List <VM_VideoDetailed> filesForEpisode =
                    VM_ShokoServer.Instance.ShokoServices.GetFilesForEpisode(
                        MainWindow.RandomWindow_CurrentEpisode.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.ToString(Globals.Culture) + " " + Translation.FilesAvailable;
                }

                SetGUIProperty(GuiProperty.Random_Episode_FileInfo, finfo);
                // Logos
                string logos = Logos.buildLogoImage(MainWindow.RandomWindow_CurrentEpisode);

                BaseConfig.MyAnimeLog.Write(logos);
                SetGUIProperty(GuiProperty.Random_Episode_Logos, logos);

                dummyNoData.Visible = false;
            }
        }
Example #7
0
        private void ShowRelations()
        {
            GUIControl.ClearControl(this.GetID, m_Facade.GetID);

            if (dummyRelationsExist != null)
            {
                if (relations.Count > 0)
                {
                    dummyRelationsExist.Visible = true;
                }
                else
                {
                    dummyRelationsExist.Visible = false;
                }
            }

            string imagePathMissing   = GUIGraphicsContext.Skin + @"\Media\MyAnime3\anime3_question_poster.png";
            string imagePathNoPicture = GUIGraphicsContext.Skin + @"\Media\MyAnime3\anime3_blankchar.png";

            foreach (AniDB_Anime_RelationVM ra in relations)
            {
                string imagePath = "";

                BaseConfig.MyAnimeLog.Write("AnimeID: " + mainAnime.AnimeID.ToString() + ", Related ID: " + ra.AniDB_Anime.AnimeID.ToString());
                BaseConfig.MyAnimeLog.Write("Poster Path: " + ra.AniDB_Anime.DefaultPosterPath);

                AniDB_AnimeVM anime = ra.AniDB_Anime;
                if (anime != null)
                {
                    // try and load the series
                    AnimeSeriesVM serAnime = ra.AnimeSeries;
                    if (serAnime != null)
                    {
                        string posterName = ImageAllocator.GetSeriesImageAsFileName(serAnime, GUIFacadeControl.Layout.Filmstrip);
                        if (File.Exists(posterName))
                        {
                            imagePath = posterName;
                        }
                    }

                    if (imagePath.Length == 0)
                    {
                        if (anime.DefaultPosterPath.Trim().Length > 0 && File.Exists(anime.DefaultPosterPath))
                        {
                            imagePath = anime.DefaultPosterPath;
                        }
                        else
                        {
                            imagePath = imagePathNoPicture;
                        }
                    }
                }
                else
                {
                    imagePath = imagePathMissing;
                }


                GUIListItem item = new GUIListItem();
                item.IconImage       = item.IconImageBig = imagePath;
                item.TVTag           = ra;
                item.OnItemSelected += new GUIListItem.ItemSelectedHandler(onFacadeItemSelected);
                m_Facade.Add(item);
            }

            if (m_Facade.Count > 0)
            {
                m_Facade.SelectedListItemIndex = 0;

                AniDB_Anime_RelationVM ra = m_Facade.SelectedListItem.TVTag as AniDB_Anime_RelationVM;
                if (ra != null)
                {
                    SetAnime(ra);
                }
            }

            //GUIControl.FocusControl(GetID, 50);
        }
Example #8
0
        private void ShowRelations()
        {
            GUIControl.ClearControl(this.GetID, m_Facade.GetID);

            if (dummyRelationsExist != null)
            {
                if (relations.Count > 0)
                {
                    dummyRelationsExist.Visible = true;
                }
                else
                {
                    dummyRelationsExist.Visible = false;
                }
            }


            string imagePathMissing   = GUIGraphicsContext.Skin + @"\Media\MyAnime3\anime3_question_poster.png";
            string imagePathNoPicture = GUIGraphicsContext.Skin + @"\Media\MyAnime3\anime3_blankchar.png";

            BaseConfig.MyAnimeLog.Write("CharWindow.GlobalSeriesID = {0}", MainWindow.GlobalSeriesID.ToString());
            BaseConfig.MyAnimeLog.Write("CharWindow.Relations count = " + relations.Count);

            if (relations?.Count > 0)
            {
                foreach (CL_AniDB_Anime_Relation ra in relations)
                {
                    string imagePath = "";

                    if (ra.AniDB_Anime != null && ra.AnimeSeries != null)
                    {
                        BaseConfig.MyAnimeLog.Write("AnimeID: " + MainWindow.GlobalSeriesID + ", Related ID: " +
                                                    ra.AniDB_Anime.AnimeID.ToString());
                        BaseConfig.MyAnimeLog.Write("Poster Path: " + ((VM_AniDB_Anime)ra.AniDB_Anime).DefaultPosterPath);

                        VM_AniDB_Anime anime = (VM_AniDB_Anime)ra.AniDB_Anime;
                        // try and load the series
                        VM_AnimeSeries_User serAnime = (VM_AnimeSeries_User)ra.AnimeSeries;

                        if (serAnime != null)
                        {
                            string posterName = ImageAllocator.GetSeriesImageAsFileName(serAnime,
                                                                                        GUIFacadeControl.Layout.Filmstrip);
                            if (File.Exists(posterName))
                            {
                                imagePath = posterName;
                            }
                        }

                        if (imagePath.Length == 0)
                        {
                            if (anime.DefaultPosterPath.Trim().Length > 0 && File.Exists(anime.DefaultPosterPath))
                            {
                                imagePath = anime.DefaultPosterPath;
                            }
                            else
                            {
                                imagePath = imagePathNoPicture;
                            }
                        }
                    }
                    else
                    {
                        imagePath = imagePathMissing;
                    }

                    // If it has no title skip it as it's probably an invalid item
                    if (!string.IsNullOrEmpty(ra.AniDB_Anime?.MainTitle))
                    {
                        GUIListItem item = new GUIListItem();
                        item.IconImage       = item.IconImageBig = imagePath;
                        item.TVTag           = ra;
                        item.OnItemSelected += new GUIListItem.ItemSelectedHandler(onFacadeItemSelected);
                        m_Facade.Add(item);
                    }
                }
            }

            if (m_Facade.Count > 0)
            {
                m_Facade.SelectedListItemIndex = 0;

                CL_AniDB_Anime_Relation ra = m_Facade.SelectedListItem?.TVTag as CL_AniDB_Anime_Relation;
                if (ra != null)
                {
                    SetAnime(ra);
                }
            }

            //GUIControl.FocusControl(GetID, 50);
        }
Example #9
0
        private void DisplayEpisode()
        {
            clearGUIProperty("Series.Title");
            clearGUIProperty("Series.Description");
            clearGUIProperty("Series.LastWatched");
            clearGUIProperty("Series.EpisodesWatched");
            clearGUIProperty("Series.EpisodesUnwatched");
            clearGUIProperty("Series.Poster");

            clearGUIProperty("NumberOfMatches");

            clearGUIProperty("Episode.Title");
            clearGUIProperty("Episode.AirDate");
            clearGUIProperty("Episode.RunTime");
            clearGUIProperty("Episode.FileInfo");
            clearGUIProperty("Episode.Overview");
            clearGUIProperty("Episode.Image");
            clearGUIProperty("Episode.Logos");

            if (MainWindow.RandomWindow_CurrentEpisode == null)
            {
                setGUIProperty("Status", "No Matches Found");
                MainWindow.RandomWindow_MatchesFound   = 0;
                MainWindow.RandomWindow_CurrentSeries  = null;
                MainWindow.RandomWindow_CurrentEpisode = null;
            }
            else
            {
                setGUIProperty("Series.Title", MainWindow.RandomWindow_CurrentSeries.SeriesName);
                setGUIProperty("Series.Description", MainWindow.RandomWindow_CurrentSeries.Description);
                setGUIProperty("Series.LastWatched", MainWindow.RandomWindow_CurrentSeries.WatchedDate.HasValue ? MainWindow.RandomWindow_CurrentSeries.WatchedDate.Value.ToString("dd MMM yy", Globals.Culture) : "-");
                setGUIProperty("Series.EpisodesWatched", MainWindow.RandomWindow_CurrentSeries.WatchedEpisodeCount.ToString());
                setGUIProperty("Series.EpisodesUnwatched", MainWindow.RandomWindow_CurrentSeries.UnwatchedEpisodeCount.ToString());
                setGUIProperty("Series.Poster", ImageAllocator.GetSeriesImageAsFileName(MainWindow.RandomWindow_CurrentSeries, GUIFacadeControl.Layout.List));

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


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

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

                // File Info
                List <VideoDetailedVM> filesForEpisode = new List <VideoDetailedVM>();
                List <JMMServerBinary.Contract_VideoDetailed> contracts = JMMServerVM.Instance.clientBinaryHTTP.GetFilesForEpisode(MainWindow.RandomWindow_CurrentEpisode.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("Episode.FileInfo", finfo);

                // Logos
                string logos = Logos.buildLogoImage(MainWindow.RandomWindow_CurrentEpisode);

                BaseConfig.MyAnimeLog.Write(logos);
                setGUIProperty("Episode.Logos", logos);

                dummyNoData.Visible = false;
            }
        }