mirror of
https://codeberg.org/ashley/poke.git
synced 2025-06-27 17:24:24 -04:00
owo
This commit is contained in:
parent
f431111611
commit
72143fede3
100 changed files with 12438 additions and 0 deletions
39
core/LightTube/Database/LTVideo.cs
Normal file
39
core/LightTube/Database/LTVideo.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using InnerTube.Models;
|
||||
|
||||
namespace LightTube.Database
|
||||
{
|
||||
public class LTVideo : PlaylistVideoItem
|
||||
{
|
||||
public string UploadedAt;
|
||||
public long Views;
|
||||
|
||||
public override XmlElement GetXmlElement(XmlDocument doc)
|
||||
{
|
||||
XmlElement item = doc.CreateElement("Video");
|
||||
item.SetAttribute("id", Id);
|
||||
item.SetAttribute("duration", Duration);
|
||||
item.SetAttribute("views", Views.ToString());
|
||||
item.SetAttribute("uploadedAt", UploadedAt);
|
||||
item.SetAttribute("index", Index.ToString());
|
||||
|
||||
XmlElement title = doc.CreateElement("Title");
|
||||
title.InnerText = Title;
|
||||
item.AppendChild(title);
|
||||
if (Channel is not null)
|
||||
item.AppendChild(Channel.GetXmlElement(doc));
|
||||
|
||||
foreach (Thumbnail t in Thumbnails ?? Array.Empty<Thumbnail>())
|
||||
{
|
||||
XmlElement thumbnail = doc.CreateElement("Thumbnail");
|
||||
thumbnail.SetAttribute("width", t.Width.ToString());
|
||||
thumbnail.SetAttribute("height", t.Height.ToString());
|
||||
thumbnail.InnerText = t.Url;
|
||||
item.AppendChild(thumbnail);
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue