mirror of
https://onedev.site.tesses.net/tytd2025
synced 2026-02-09 01:55:46 +00:00
First commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
func Pages.ChannelInfo(tytd,ctx)
|
||||
{
|
||||
var id = ctx.QueryParams.TryGetFirst("id");
|
||||
var page = ctx.QueryParams.TryGetFirstInt("page");
|
||||
if(TypeOf(page) != "Long") page = 1;
|
||||
page--;
|
||||
|
||||
var html = <h1>Could not find channel</h1>;
|
||||
var title = "N/A";
|
||||
|
||||
if(TypeOf(id) == "String")
|
||||
{
|
||||
id = TYTD.GetChannelId(id);
|
||||
var res = tytd.GetChannelContents(id,page,20);
|
||||
|
||||
html = <null>
|
||||
<div class="row">
|
||||
<div class="max">
|
||||
<h1>{res.authorName}</h1>
|
||||
</div>
|
||||
<div class="min">
|
||||
<raw(Components.Subscribe(tytd,id))>
|
||||
</div>
|
||||
</div>
|
||||
<each(var item : res.items)>
|
||||
<raw(Components.DownloadedVideo(item))>
|
||||
</each>
|
||||
<footer class="row center-align">
|
||||
|
||||
<button hx-get={$"./channel?id={Net.Http.UrlEncode(id)}&page={page}"} hx-target="body" hx-push-url="true" >Prev</button>{page+1}<button hx-get={$"./channel?id={Net.Http.UrlEncode(id)}&type=videos&page={page+2}"} hx-target="body" hx-push-url="true" >Next</button>
|
||||
|
||||
</footer>
|
||||
</null>;
|
||||
|
||||
title = res.authorName;
|
||||
}
|
||||
|
||||
return Components.Shell($"Channel {title}",html,1);
|
||||
}
|
||||
Reference in New Issue
Block a user