void PlaybackOperationEnded(bool countAsWatched, AnimeEpisodeVM ep) { try { if (ep == null) { return; } if (ep != null) { ep.IncrementEpisodeStats(StatCountType.Stopped); } //save watched status if (countAsWatched || ep.IsWatched == 1) { //MPTVSeriesLog.Write("This episode counts as watched"); if (countAsWatched) { BaseConfig.MyAnimeLog.Write("Marking episode as watched: " + ep.EpisodeNumberAndNameWithType); MarkEpisodeAsWatched(ep); } } SetGUIProperties(true); // clear GUI Properties } catch (Exception e) { BaseConfig.MyAnimeLog.Write("Error in VideoHandler.PlaybackOperationEnded: {0}", e.ToString()); } }
private void CommandBinding_PlayAllUnwatchedEpisode(object sender, ExecutedRoutedEventArgs e) { Window parentWindow = Window.GetWindow(this); object obj = e.Parameter; if (obj == null) { return; } try { if (obj.GetType() == typeof(AnimeEpisodeVM)) { AnimeEpisodeVM ep = obj as AnimeEpisodeVM; MainWindow.videoHandler.PlayAllUnwatchedEpisodes(ep.AnimeSeriesID); } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
public void DisplayFiles() { try { AnimeEpisodeVM ep = this.DataContext as AnimeEpisodeVM; if (ep != null) { ep.RefreshFilesForEpisode(); lbFiles.ItemsSource = ep.FilesForEpisode; if (!ep.HasFiles) { List <AniDBReleaseGroupVM> relGroups = ep.ReleaseGroups; if (relGroups.Count > 0) { string grpList = ""; foreach (AniDBReleaseGroupVM rg in relGroups) { if (grpList.Length > 0) { grpList += ", "; } grpList += rg.GroupName; } tbFileDetailsGroups.Text = JMMClient.Properties.Resources.GroupsAvailableFrom + " " + grpList; } } } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
public void Init(AnimeEpisodeVM ep, AniDB_AnimeVM anime) { AnimeID = anime.AnimeID; Anime = anime; AnimeEpisode = ep; List <int> uids = new List <int>(); cboSeries.Items.Clear(); foreach (CrossRef_AniDB_TvDBVMV2 xref in Anime.TvSummary.CrossRefTvDBV2) { if (!uids.Contains(xref.TvDBID)) { cboSeries.Items.Add(xref); } uids.Add(xref.TvDBID); } cboSeries.SelectionChanged += new SelectionChangedEventHandler(cboSeries_SelectionChanged); if (cboSeries.Items.Count > 0) { cboSeries.SelectedIndex = 0; } }
private void ShowNextEpisode() { AnimeGroupVM grp = this.DataContext as AnimeGroupVM; if (grp == null) { return; } if (!grp.AnimeGroupID.HasValue) { ucNextEpisode.EpisodeExists = false; ucNextEpisode.EpisodeMissing = true; ucNextEpisode.DataContext = null; return; } JMMServerBinary.Contract_AnimeEpisode ep = JMMServerVM.Instance.clientBinaryHTTP.GetNextUnwatchedEpisodeForGroup(grp.AnimeGroupID.Value, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (ep != null) { AnimeEpisodeVM aniep = new AnimeEpisodeVM(ep); aniep.SetTvDBInfo(); ucNextEpisode.DataContext = aniep; } else { ucNextEpisode.EpisodeExists = false; ucNextEpisode.EpisodeMissing = true; ucNextEpisode.DataContext = null; } }
protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) { if (MA3WindowManager.HandleWindowChangeButton(control)) { return; } if (btnRefresh != null && control == btnRefresh) { this.btnRefresh.IsFocused = false; m_Facade.Focus = true; LoadData(); } if (control == this.m_Facade) { // show the files if we are looking at a torrent GUIListItem item = m_Facade.SelectedListItem; if (item == null || item.TVTag == null) { return; } if (item.TVTag.GetType() == typeof(AnimeEpisodeVM)) { AnimeEpisodeVM ep = item.TVTag as AnimeEpisodeVM; if (ep != null) { MainWindow.vidHandler.ResumeOrPlay(ep); } } } base.OnClicked(controlId, control, actionType); }
void btnUpdateEpisode_Click(object sender, RoutedEventArgs e) { AnimeEpisodeVM ep = this.DataContext as AnimeEpisodeVM; Window wdw = Window.GetWindow(this); this.Cursor = Cursors.Wait; try { string res = JMMServerVM.Instance.clientBinaryHTTP.UpdateEpisodeData(ep.AniDB_EpisodeID); if (res.Length > 0) { this.Cursor = Cursors.Arrow; Utils.ShowErrorMessage(res); return; } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { this.Cursor = Cursors.Arrow; } }
private void ShowSearchResults(DownloadSearchCriteria dsc, List<TorrentLink> results) { if (!dummyPageSearch.Visible) return; m_Facade.Clear(); if (dsc.SearchType == DownloadSearchType.Episode) { AnimeEpisodeVM ep = dsc.SearchParameter as AnimeEpisodeVM; ShowEpisodeDetails(ep); } else dummyEpisodeSearch.Visible = false; SetGUIProperty(GuiProperty.Search_Summary, string.Format("{0}", dsc)); foreach (TorrentLink link in results) { GUIListItem item = null; item = new GUIListItem(); string tname = link.TorrentName; if (tname.Length > 50) tname = tname.Substring(0, 50) + "..."; item.Label = string.Format("({0}) {1} ({2})", link.Source, tname, link.Size); item.TVTag = link; m_Facade.Add(item); BaseConfig.MyAnimeLog.Write("TORRENT: " + item.Label); } SetGUIProperty(GuiProperty.Search_ResultDescription, string.Format("{0} {1}", results.Count, results.Count == 1 ? Translation.Result : Translation.Results)); }
void PlayNextEpisodeControlV2_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { try { AnimeEpisodeVM ep = this.DataContext as AnimeEpisodeVM; if (ep == null) { EpisodeExists = false; EpisodeMissing = true; } else { EpisodeExists = true; EpisodeMissing = false; if (ep.ShowEpisodeOverviewInSummary) { TruncatedOverview = true; FullOverview = false; HideOverview = false; } else { TruncatedOverview = false; FullOverview = false; HideOverview = true; } } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
void episodesWorker_DoWork(object sender, DoWorkEventArgs e) { try { AnimeSeriesVM ser = e.Argument as AnimeSeriesVM; List <JMMServerBinary.Contract_AnimeEpisode> rawEps = JMMServerVM.Instance.clientBinaryHTTP.GetAllUnwatchedEpisodes(ser.AnimeSeriesID.Value, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); int i = 0; foreach (JMMServerBinary.Contract_AnimeEpisode raw in rawEps) { i++; AnimeEpisodeVM ep = new AnimeEpisodeVM(raw); ep.SetTvDBInfo(); System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate() { UnwatchedEpisodes.Add(ep); }); if (i == 10) { break; } } } catch (Exception ex) { logger.ErrorException(ex.ToString(), ex); } }
private void CommandBinding_PlayEpisode(object sender, ExecutedRoutedEventArgs e) { Window parentWindow = Window.GetWindow(this); try { AnimeEpisodeVM ep = this.DataContext as AnimeEpisodeVM; if (ep.FilesForEpisode.Count > 0) { bool force = true; if (ep.FilesForEpisode[0].VideoLocal_ResumePosition > 0) { AskResumeVideo ask = new AskResumeVideo(ep.FilesForEpisode[0].VideoLocal_ResumePosition); ask.Owner = Window.GetWindow(this); if (ask.ShowDialog() == true) { force = false; } } MainWindow.videoHandler.PlayVideo(ep.FilesForEpisode[0], force); } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
private void CommandBinding_DeleteFile(object sender, ExecutedRoutedEventArgs e) { Window parentWindow = Window.GetWindow(this); object obj = e.Parameter; if (obj == null) { return; } try { if (obj.GetType() == typeof(VideoDetailedVM)) { VideoDetailedVM vid = obj as VideoDetailedVM; AskDeleteFile dlg = new AskDeleteFile(string.Format(Properties.Resources.DeleteFile_Title, vid.FileName), Properties.Resources.MultipleFiles_ConfirmDelete + "\r\n\r\n" + Properties.Resources.DeleteFile_Confirm, vid.Places); dlg.Owner = Window.GetWindow(this); bool?res = dlg.ShowDialog(); if (res.HasValue && res.Value) { string tresult = string.Empty; this.Cursor = Cursors.Wait; foreach (VideoLocal_PlaceVM lv in dlg.Selected) { string result = JMMServerVM.Instance.clientBinaryHTTP.DeleteVideoLocalPlaceAndFile( lv.VideoLocal_Place_ID); if (result.Length > 0) { tresult += result + "\r\n"; } } if (!string.IsNullOrEmpty(tresult)) { MessageBox.Show(tresult, Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); } AnimeEpisodeVM ep = this.DataContext as AnimeEpisodeVM; if (ep != null) { MainListHelperVM.Instance.UpdateHeirarchy(ep); ep.LocalFileCount--; } DisplayFiles(); } } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { this.Cursor = Cursors.Arrow; } }
public static String GetEpisodeImageAsFileName(AnimeEpisodeVM ep) { string imgFileName = ep.EpisodeImageLocation; BaseConfig.MyAnimeLog.Write("GetEpisodeImageAsFileName:: {0} : {1}", imgFileName, ep); return(imgFileName); }
public void PopulatePlaylistObjects() { PlaylistObjects.Clear(); if (string.IsNullOrEmpty(this.PlaylistItems)) { return; } string[] items = this.PlaylistItems.Split('|'); foreach (string pitem in items) { string[] parms = pitem.Split(';'); if (parms.Length != 2) { continue; } int objType = -1; int objID = -1; if (!int.TryParse(parms[0], out objType)) { continue; } if (!int.TryParse(parms[1], out objID)) { continue; } if ((PlaylistItemType)objType == PlaylistItemType.AnimeSeries) { // get the series JMMServerBinary.Contract_AnimeSeries serContract = JMMServerVM.Instance.clientBinaryHTTP.GetSeries(objID, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (serContract != null) { AnimeSeriesVM ser = new AnimeSeriesVM(serContract); PlaylistObjects.Add(new PlaylistItemVM(this.PlaylistID.Value, PlaylistItemType.AnimeSeries, ser)); } } else { // get the episode JMMServerBinary.Contract_AnimeEpisode epContract = JMMServerVM.Instance.clientBinaryHTTP.GetEpisode(objID, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (epContract != null) { AnimeEpisodeVM ep = new AnimeEpisodeVM(epContract); //ep.SetTvDBInfo(); PlaylistObjects.Add(new PlaylistItemVM(this.PlaylistID.Value, PlaylistItemType.Episode, ep)); } } } SetDependendProperties(); }
void btnPlayNextEp_Click(object sender, RoutedEventArgs e) { if (UnwatchedEpisodes.Count == 0) { return; } try { AnimeEpisodeVM ep = UnwatchedEpisodes[0]; if (ep.IsWatched == 1) { if (UnwatchedEpisodes.Count == 1) { ep = UnwatchedEpisodes[1]; } else { return; } } if (ep.FilesForEpisode.Count == 1) { MainWindow.videoHandler.PlayVideo(ep.FilesForEpisode[0]); } else if (ep.FilesForEpisode.Count > 1) { if (AppSettings.AutoFileSingleEpisode) { VideoDetailedVM vid = MainWindow.videoHandler.GetAutoFileForEpisode(ep); if (vid != null) { MainWindow.videoHandler.PlayVideo(vid); } } else { MainWindow mainwdw = (MainWindow)Window.GetWindow(this); PlayVideosForEpisodeForm frm = new PlayVideosForEpisodeForm(); frm.Owner = mainwdw; frm.Init(ep); bool?result = frm.ShowDialog(); } } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
void btnMarkAllPreviousWatched_Click(object sender, RoutedEventArgs e) { if (lbEpisodes.SelectedItem != null) { AnimeEpisodeVM ep = lbEpisodes.SelectedItem as AnimeEpisodeVM; if (ep == null) { return; } SetWatchedStatusOnSeries(true, ep.EpisodeNumber); } }
private void onFacadeItemSelected(GUIListItem item, GUIControl parent) { //BaseConfig.MyAnimeLog.Write("Facade Item Selected"); // if this is not a message from the facade, exit if (parent != m_Facade && parent != m_Facade.FilmstripLayout) { return; } AnimeEpisodeVM ep = m_Facade.SelectedListItem.TVTag as AnimeEpisodeVM; SetEpisode(ep); }
private void CommandBinding_DeleteFile(object sender, ExecutedRoutedEventArgs e) { Window parentWindow = Window.GetWindow(this); object obj = e.Parameter; if (obj == null) { return; } try { if (obj.GetType() == typeof(VideoDetailedVM)) { VideoDetailedVM vid = obj as VideoDetailedVM; MessageBoxResult res = MessageBox.Show(string.Format(Properties.Resources.MultipleFiles_ConfirmDelete), Properties.Resources.Confirm, MessageBoxButton.YesNo, MessageBoxImage.Warning); if (res == MessageBoxResult.Yes) { this.Cursor = Cursors.Wait; string result = JMMServerVM.Instance.clientBinaryHTTP.DeleteVideoLocalAndFile(vid.VideoLocalID); if (result.Length > 0) { MessageBox.Show(result, Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); } else { // find the entry and remove it AnimeEpisodeVM ep = this.DataContext as AnimeEpisodeVM; if (ep != null) { MainListHelperVM.Instance.UpdateHeirarchy(ep); ep.LocalFileCount--; } DisplayFiles(); } } } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { this.Cursor = Cursors.Arrow; } }
private bool CanUseEpisode(PlaylistVM pl, AnimeEpisodeVM ep) { if (ep.Watched && pl.PlayWatchedBool && ep.HasFiles) { return(true); } if (!ep.Watched && pl.PlayUnwatchedBool && ep.HasFiles) { return(true); } return(false); }
private void CommandBinding_ToggleWatchedStatus(object sender, ExecutedRoutedEventArgs e) { object obj = e.Parameter; if (obj == null) { return; } this.Cursor = Cursors.Wait; this.IsEnabled = false; bool newStatus = false; try { if (obj.GetType() == typeof(VideoDetailedVM)) { VideoDetailedVM vid = obj as VideoDetailedVM; newStatus = !vid.Watched; JMMServerVM.Instance.clientBinaryHTTP.ToggleWatchedStatusOnVideo(vid.VideoLocalID, newStatus, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); MainListHelperVM.Instance.UpdateHeirarchy(vid); } if (obj.GetType() == typeof(AnimeEpisodeVM)) { AnimeEpisodeVM ep = obj as AnimeEpisodeVM; newStatus = !ep.Watched; JMMServerBinary.Contract_ToggleWatchedStatusOnEpisode_Response response = JMMServerVM.Instance.clientBinaryHTTP.ToggleWatchedStatusOnEpisode(ep.AnimeEpisodeID, newStatus, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (!string.IsNullOrEmpty(response.ErrorMessage)) { MessageBox.Show(response.ErrorMessage, Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } MainListHelperVM.Instance.UpdateHeirarchy(response.AnimeEpisode); } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { this.Cursor = Cursors.Arrow; this.IsEnabled = true; } }
public PlaylistItemVM(int playlistID, PlaylistItemType itemType, object playlistItem) { PlaylistID = playlistID; ItemType = itemType; PlaylistItem = playlistItem; if (ItemType == PlaylistItemType.AnimeSeries) Series = PlaylistItem as AnimeSeriesVM; if (ItemType == PlaylistItemType.Episode) { Episode = PlaylistItem as AnimeEpisodeVM; if (MainListHelperVM.Instance.AllSeriesDictionary.ContainsKey(Episode.AnimeSeriesID)) Series = MainListHelperVM.Instance.AllSeriesDictionary[Episode.AnimeSeriesID]; } }
void torrentDetailsWorker_DoWork(object sender, DoWorkEventArgs e) { DetailsContainer details = e.Argument as DetailsContainer; if (details == null) { return; } if (details.SearchCritera != null) { if (details.SearchCritera.SearchType == DownloadSearchType.Episode) { AnimeEpisodeVM ep = details.SearchCritera.SearchParameter as AnimeEpisodeVM; AnimeSeriesVM ser = MainListHelperVM.Instance.GetSeries(ep.AnimeSeriesID); if (ser != null) { e.Result = ser; return; } } if (details.SearchCritera.SearchType == DownloadSearchType.Series) { AniDB_AnimeVM anime = details.SearchCritera.SearchParameter as AniDB_AnimeVM; AnimeSeriesVM ser = MainListHelperVM.Instance.GetSeriesForAnime(anime.AnimeID); if (ser != null) { e.Result = ser; return; } } } // try and find the series foreach (AniDB_AnimeVM anime in AniDB_AnimeVM.BestLevenshteinDistanceMatchesCache(details.TorLink.ClosestAnimeMatchString, 10)) { // get the series for the anime AnimeSeriesVM ser = MainListHelperVM.Instance.GetSeriesForAnime(anime.AnimeID); if (ser != null) { e.Result = ser; return; } } e.Result = null; }
public bool ResumeOrPlay(VideoLocalVM fileToPlay) { try { curEpisode = null; int timeMovieStopped = 0; if (!File.Exists(fileToPlay.FullPath)) { Utils.DialogMsg("Error", "File could not be found!"); return(false); } BaseConfig.MyAnimeLog.Write("Getting time stopped for : {0}", fileToPlay.FullPath); timeMovieStopped = GetTimeStopped(fileToPlay.FullPath); BaseConfig.MyAnimeLog.Write("Time stopped for : {0} - {1}", fileToPlay.FullPath, timeMovieStopped); curFileName = fileToPlay.FullPath; #region Ask user to Resume if (timeMovieStopped > 0) { GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); if (null != dlgYesNo) { dlgYesNo.SetHeading(GUILocalizeStrings.Get(900)); //resume movie? dlgYesNo.SetLine(1, fileToPlay.FileName); dlgYesNo.SetLine(2, GUILocalizeStrings.Get(936) + " " + MediaPortal.Util.Utils.SecondsToHMSString(timeMovieStopped)); dlgYesNo.SetDefaultToYes(true); dlgYesNo.DoModal(GUIWindowManager.ActiveWindow); if (!dlgYesNo.IsConfirmed) // reset resume data in DB { timeMovieStopped = 0; } } } #endregion Play(timeMovieStopped, fileToPlay.DefaultAudioLanguage, fileToPlay.DefaultSubtitleLanguage); return(true); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write("Error inResumeOrPlay : {0}", ex.ToString()); } return(false); }
// ASync method to avoid mediaportal video treatment sleep public void loadPlayingPresetASync(AnimeEpisodeVM curEpisode, string fileName) { // Create an instance of the FFDShowHelper class. FFDShowHelper ffdshowHelper = new FFDShowHelper(); // Create the delegate. AsyncloadPlayingPresetCaller caller = new AsyncloadPlayingPresetCaller(loadPlayingPreset); // Initiate the asychronous call. IAsyncResult result = caller.BeginInvoke(curEpisode, fileName, null, null); Thread.Sleep(0); debug("Main thread " + Thread.CurrentThread.ManagedThreadId + " does some work."); // Call EndInvoke to wait for the asynchronous call to complete, // and to retrieve the results. // string returnValue = caller.EndInvoke(result); // caller.EndInvoke(result); }
void lbVideos_SelectionChanged(object sender, SelectionChangedEventArgs e) { // get detailed video, episode and series info ccDetail.Content = null; ccSeriesDetail.Content = null; if (lbVideos.SelectedItems.Count == 0) { return; } if (lbVideos.SelectedItem == null) { return; } VideoLocalVM vid = lbVideos.SelectedItem as VideoLocalVM; displayingVidID = vid.VideoLocalID; EnableDisableControls(false); try { this.Cursor = Cursors.Wait; ccDetail.Content = vid; // get the episode(s) List <JMMServerBinary.Contract_AnimeEpisode> rawEps = JMMServerVM.Instance.clientBinaryHTTP.GetEpisodesForFile( vid.VideoLocalID, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (rawEps.Count > 0) { AnimeEpisodeVM ep = new AnimeEpisodeVM(rawEps[0]); ccSeriesDetail.Content = ep; } this.Cursor = Cursors.Arrow; } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { this.Cursor = Cursors.Arrow; EnableDisableControls(true); } }
private void CommandBinding_PlayEpisode(object sender, ExecutedRoutedEventArgs e) { Window parentWindow = Window.GetWindow(this); object obj = e.Parameter; if (obj == null) { return; } try { if (obj.GetType() == typeof(AnimeEpisodeVM)) { AnimeEpisodeVM ep = obj as AnimeEpisodeVM; if (ep.FilesForEpisode.Count == 1) { MainWindow.videoHandler.PlayVideo(ep.FilesForEpisode[0]); } else if (ep.FilesForEpisode.Count > 1) { if (AppSettings.AutoFileSingleEpisode) { VideoDetailedVM vid = MainWindow.videoHandler.GetAutoFileForEpisode(ep); if (vid != null) { MainWindow.videoHandler.PlayVideo(vid); } } else { PlayVideosForEpisodeForm frm = new PlayVideosForEpisodeForm(); frm.Owner = parentWindow; frm.Init(ep); bool?result = frm.ShowDialog(); } } } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
private void CommandBinding_PlayEpisode(object sender, ExecutedRoutedEventArgs e) { Window parentWindow = Window.GetWindow(this); try { AnimeEpisodeVM ep = this.DataContext as AnimeEpisodeVM; if (ep.FilesForEpisode.Count > 0) { MainWindow.videoHandler.PlayVideo(ep.FilesForEpisode[0]); } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
public void DisplayFiles() { try { AnimeEpisodeVM ep = this.DataContext as AnimeEpisodeVM; if (ep != null) { ep.RefreshFilesForEpisode(); ep.RefreshAnime(); fileSummary.DataContext = null; fileSummary.DataContext = ep.AniDB_Anime; lbFiles.ItemsSource = ep.FilesForEpisode; } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
public PlaylistItemVM(int playlistID, PlaylistItemType itemType, object playlistItem) { PlaylistID = playlistID; ItemType = itemType; PlaylistItem = playlistItem; if (ItemType == PlaylistItemType.AnimeSeries) { Series = PlaylistItem as AnimeSeriesVM; } if (ItemType == PlaylistItemType.Episode) { Episode = PlaylistItem as AnimeEpisodeVM; if (MainListHelperVM.Instance.AllSeriesDictionary.ContainsKey(Episode.AnimeSeriesID)) { Series = MainListHelperVM.Instance.AllSeriesDictionary[Episode.AnimeSeriesID]; } } }
private void ShowNextEpisode() { AnimeSeriesVM ser = this.DataContext as AnimeSeriesVM; if (ser == null) return; JMMServerBinary.Contract_AnimeEpisode ep = JMMServerVM.Instance.clientBinaryHTTP.GetNextUnwatchedEpisode(ser.AnimeSeriesID.Value, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (ep != null) { AnimeEpisodeVM aniep = new AnimeEpisodeVM(ep); aniep.SetTvDBInfo(); ucNextEpisode.DataContext = aniep; } else { ucNextEpisode.EpisodeExists = false; ucNextEpisode.EpisodeMissing = true; ucNextEpisode.DataContext = null; } }
void btnTvDBLinkAdd_Click(object sender, RoutedEventArgs e) { try { // get the current tvdb link AnimeEpisodeVM ep = this.DataContext as AnimeEpisodeVM; ep.RefreshAnime(); if (ep.AniDB_Anime == null || ep.AniDB_Anime.TvSummary == null || ep.AniDB_Anime.TvSummary.CrossRefTvDBV2 == null || ep.AniDB_Anime.TvSummary.CrossRefTvDBV2.Count == 0) { Utils.ShowErrorMessage(Properties.Resources.EpisodeDetail_TvDBLink); return; } Window wdw = Window.GetWindow(this); this.Cursor = Cursors.Wait; SelectTvDBEpisodeForm frm = new SelectTvDBEpisodeForm(); frm.Owner = wdw; frm.Init(ep, ep.AniDB_Anime); bool?result = frm.ShowDialog(); if (result.Value) { // update info JMMServerBinary.Contract_AnimeEpisode contract = JMMServerVM.Instance.clientBinaryHTTP.GetEpisode( ep.AnimeEpisodeID, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (contract != null) { ep.RefreshAnime(true); ep.Populate(contract); ep.SetTvDBInfo(); } } this.Cursor = Cursors.Arrow; } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
private void ShowEpisodeDetails(AnimeEpisodeVM ep) { dummyEpisodeSearch.Visible = false; AnimeSeriesVM series = JMMServerHelper.GetSeries(ep.AnimeSeriesID); if (series != null && series.AniDB_Anime != null) { SetGUIProperty(GuiProperty.SubGroup_AnimeName, series.AniDB_Anime.FormattedTitle); SetGUIProperty(GuiProperty.SubGroup_EpisodeName, ep.EpisodeNumberAndName); List<GroupVideoQualityVM> videoQualityRecords = new List<GroupVideoQualityVM>(); List<JMMServerBinary.Contract_GroupVideoQuality> summ = new List<Contract_GroupVideoQuality>(JMMServerVM.Instance.clientBinaryHTTP.GetGroupVideoQualitySummary(series.AniDB_Anime.AnimeID)); foreach (JMMServerBinary.Contract_GroupVideoQuality contract in summ) { GroupVideoQualityVM vidQual = new GroupVideoQualityVM(contract); videoQualityRecords.Add(vidQual); } // apply sorting if (videoQualityRecords.Count > 0) { List<SortPropOrFieldAndDirection> sortlist = new List<SortPropOrFieldAndDirection>(); sortlist.Add(new SortPropOrFieldAndDirection("FileCountNormal", true, SortType.eInteger)); videoQualityRecords = Sorting.MultiSort<GroupVideoQualityVM>(videoQualityRecords, sortlist); string fileDetails = ""; foreach (GroupVideoQualityVM gvq in videoQualityRecords) fileDetails += string.Format("{0}({1}/{2}/{3}bit) - {4} Files ({5})", gvq.GroupNameShort, gvq.Resolution, gvq.VideoSource, gvq.VideoBitDepth, gvq.FileCountNormal, gvq.NormalEpisodeNumberSummary) + Environment.NewLine; SetGUIProperty(GuiProperty.SubGroup_FileDetails, fileDetails); } else { ClearGUIProperty(GuiProperty.SubGroup_FileDetails); } dummyEpisodeSearch.Visible = true; } }
public void Init(AnimeEpisodeVM ep, AniDB_AnimeVM anime) { AnimeID = anime.AnimeID; Anime = anime; AnimeEpisode = ep; List<int> uids = new List<int>(); cboSeries.Items.Clear(); foreach (CrossRef_AniDB_TvDBVMV2 xref in Anime.TvSummary.CrossRefTvDBV2) { if (!uids.Contains(xref.TvDBID)) cboSeries.Items.Add(xref); uids.Add(xref.TvDBID); } cboSeries.SelectionChanged += new SelectionChangedEventHandler(cboSeries_SelectionChanged); if (cboSeries.Items.Count > 0) cboSeries.SelectedIndex = 0; }
public void RefreshNewEpisodes() { try { System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate() { NewEpisodes.Clear(); }); List<JMMServerBinary.Contract_AnimeEpisode> epContracts = JMMServerVM.Instance.clientBinaryHTTP.GetEpisodesRecentlyAddedSummary(UserSettingsVM.Instance.DashMetro_NewEpisodes_Items, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); foreach (JMMServerBinary.Contract_AnimeEpisode contract in epContracts) { AnimeEpisodeVM ep = new AnimeEpisodeVM(contract); ep.RefreshAnime(); if (ep.AniDB_Anime == null) ep.RefreshAnime(true); // this might be a new series if (ep.AniDB_Anime != null) { //ep.SetTvDBInfo(); string imageName = ""; if (AppSettings.DashMetroImageType == DashboardMetroImageType.Fanart) imageName = ep.AnimeSeries.AniDB_Anime.FanartPath; else imageName = ep.AnimeSeries.AniDB_Anime.PosterPathWithRandoms; NewEpisodeTile tile = new NewEpisodeTile() { EpisodeDetails = ep.EpisodeNumberAndName, AnimeName = ep.AnimeSeries.SeriesName, Picture = imageName, AnimeSeries = ep.AnimeSeries, TileSize = "Large", Height = 100 }; System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate() { NewEpisodes.Add(tile); }); } } OnFinishedProcess(new FinishedProcessEventArgs(DashboardMetroProcessType.NewEpisodes)); } catch (Exception ex) { logger.ErrorException(ex.ToString(), ex); } finally { } }
public void RefreshContinueWatching() { try { System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate() { ContinueWatching.Clear(); }); DateTime start = DateTime.Now; List<JMMServerBinary.Contract_AnimeEpisode> epContracts = JMMServerVM.Instance.clientBinaryHTTP.GetContinueWatchingFilter(JMMServerVM.Instance.CurrentUser.JMMUserID.Value, UserSettingsVM.Instance.DashMetro_WatchNext_Items); TimeSpan ts = DateTime.Now - start; logger.Trace("Dashboard Time: RefreshEpsWatchNext_Recent: contracts: {0}", ts.TotalMilliseconds); start = DateTime.Now; List<AnimeEpisodeVM> epList = new List<AnimeEpisodeVM>(); foreach (JMMServerBinary.Contract_AnimeEpisode contract in epContracts) { AnimeEpisodeVM ep = new AnimeEpisodeVM(contract); string animename = ep.AnimeName; // just do this to force anidb anime detail record to be loaded ep.RefreshAnime(); if (ep.AniDB_Anime == null) ep.RefreshAnime(true); // this might be a new series epList.Add(ep); } ts = DateTime.Now - start; logger.Trace("Dashboard Time: RefreshEpsWatchNext_Recent: episode details: {0}", ts.TotalMilliseconds); System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate() { foreach (AnimeEpisodeVM ep in epList) { string imageName = ""; if (AppSettings.DashMetroImageType == DashboardMetroImageType.Fanart) imageName = ep.AniDB_Anime.FanartPathPreferThumb; else imageName = ep.AniDB_Anime.PosterPathWithRandoms; ContinueWatching.Add(new ContinueWatchingTile() { EpisodeDetails = ep.EpisodeNumberAndName, AnimeName = ep.AnimeSeries.SeriesName, Picture = imageName, AnimeSeries = ep.AnimeSeries, UnwatchedEpisodes = ep.AnimeSeries.UnwatchedEpisodeCount, TileSize = "Large", Height = 100 }); } ViewContinueWatching.Refresh(); }); OnFinishedProcess(new FinishedProcessEventArgs(DashboardMetroProcessType.ContinueWatching)); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { } }
public void PopulatePlaylistObjects() { PlaylistObjects.Clear(); if (string.IsNullOrEmpty(this.PlaylistItems)) return; string[] items = this.PlaylistItems.Split('|'); foreach (string pitem in items) { string[] parms = pitem.Split(';'); if (parms.Length != 2) continue; int objType = -1; int objID = -1; if (!int.TryParse(parms[0], out objType)) continue; if (!int.TryParse(parms[1], out objID)) continue; if ((PlaylistItemType)objType == PlaylistItemType.AnimeSeries) { AnimeSeriesVM ser; if (MainListHelperVM.Instance.AllSeriesDictionary.TryGetValue(objID, out ser) == false) { // get the series JMMServerBinary.Contract_AnimeSeries serContract = JMMServerVM.Instance.clientBinaryHTTP.GetSeries(objID, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (serContract != null) { ser = new AnimeSeriesVM(serContract); MainListHelperVM.Instance.AllSeriesDictionary[objID] = ser; } } if (ser != null) PlaylistObjects.Add(new PlaylistItemVM(this.PlaylistID.Value, PlaylistItemType.AnimeSeries, ser)); } else { // get the episode JMMServerBinary.Contract_AnimeEpisode epContract = JMMServerVM.Instance.clientBinaryHTTP.GetEpisode(objID, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (epContract != null) { AnimeEpisodeVM ep = new AnimeEpisodeVM(epContract); //ep.SetTvDBInfo(); PlaylistObjects.Add(new PlaylistItemVM(this.PlaylistID.Value, PlaylistItemType.Episode, ep)); } } } SetDependendProperties(); }
private void CommandBinding_PlayEpisode(object sender, ExecutedRoutedEventArgs e) { Window parentWindow = Window.GetWindow(this); object obj = e.Parameter; if (obj == null) return; try { if (obj.GetType() == typeof(PlaylistItemVM)) { PlaylistItemVM pli = obj as PlaylistItemVM; AnimeEpisodeVM ep = null; if (pli.ItemType == JMMClient.PlaylistItemType.Episode) { ep = pli.PlaylistItem as AnimeEpisodeVM; } if (pli.ItemType == JMMClient.PlaylistItemType.AnimeSeries) { AnimeSeriesVM ser = pli.PlaylistItem as AnimeSeriesVM; if (ser == null) return; JMMServerBinary.Contract_AnimeEpisode contract = JMMServerVM.Instance.clientBinaryHTTP.GetNextUnwatchedEpisode(ser.AnimeSeriesID.Value, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (contract != null) ep = new AnimeEpisodeVM(contract); } if (ep == null) return; ep.SetTvDBInfo(); if (ep.FilesForEpisode.Count == 1) { bool force = true; if (MainWindow.videoHandler.DefaultPlayer.Player.ToString() != Enum.GetName(typeof(VideoPlayer), VideoPlayer.WindowsDefault)) { if (ep.FilesForEpisode[0].VideoLocal_ResumePosition > 0) { AskResumeVideo ask = new AskResumeVideo(ep.FilesForEpisode[0].VideoLocal_ResumePosition); ask.Owner = Window.GetWindow(this); if (ask.ShowDialog() == true) force = false; } } MainWindow.videoHandler.PlayVideo(ep.FilesForEpisode[0], force); } else if (ep.FilesForEpisode.Count > 1) { if (AppSettings.AutoFileSingleEpisode) { VideoDetailedVM vid = MainWindow.videoHandler.GetAutoFileForEpisode(ep); if (vid != null) { bool force = true; if (MainWindow.videoHandler.DefaultPlayer.Player.ToString() != Enum.GetName(typeof(VideoPlayer), VideoPlayer.WindowsDefault)) { if (vid.VideoLocal_ResumePosition > 0) { AskResumeVideo ask = new AskResumeVideo(vid.VideoLocal_ResumePosition); ask.Owner = Window.GetWindow(this); if (ask.ShowDialog() == true) force = false; } } MainWindow.videoHandler.PlayVideo(vid, force); } } else { PlayVideosForEpisodeForm frm = new PlayVideosForEpisodeForm(); frm.Owner = parentWindow; frm.Init(ep); frm.ShowDialog(); } } } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
private bool CanUseEpisode(PlaylistVM pl, AnimeEpisodeVM ep) { if (ep.Watched && pl.PlayWatchedBool && ep.HasFiles) return true; if (!ep.Watched && pl.PlayUnwatchedBool && ep.HasFiles) return true; return false; }
public VideoDetailedVM GetAutoFileForEpisode(AnimeEpisodeVM ep) { try { if (ep.FilesForEpisode == null) return null; if (ep.FilesForEpisode.Count == 1) return ep.FilesForEpisode[0]; // find the previous episode JMMServerBinary.Contract_AnimeEpisode raw = JMMServerVM.Instance.clientBinaryHTTP.GetPreviousEpisodeForUnwatched(ep.AnimeSeriesID, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (raw == null) { List<VideoDetailedVM> vids = ep.FilesForEpisode; // just use the best quality file List<SortPropOrFieldAndDirection> sortCriteria = new List<SortPropOrFieldAndDirection>(); sortCriteria.Add(new SortPropOrFieldAndDirection("OverallVideoSourceRanking", true, SortType.eInteger)); vids = Sorting.MultiSort<VideoDetailedVM>(vids, sortCriteria); return vids[0]; } else { List<VideoDetailedVM> vids = ep.FilesForEpisode; // sort by quality List<SortPropOrFieldAndDirection> sortCriteria = new List<SortPropOrFieldAndDirection>(); sortCriteria.Add(new SortPropOrFieldAndDirection("OverallVideoSourceRanking", true, SortType.eInteger)); vids = Sorting.MultiSort<VideoDetailedVM>(vids, sortCriteria); if (AppSettings.AutoFileSubsequent == (int)AutoFileSubsequentType.BestQuality) { // just use the best quality file return vids[0]; } else { // otherwise look at which groups files they watched previously AnimeEpisodeVM previousEp = new AnimeEpisodeVM(raw); List<VideoDetailedVM> vidsPrevious = previousEp.FilesForEpisode; foreach (VideoDetailedVM vidPrev in vidsPrevious) { if (vidPrev.Watched) { foreach (VideoDetailedVM vid in vids) { if (vid.AniDB_Anime_GroupName.Equals(vidPrev.AniDB_Anime_GroupName, StringComparison.InvariantCultureIgnoreCase)) { return vid; } } } } // if none played??? use the best quality return vids[0]; } } } catch (Exception ex) { logger.ErrorException(ex.ToString(), ex); } return null; }
void episodesWorker_DoWork(object sender, DoWorkEventArgs e) { try { AnimeSeriesVM ser = e.Argument as AnimeSeriesVM; List<JMMServerBinary.Contract_AnimeEpisode> rawEps = JMMServerVM.Instance.clientBinaryHTTP.GetAllUnwatchedEpisodes(ser.AnimeSeriesID.Value, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); int i = 0; foreach (JMMServerBinary.Contract_AnimeEpisode raw in rawEps) { i++; AnimeEpisodeVM ep = new AnimeEpisodeVM(raw); ep.SetTvDBInfo(); System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate() { UnwatchedEpisodes.Add(ep); }); if (i == 10) break; } } catch (Exception ex) { logger.ErrorException(ex.ToString(), ex); } }
public AnimeSeriesVM GetSeriesForEpisode(AnimeEpisodeVM ep) { try { AnimeSeriesVM thisSeries = null; foreach (AnimeSeriesVM ser in MainListHelperVM.Instance.AllSeries) { if (ser.AnimeSeriesID == ep.AnimeSeriesID) { thisSeries = ser; break; } } return thisSeries; } catch (Exception ex) { Utils.ShowErrorMessage(ex); } return null; }
public void UpdateHeirarchy(AnimeEpisodeVM ep) { try { // update the episode first JMMServerBinary.Contract_AnimeEpisode contract = JMMServerVM.Instance.clientBinaryHTTP.GetEpisode(ep.AnimeEpisodeID, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); UpdateHeirarchy(contract); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
void lbVideos_SelectionChanged(object sender, SelectionChangedEventArgs e) { // get detailed video, episode and series info ccDetail.Content = null; ccSeriesDetail.Content = null; if (lbVideos.SelectedItems.Count == 0) return; if (lbVideos.SelectedItem == null) return; VideoLocalVM vid = lbVideos.SelectedItem as VideoLocalVM; displayingVidID = vid.VideoLocalID; EnableDisableControls(false); try { this.Cursor = Cursors.Wait; ccDetail.Content = vid; // get the episode(s) List<JMMServerBinary.Contract_AnimeEpisode> rawEps = JMMServerVM.Instance.clientBinaryHTTP.GetEpisodesForFile( vid.VideoLocalID, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); if (rawEps.Count > 0) { AnimeEpisodeVM ep = new AnimeEpisodeVM(rawEps[0]); ccSeriesDetail.Content = ep; } this.Cursor = Cursors.Arrow; } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { this.Cursor = Cursors.Arrow; EnableDisableControls(true); } }
public void RefreshEpsWatchNext_Recent() { try { System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate() { EpsWatchNext_Recent.Clear(); }); DateTime start = DateTime.Now; List<JMMServerBinary.Contract_AnimeEpisode> epContracts = JMMServerVM.Instance.clientBinaryHTTP.GetContinueWatchingFilter(JMMServerVM.Instance.CurrentUser.JMMUserID.Value, UserSettingsVM.Instance.Dash_WatchNext_Items); TimeSpan ts = DateTime.Now - start; logger.Trace("Dashboard Time: RefreshEpsWatchNext_Recent: contracts: {0}", ts.TotalMilliseconds); start = DateTime.Now; List<AnimeEpisodeVM> epList = new List<AnimeEpisodeVM>(); foreach (JMMServerBinary.Contract_AnimeEpisode contract in epContracts) { AnimeEpisodeVM ep = new AnimeEpisodeVM(contract); string animename = ep.AnimeName; // just do this to force anidb anime detail record to be loaded if (ep.AniDB_Anime == null) ep.RefreshAnime(true); // this might be a new series ts = DateTime.Now - start; logger.Trace("Dashboard Time: RefreshEpsWatchNext_Recent: episode details: Stage 1: {0}", ts.TotalMilliseconds); ep.RefreshAnime(); ts = DateTime.Now - start; logger.Trace("Dashboard Time: RefreshEpsWatchNext_Recent: episode details: Stage 2: {0}", ts.TotalMilliseconds); ep.SetTvDBInfo(); ts = DateTime.Now - start; logger.Trace("Dashboard Time: RefreshEpsWatchNext_Recent: episode details: Stage 3: {0}", ts.TotalMilliseconds); epList.Add(ep); } ts = DateTime.Now - start; logger.Trace("Dashboard Time: RefreshEpsWatchNext_Recent: episode details: {0}", ts.TotalMilliseconds); System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate() { foreach (AnimeEpisodeVM ep in epList) { EpsWatchNext_Recent.Add(ep); } ViewEpsWatchNext_Recent.Refresh(); }); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { } }
public void RefreshRecentAdditions(RecentAdditionsType addType) { try { System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate() { RecentAdditions.Clear(); }); if (addType == RecentAdditionsType.Episode) { List<JMMServerBinary.Contract_AnimeEpisode> epContracts = JMMServerVM.Instance.clientBinaryHTTP.GetEpisodesRecentlyAdded(UserSettingsVM.Instance.Dash_RecentAdditions_Items, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate() { foreach (JMMServerBinary.Contract_AnimeEpisode contract in epContracts) { AnimeEpisodeVM ep = new AnimeEpisodeVM(contract); ep.RefreshAnime(); if (ep.AniDB_Anime == null) ep.RefreshAnime(true); // this might be a new series if (ep.AniDB_Anime != null) { ep.SetTvDBInfo(); RecentAdditions.Add(ep); } } ViewRecentAdditions.Refresh(); }); } else { List<JMMServerBinary.Contract_AnimeSeries> serContracts = JMMServerVM.Instance.clientBinaryHTTP.GetSeriesRecentlyAdded(UserSettingsVM.Instance.Dash_RecentAdditions_Items, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate() { foreach (JMMServerBinary.Contract_AnimeSeries contract in serContracts) { AnimeSeriesVM ser = new AnimeSeriesVM(contract); RecentAdditions.Add(ser); } ViewRecentAdditions.Refresh(); }); } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { } }
private void UpdateGroupAndSeriesForEpisode(AnimeEpisodeVM ep) { try { // update the attached series JMMServerBinary.Contract_AnimeSeries serContract = JMMServerVM.Instance.clientBinaryHTTP.GetSeries(ep.AnimeSeriesID, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); foreach (AnimeSeriesVM ser in MainListHelperVM.Instance.AllSeries) { if (ser.AnimeSeriesID == serContract.AnimeSeriesID) { ser.Populate(serContract); // TODO update the episode list break; } } List<JMMServerBinary.Contract_AnimeGroup> grps = JMMServerVM.Instance.clientBinaryHTTP.GetAllGroupsAboveSeries(ep.AnimeSeriesID, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); foreach (AnimeGroupVM grp in MainListHelperVM.Instance.AllGroups) { foreach (JMMServerBinary.Contract_AnimeGroup grpContract in grps) { if (grp.AnimeGroupID.Value == grpContract.AnimeGroupID) { grp.Populate(grpContract); break; } } } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
public void Init(AnimeEpisodeVM episode) { this.DataContext = episode; }
public void RefreshRecentlyWatchedEps() { try { System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate() { EpsWatchedRecently.Clear(); }); List<JMMServerBinary.Contract_AnimeEpisode> epContracts = JMMServerVM.Instance.clientBinaryHTTP.GetEpisodesRecentlyWatched(UserSettingsVM.Instance.Dash_RecentlyWatchedEp_Items, JMMServerVM.Instance.CurrentUser.JMMUserID.Value); System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate() { foreach (JMMServerBinary.Contract_AnimeEpisode contract in epContracts) { AnimeEpisodeVM ep = new AnimeEpisodeVM(contract); ep.RefreshAnime(); if (ep.AniDB_Anime == null) ep.RefreshAnime(true); // this might be a new series if (ep.AniDB_Anime != null && JMMServerVM.Instance.CurrentUser.EvaluateAnime(ep.AniDB_Anime)) { ep.SetTvDBInfo(); EpsWatchedRecently.Add(ep); } } ViewEpsWatchedRecently.Refresh(); }); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { } }