public ArchiveMovie(TVMovie movie) { this.Name = movie.TrailerSearch; this.YouTube = movie.YouTube; if (movie.Title.Length > 300) { this.Title = movie.Title.Substring(0, 290); } else { this.Title = movie.Title; } if (movie.Station.Length > 50) { this.Station = movie.Station.Substring(0, 40); } else { this.Station = movie.Station; } }
//for admin public FrontYouTube(TVMovie movie) { this.title = movie.TrailerSearch; this.guidId = movie.ID.ToString(); this.videoId = movie.YouTube.VideoID; this.top = movie.YouTube.top_; this.left = movie.YouTube.left_; string rating = movie.Rating.Replace(",", ""); rating = rating.Replace(".", ""); if (rating == "00") { rating = "0"; } this.count = (rating == "0")? "60" : rating; try{ this.countValue = Int32.Parse(rating); } catch { this.countValue = 0; } this.playAt = movie.PlayAt; }
public void SetYoutube(TVMovie movie) { this.YouTube = movie.YouTube; }
public FrontYouTube(TVMovie movie, List <DateTime> dates) { //var hour = movie.PlayAt.Hour; this.guidId = movie.ID.ToString(); this.tags = movie.getTags(); this.playAt = movie.PlayAt; this.isSong = false; var dateTimeFormats = new CultureInfo("pl-PL").DateTimeFormat; var day = movie.PlayAt.ToString("dddd", dateTimeFormats); if (day == DateTime.Now.ToString("dddd", dateTimeFormats)) { day = "dzisiaj"; } string another = ""; string rating = movie.Rating.Replace(",", "").Trim(); rating = rating.Replace(".", "").Trim(); //int frontCount = Int32.Parse(rating); if (rating == "00") { rating = "0"; } var hashDates = new HashSet <DateTime>(dates).ToList(); foreach (var date in hashDates) { var daya = date.ToString("dddd", dateTimeFormats); if (daya == DateTime.Now.ToString("dddd", dateTimeFormats)) { daya = "dzisiaj"; } var houra = date.ToString("HH:mm"); another += $"{daya} godz. {houra}||"; } var inTime = (movie.PlayAt - DateTime.Now).TotalMinutes; var inHour = ""; if (inTime > 0) { var hours = Convert.ToInt32(Math.Floor(inTime / 60)); var min = Convert.ToInt32(Math.Floor(inTime % 60)); //var dateStart = new DateTime(0,0,0,0,0,0); //var inDate = dateStart.AddMinutes(inTime).ToString("HH:mm"); inHour = $"za {hours}h {min}min"; } else { inHour = "trwa"; } var hour = movie.PlayAt.ToString("HH:mm"); var title = $"\"{movie.Title}\"||{day} godz. {hour}||{another}{movie.Station}||[{inHour}]"; this.title = title; this.videoId = movie.YouTube.VideoID; this.top = movie.YouTube.top_; this.left = movie.YouTube.left_; this.count = (rating == "0")? "60" : rating; try { this.countValue = Int32.Parse(rating); } catch (Exception ex) { this.countValue = 0; } }