minor fixes to query size and naming

This commit is contained in:
Ethan Fang
2024-09-19 10:11:01 -05:00
parent 0a6b500e1a
commit 8524961d34
3 changed files with 6 additions and 6 deletions

View File

@@ -24,7 +24,7 @@ internal sealed partial class YouTubeChannelVideosPage : DynamicListPage
public YouTubeChannelVideosPage(string channelId = null, string channelName = null)
{
Icon = new("https://www.youtube.com/favicon.ico");
Name = $"YouTube ({channelName ?? "Channel Video Search"})";
Name = $"YouTube (Video Search) - {channelName ?? "Channel Video Search"}";
this.ShowDetails = true;
// Ensure either a ChannelId or ChannelName is provided
@@ -97,12 +97,12 @@ internal sealed partial class YouTubeChannelVideosPage : DynamicListPage
if (!string.IsNullOrEmpty(channelId))
{
// If ChannelId is provided, filter by channelId
requestUrl = $"https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&channelId={channelId}&q={query}&key={apiKey}&maxResults=10";
requestUrl = $"https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&channelId={channelId}&q={query}&key={apiKey}&maxResults=20";
}
else
{
// If ChannelName is provided, search by the channel name
requestUrl = $"https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&q={query}+{channelName}&key={apiKey}&maxResults=10";
requestUrl = $"https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&q={query}+{channelName}&key={apiKey}&maxResults=20";
}
// Send the request to the YouTube API

View File

@@ -51,7 +51,7 @@ internal sealed partial class YouTubeChannelsPage : DynamicListPage
},
MoreCommands = [
new CommandContextItem(new YouTubeChannelInfoMarkdownPage(channel)),
new CommandContextItem(new YouTubeChannelVideosPage(channel.ChannelId, channel.Name)),
new CommandContextItem(new YouTubeChannelVideosPage(channel.ChannelId, channel.Name) { Title = $"Search for Videos by {channel.Name}" }),
new CommandContextItem(new YouTubeAPIPage()),
],
}).ToArray(),
@@ -74,7 +74,7 @@ internal sealed partial class YouTubeChannelsPage : DynamicListPage
try
{
// Send the request to the YouTube API with the provided query to search for channels
var response = await client.GetStringAsync($"https://www.googleapis.com/youtube/v3/search?part=snippet&type=channel&q={query}&key={apiKey}&maxResults=5");
var response = await client.GetStringAsync($"https://www.googleapis.com/youtube/v3/search?part=snippet&type=channel&q={query}&key={apiKey}&maxResults=20");
var json = JsonNode.Parse(response);
// Parse the response

View File

@@ -80,7 +80,7 @@ internal sealed partial class YouTubeVideosPage : DynamicListPage
try
{
// Send the request to the YouTube API with the provided query
var response = await client.GetStringAsync($"https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&q={query}&key={apiKey}&maxResults=2");
var response = await client.GetStringAsync($"https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&q={query}&key={apiKey}&maxResults=20");
var json = JsonNode.Parse(response);
// Parse the response