//public WebTVJSON FindNext() //{ // long time = DateTime.Now.Ticks; // for (int i = 0; i < TV.Length; i++) // if (TV[i].Hourly.DateJSON.Ticks > time) // return TV[i]; // return null; //} //public WebTVJSON FindTitle(string title) //{ // for (int i = 0; i < TV.Length; i++) // if (TV[i].Hourly.Title == title) // return TV[i]; // return null; //} public WebTV_Hourly[] FindInfo() { WebTV_Hourly[] temp = new WebTV_Hourly[TV.Length]; for (int i = 0; i < TV.Length; i++) { temp[i] = TV[i].Hourly; } return(temp); }
public WebTVJSON(WebTVJSON webtvjson) { Hourly = webtvjson.Hourly; Note = webtvjson.Note; Social = webtvjson.Social; Media = new WebTV_Media(); Media.VideoPlayer = webtvjson.Media.VideoPlayer; Media.Source = webtvjson.Media.Source; Media.StartSeconds = (int)(new TimeSpan(DateTime.Now.Ticks - webtvjson.Hourly.DateJSON.Ticks + new TimeSpan(0, 0, webtvjson.Media.StartSeconds).Ticks).TotalSeconds); Media.Duration = webtvjson.Media.Duration - Media.StartSeconds; Media.Quality = webtvjson.Media.Quality; }
public static WebTV_Media Current_Media(WebTV_Channel channel) { WebTV_Hourly hourly = channel.Current; if (hourly != null) { return(hourly.Current); } else { return(null); } }
public static WebTV_Media Next_Media(WebTV_Channel channel) { WebTV_Hourly hourly = channel.Current; WebTV_Media media = null; if (hourly != null) { media = hourly.Next; } if (media == null) { hourly = channel.Next; media = hourly.First; } return(media); }
public void WebTV_Hourly(string[] str) { if (str.Length < 2) { return; } string channelname = str[1]; WebTV_Channel channel = WebTV_Singleton.Find(channelname); WebTV_Hourly hourly = channel.Current; Add(new MsgJSON_Object("HOURLY", hourly)); //************************************** //Channel channel = Channels.Find(str[1]); //if (channel == null) return; //Add(new MsgJSON_Object("HOURLY", channel.FindInfo())); }
public static void Save_Hourly(WebTV_Hourly hourly) { SaveJSON <WebTV_Hourly>(hourly, address_WebTV + @"Hourly/" + hourly.Channel + @"/" + hourly.Name + Info.extension); }