Ejemplo n.º 1
0
 public void RefreshUI()
 {
     if (ResourceManager.instance != null)
     {
         ShowResource.Show(Menu_Gold_Text, ResourceManager.instance.getResourceNeed(TypeOfResource.Type.Gold));
         ShowResource.Show(Daily_Gold_Text, ResourceManager.instance.getResourceNeed(TypeOfResource.Type.Gold));
     }
 }
Ejemplo n.º 2
0
        private static Series MapSeries(ShowResource show)
        {
            var series = new Series();

            series.TvdbId = show.TvdbId;

            if (show.TvRageId.HasValue)
            {
                series.TvRageId = show.TvRageId.Value;
            }

            if (show.TvMazeId.HasValue)
            {
                series.TvMazeId = show.TvMazeId.Value;
            }

            series.ImdbId     = show.ImdbId;
            series.Title      = show.Title;
            series.CleanTitle = Parser.Parser.CleanSeriesTitle(show.Title);
            series.SortTitle  = SeriesTitleNormalizer.Normalize(show.Title, show.TvdbId);

            if (show.FirstAired != null)
            {
                series.FirstAired = DateTime.Parse(show.FirstAired).ToUniversalTime();
                series.Year       = series.FirstAired.Value.Year;
            }

            series.Overview = show.Overview;

            if (show.Runtime != null)
            {
                series.Runtime = show.Runtime.Value;
            }

            series.Network = show.Network;

            if (show.TimeOfDay != null)
            {
                series.AirTime = string.Format("{0:00}:{1:00}", show.TimeOfDay.Hours, show.TimeOfDay.Minutes);
            }

            series.TitleSlug = show.Slug;
            series.Status    = MapSeriesStatus(show.Status);
            series.Ratings   = MapRatings(show.Rating);
            series.Genres    = show.Genres;

            if (show.ContentRating.IsNotNullOrWhiteSpace())
            {
                series.Certification = show.ContentRating.ToUpper();
            }

            series.Actors    = show.Actors.Select(MapActors).ToList();
            series.Seasons   = show.Seasons.Select(MapSeason).ToList();
            series.Images    = show.Images.Select(MapImage).ToList();
            series.Monitored = true;

            return(series);
        }
Ejemplo n.º 3
0
        private Series MapSearchResult(ShowResource show)
        {
            var series = _seriesService.FindByTvdbId(show.TvdbId);

            if (series == null)
            {
                series = MapSeries(show);
            }

            return(series);
        }