Changeset 138 for trunk/Modules/TV/UPageTV.pas
- Timestamp:
- Sep 9, 2022, 8:20:25 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/TV/UPageTV.pas
r137 r138 56 56 with TWebSession(HandlerData) do begin 57 57 ModuleUser.LoadUserInfo; 58 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin58 with HtmlDocument.Body, SubItems.AddString do begin 59 59 Text := 'Stažení přehrávače: <a href="http://www.videolan.org/vlc/">VLC Media Player</a><br/>' + 60 60 'Seznam všech kanálů do přehrávače: <a href="playlist/">Playlist</a><br/>' + … … 70 70 with DbRows[I] do begin 71 71 TuneUp := ' '; 72 if Values['StreamWeb'] <> '' then73 TuneUp := MakeLink('Naladit', Values['StreamWeb']);74 if Values['Stream'] <> '' then75 TuneUp := MakeLink('Naladit', NavigationLink('/tv/playlist?id=' + Values['ShortName']));76 Text := Text + '<tr><td>' + MakeLink( Values['Name'], Values['Homepage']) +72 if Items['StreamWeb'] <> '' then 73 TuneUp := MakeLink('Naladit', Items['StreamWeb']); 74 if Items['Stream'] <> '' then 75 TuneUp := MakeLink('Naladit', NavigationLink('/tv/playlist?id=' + Items['ShortName'])); 76 Text := Text + '<tr><td>' + MakeLink(Items['Name'], Items['Homepage']) + 77 77 '</td><td align="center">' + 78 Values['Language'] + '</td><td align="center">' + Values['Category'] + '</td>' +78 Items['Language'] + '</td><td align="center">' + Items['Category'] + '</td>' + 79 79 '<td>' + TuneUp + '</td></tr>'; 80 80 end; … … 99 99 I: Integer; 100 100 Text: string; 101 Id: string; 101 102 begin 102 103 with TWebSession(HandlerData) do begin 103 104 105 106 104 Response.Headers.Add('Content-Type', 'audio/mpegurl'); 105 Response.Headers.Add('Content-Disposition', 'attachment; filename=playlist.m3u'); 106 try 107 DbRows := TDbRows.Create; 107 108 108 109 Text := '#EXTM3U' + LineEnding; 109 if Request.Query. SearchKey('id') <> -1then begin110 Database.Select(DbRows, 'TV', '*', ' (`Stream` <> "") AND (`ShortName`="' + Database.EscapeString( Request.Query.Values['id']) + '") ');110 if Request.Query.TryGetValue('id', Id) then begin 111 Database.Select(DbRows, 'TV', '*', ' (`Stream` <> "") AND (`ShortName`="' + Database.EscapeString(Id) + '") '); 111 112 if DbRows.Count > 0 then begin 112 Text := Text + '#EXTINF:0,' + DbRows[0]. Values['Name'] + LineEnding113 + DbRows[0]. Values['Stream'] + LineEnding;113 Text := Text + '#EXTINF:0,' + DbRows[0].Items['Name'] + LineEnding 114 + DbRows[0].Items['Stream'] + LineEnding; 114 115 end; 115 116 end else begin 116 117 Database.Select(DbRows, 'TV', '*', ' (`Stream` <> "") ORDER BY `Name` '); 117 118 for I := 0 to DbRows.Count - 1 do begin 118 Text := Text + '#EXTINF:0,' + DbRows[I]. Values['Name'] + LineEnding119 + DbRows[I]. Values['Stream'] + LineEnding;119 Text := Text + '#EXTINF:0,' + DbRows[I].Items['Name'] + LineEnding 120 + DbRows[I].Items['Stream'] + LineEnding; 120 121 end; 121 122 end; 122 123 Response.Content.WriteString(Text); 123 124 124 125 126 125 finally 126 DbRows.Free; 127 end 127 128 end; 128 129 end;
Note:
See TracChangeset
for help on using the changeset viewer.