Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string streamURL=Utils.GetStreamURL();
     ServiceInterface server = new ServiceInterface();
     if (Request.QueryString["idTvGroup"] != null)
     {
       AddHeader("Tv MiniEPG for [" + Request.QueryString["groupName"] + "]","");
       List<WebMiniEPG> channels=server.GetTvMiniEPGForGroup(Int32.Parse(Request.QueryString["idTvGroup"]));
       foreach (WebMiniEPG chan in channels)
     AddItem(chan.name, chan.epgNow.startTime.ToString() + "-" + chan.epgNow.endTime.ToString() + " " + chan.epgNow.title, streamURL + "/Streamer.aspx?idChannel=" + chan.idChannel.ToString() + "&idProfile=" + Request.QueryString["idProfile"]);
     }
     else if (Request.QueryString["idRadioGroup"] != null)
     {
       AddHeader("Radio MiniEPG for [" + Request.QueryString["groupName"] + "]","");
       List<WebMiniEPG> channels = server.GetRadioMiniEPGForGroup(Int32.Parse(Request.QueryString["idRadioGroup"]));
       foreach (WebMiniEPG chan in channels)
     AddItem(chan.name, chan.epgNow.startTime.ToString() + "-" + chan.epgNow.endTime.ToString() + " " + chan.epgNow.title, streamURL + "/Streamer.aspx?idChannel=" + chan.idChannel.ToString() + "&idProfile=" + Request.QueryString["idProfile"]);
     }
     else if (Request.QueryString["recordings"] != null)
     {
       AddHeader("Recordings","");
       List<WebRecording> recs = server.GetAllRecordings("");
       foreach (WebRecording rec in recs)
     AddItem(rec.title,rec.description,streamURL + "/Streamer.aspx?idRecording=" + rec.idRecording.ToString() + "&idProfile=" + Request.QueryString["idProfile"]);
     }
     else if (Request.QueryString["movies"] != null)
     {
       AddHeader("Movies","");
       List<WebMovie> movies=server.GetAllMovies("");
       foreach (WebMovie m in movies)
     AddItem(m.title,m.plot,streamURL + "/Streamer.aspx?idMovie=" + m.idMovie.ToString() + "&idProfile=" + Request.QueryString["idProfile"]);
     }
     else if (Request.QueryString["music"] != null)
     {
       AddHeader("Music","");
       List<WebMusicTrack> tracks=server.GetAllMusicTracks("","","");
       foreach (WebMusicTrack track in tracks)
     AddItem(track.album,track.title,streamURL + "/Streamer.aspx?idMusicTrack=" + track.idTrack.ToString() + "&idProfile=" + Request.QueryString["idProfile"]);
     }
     else if (Request.QueryString["tvseries"] != null)
     {
       AddHeader("TV Series","");
       List<WebSeries> series=server.GetAllTvSeries("","");
       foreach (WebSeries s in series)
     AddItem(s.seriesName,s.episodeName,streamURL + "/Streamer.aspx?idTvSeries=" + s.compositeId + "&idProfile=" + Request.QueryString["idProfile"]);
     }
     else if (Request.QueryString["movingpictures"] != null)
     {
       AddHeader("Moving Pictures","");
       List<WebMovingPicture> mpics=server.GetAllMovingPictures("");
       foreach (WebMovingPicture m in mpics)
     AddItem(m.title,m.plot,streamURL + "/Streamer.aspx?idMovingPicture=" + m.id.ToString() + "&idProfile=" + Request.QueryString["idProfile"]);
     }
     AddFooter();
     Response.Clear();
     Response.ContentType = "application/rss+xml";
     Response.Write(rss);
     Response.End();
 }
Example #2
0
    protected void RefreshTv()
    {
        ServiceInterface server = new ServiceInterface();
        if (cbTvGroups.Items.Count == 0)
        {
          List<WebChannelGroup> tvgroups = server.GetTvChannelGroups();
          int i = 0;
          int index = -1;
          int allIndex = -1;
          foreach (WebChannelGroup g in tvgroups)
          {
        if (g.name == "All Channels" && allIndex == -1)
          allIndex = i;
        if (g.name != "All Channels" && index == -1)
          index = i;
        cbTvGroups.Items.Add(new ListItem(g.name, g.idGroup.ToString()));
        i++;
          }
          if (index != -1)
        cbTvGroups.SelectedIndex = index;
          else
        cbTvGroups.SelectedIndex = allIndex;
        }

        List<WebMiniEPG> epgs = server.GetTvMiniEPGForGroup(Int32.Parse(cbTvGroups.SelectedValue));
        DataTable dt = new DataTable();
        dt.Columns.Add("channel", typeof(string));
        dt.Columns.Add("now_next", typeof(string));
        dt.Columns.Add("idChannel", typeof(int));
        dt.Columns.Add("logo", typeof(string));
        foreach (WebMiniEPG epg in epgs)
        {
          if (epg.idChannel == 0) continue;
          DataRow row = dt.NewRow();
          row["channel"] = epg.name;
          row["now_next"] = epg.epgNow.startTime.ToShortTimeString() + " - " + epg.epgNow.endTime.ToShortTimeString() + ": <a href=EPGSearch.aspx?title=" + Server.UrlEncode(epg.epgNow.title) + " target=_blank><img border=0 src=\"pics/btnRecurrences.png\" alt=\"Find recurrences\" style=\"margin-right:5px;vertical-align:middle\" title=\"Find recurrences\" /></a>" + GetScraperLink(epg.epgNow.title) + "<br/>" + epg.epgNext.startTime.ToShortTimeString() + " - " + epg.epgNext.endTime.ToShortTimeString() + ": <a href=EPGSearch.aspx?title=" + Server.UrlEncode(epg.epgNext.title) + " target=_blank><img border=0 src=\"pics/btnRecurrences.png\" alt=\"Find recurrences\" style=\"margin-right:5px;vertical-align:middle\" title=\"Find recurrences\" /></a>" + GetScraperLink(epg.epgNext.title);
          row["idChannel"] = epg.idChannel;
          row["logo"] = Utils.GetLogoURL(epg.name,true);
          dt.Rows.Add(row);
        }
        gridTv.DataSource = dt;
        gridTv.DataBind();
        int width; int height;
        Utils.GetThumbDimensions(out width, out height);
        gridTv.Columns[0].ControlStyle.Width = width;
        gridTv.Columns[0].ControlStyle.Height = height;
        LoadStreamingProfiles(cbTvProfiles);
    }