Esempio n. 1
0
 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);
         AnimeSeriesVM ser = AllSeriesDictionary.SureGet(serContract.AnimeSeriesID);
         if (ser != null)
         {
             ser.Populate(serContract);
             // TODO update the episode list
         }
         List <JMMServerBinary.Contract_AnimeGroup> grps = JMMServerVM.Instance.clientBinaryHTTP.GetAllGroupsAboveSeries(ep.AnimeSeriesID, JMMServerVM.Instance.CurrentUser.JMMUserID.Value);
         foreach (JMMServerBinary.Contract_AnimeGroup grpContract in grps)
         {
             AnimeGroupVM agrp = AllGroupsDictionary.SureGet(grpContract.AnimeGroupID);
             agrp?.Populate(grpContract);
             agrp?.PopulateSerieInfo(AllGroupsDictionary, AllSeriesDictionary);
         }
     }
     catch (Exception ex)
     {
         Utils.ShowErrorMessage(ex);
     }
 }
Esempio n. 2
0
        public void UpdateHeirarchy(AnimeSeriesVM ser)
        {
            try
            {
                // update the attached series
                // refresh the data
                ser.RefreshBase();
                ser.AniDB_Anime.Detail.RefreshBase();

                List <JMMServerBinary.Contract_AnimeGroup> grps = JMMServerVM.Instance.clientBinaryHTTP.GetAllGroupsAboveSeries(ser.AnimeSeriesID.Value,
                                                                                                                                JMMServerVM.Instance.CurrentUser.JMMUserID.Value);
                foreach (JMMServerBinary.Contract_AnimeGroup grpContract in grps)
                {
                    AnimeGroupVM agrp = AllGroupsDictionary.SureGet(grpContract.AnimeGroupID);
                    agrp?.Populate(grpContract);
                    agrp?.PopulateSerieInfo(AllGroupsDictionary, AllSeriesDictionary);
                }
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }