public static void SetSeasonalAnimeModelData(this MiruAnimeModel animeModel, Anime animeInfo, AnimeSubEntry seasonEntry)
 {
     animeModel.MalId            = animeInfo.MalId;
     animeModel.Broadcast        = animeInfo.Broadcast ?? animeInfo.Aired.From.ToString();
     animeModel.Title            = animeInfo.Title;
     animeModel.ImageURL         = animeInfo.ImageURL;
     animeModel.LocalImagePath   = animeInfo.MalId.ToString();
     animeModel.URL              = seasonEntry.URL;
     animeModel.IsOnWatchingList = false;
     animeModel.CurrentlyAiring  = true;
     animeModel.Type             = animeInfo.Type;
 }
 public static void SetAiringAnimeModelData(this MiruAnimeModel animeModel, Anime animeInfo, AnimeListEntry animeListEntry)
 {
     animeModel.MalId            = animeInfo.MalId;
     animeModel.Broadcast        = animeInfo.Broadcast ?? animeInfo?.Aired?.From.ToString();
     animeModel.Title            = animeInfo.Title;
     animeModel.ImageURL         = animeInfo.ImageURL;
     animeModel.LocalImagePath   = animeInfo.MalId.ToString();
     animeModel.TotalEpisodes    = animeListEntry.TotalEpisodes;
     animeModel.URL              = animeListEntry.URL;
     animeModel.WatchedEpisodes  = animeListEntry.WatchedEpisodes;
     animeModel.IsOnWatchingList = true;
     animeModel.CurrentlyAiring  = animeListEntry.AiringStatus == AiringStatus.Airing;
     animeModel.Type             = animeInfo.Type;
 }
        public static void ConvertJstBroadcastTimeToSelectedTimeZone(this MiruAnimeModel anime,
                                                                     TimeZoneInfo selectedTimeZone)
        {
            if (!anime.JSTBroadcastTime.HasValue)
            {
                anime.LocalBroadcastTime = DateTime.Today;
                return;
            }
            // covert JST to UTC
            var broadcastTimeInSelectedTimeZone = TimeZoneInfo.ConvertTimeToUtc(anime.JSTBroadcastTime.Value,
                                                                                TimeZoneInfo.FindSystemTimeZoneById("Tokyo Standard Time"));

            // get the UTC offset for the selected time zone
            var utcOffset = selectedTimeZone.GetUtcOffset(DateTime.UtcNow);

            // return Japanese broadcast time converted to selected time zone
            anime.LocalBroadcastTime = broadcastTimeInSelectedTimeZone.Add(utcOffset);
        }