Esempio n. 1
0
        public EpisodeViewModel(String showId)
        {
            Debug.WriteLine("EpisodeViewModel Loaded");

            this.SelectedShowId = showId;
            this.FilterThisArray = "SeasonCollection";
            _loadedShow = MainWindowViewModel.SerieManager.TvSeries.Find(x => x.TmdbId == SelectedShowId);
            SelectedName = _loadedShow.Title;
            ShowImage = new BitmapImage(_loadedShow.ImageUri ?? App.PlaceHolder);
            
            PlayCommand = new DelegateCommand(o => PlaySelectedEpisode());
        }
Esempio n. 2
0
        protected Show LoadUpAShow(String fileName, String filePath, int showSeasonNr, int showEpisodeNr, String tvSerieName)
        {
            var tmpTvSerieName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(tvSerieName);

            if (String.IsNullOrEmpty(tmpTvSerieName))
                return null;

            var episode = new Episode(showEpisodeNr, filePath);
            var season = new Season(showSeasonNr);
            season.Episodes.Add(episode);
            var show = new Show(tmpTvSerieName);
            show.Seasons.Add(season);

            return show;
        }
Esempio n. 3
0
        private String LoadUpNextAirDate(Show show)
        {
            var nextEpisode = show.Seasons.SelectMany(season => season.Episodes)
                .OrderBy(episode => episode.AirDate)
                .FirstOrDefault(episode => !String.IsNullOrEmpty(episode.AirDate) && DateTime.Parse(episode.AirDate) > DateTime.Now);

            if(nextEpisode != null)
                return "Next Episode: "+DateTime.Parse(nextEpisode.AirDate).ToString("D");

            return "Next Episode: Havn't found a new air date";
        }