Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Publication,DatePublication")] Shouts shouts)
        {
            if (id != shouts.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shouts);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShoutsExists(shouts.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(shouts));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Publication,DatePublication")] Shouts shouts)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shouts);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shouts));
        }
Exemplo n.º 3
0
        void shoutsWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            AnimeSeriesVM            ser        = e.Argument as AnimeSeriesVM;
            List <Trakt_ShoutUserVM> tempShouts = new List <Trakt_ShoutUserVM>();

            try
            {
                System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate()
                {
                    Shouts.Clear();
                });

                // get shouts from trakt
                List <JMMServerBinary.Contract_Trakt_ShoutUser> rawShouts = JMMServerVM.Instance.clientBinaryHTTP.GetTraktShoutsForAnime(ser.AniDB_ID);
                foreach (JMMServerBinary.Contract_Trakt_ShoutUser contract in rawShouts)
                {
                    Trakt_ShoutUserVM shout = new Trakt_ShoutUserVM(contract);

                    shout.DelayedUserImage = @"/Images/blankposter.png";
                    System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate()
                    {
                        Shouts.Add(shout);
                    });

                    imagesToDownload.Add(shout);
                }

                // get recommendations from AniDB
                List <JMMServerBinary.Contract_AniDB_Recommendation> rawRecs = JMMServerVM.Instance.clientBinaryHTTP.GetAniDBRecommendations(ser.AniDB_ID);
                foreach (JMMServerBinary.Contract_AniDB_Recommendation contract in rawRecs)
                {
                    AniDB_RecommendationVM rec = new AniDB_RecommendationVM(contract);

                    rec.DelayedUserImage = @"/Images/blankposter.png";
                    System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate()
                    {
                        Shouts.Add(rec);
                    });

                    imagesToDownload.Add(rec);
                }
            }
            catch (Exception ex)
            {
                logger.ErrorException(ex.ToString(), ex);
            }
        }
Exemplo n.º 4
0
        private void RefreshData()
        {
            AnimeSeriesVM ser = this.DataContext as AnimeSeriesVM;

            if (ser == null)
            {
                return;
            }

            ser.RefreshBase();

            UnwatchedEpisodeCount = ser.UnwatchedEpisodeCount;

            UnwatchedEpisodes.Clear();
            Recommendations.Clear();
            Shouts.Clear();

            RefreshUnwatchedEpisodes();
        }