mirror of
https://codeberg.org/ashley/poke.git
synced 2025-06-12 21:53:03 -04:00
owo
This commit is contained in:
parent
f431111611
commit
72143fede3
100 changed files with 12438 additions and 0 deletions
39
core/InnerTube/Models/YoutubeSearchResults.cs
Normal file
39
core/InnerTube/Models/YoutubeSearchResults.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using System.Xml;
|
||||
|
||||
namespace InnerTube.Models
|
||||
{
|
||||
public class YoutubeSearchResults
|
||||
{
|
||||
public string[] Refinements;
|
||||
public long EstimatedResults;
|
||||
public DynamicItem[] Results;
|
||||
public string ContinuationKey;
|
||||
|
||||
public XmlDocument GetXmlDocument()
|
||||
{
|
||||
XmlDocument doc = new();
|
||||
XmlElement search = doc.CreateElement("Search");
|
||||
search.SetAttribute("estimatedResults", EstimatedResults.ToString());
|
||||
search.SetAttribute("continuation", ContinuationKey);
|
||||
|
||||
if (Refinements.Length > 0)
|
||||
{
|
||||
XmlElement refinements = doc.CreateElement("Refinements");
|
||||
foreach (string refinementText in Refinements)
|
||||
{
|
||||
XmlElement refinement = doc.CreateElement("Refinement");
|
||||
refinement.InnerText = refinementText;
|
||||
refinements.AppendChild(refinement);
|
||||
}
|
||||
search.AppendChild(refinements);
|
||||
}
|
||||
|
||||
XmlElement results = doc.CreateElement("Results");
|
||||
foreach (DynamicItem result in Results) results.AppendChild(result.GetXmlElement(doc));
|
||||
search.AppendChild(results);
|
||||
|
||||
doc.AppendChild(search);
|
||||
return doc;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue