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; } }
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); }
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; } }