tytd-server/TYTD.Api/Server/Models/SavedChannel.cs

30 lines
828 B
C#
Raw Normal View History

2021-06-24 01:10:20 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2021-12-08 01:07:43 +00:00
using TYTD.Server.Functions;
2021-06-24 01:10:20 +00:00
2021-12-08 01:07:43 +00:00
namespace TYTD.Server.Models
2021-06-24 01:10:20 +00:00
{
2021-06-27 17:22:18 +00:00
public class SavedChannel
2021-06-24 01:10:20 +00:00
{
public static SavedChannel FromChannel(YoutubeExplode.Channels.Channel c, Action<int, int, string,string> downloadThumbnail)
{
SavedChannel sc = new SavedChannel();
sc.Id= c.Id;
sc.Title=c.Title;
sc.Url = c.Url;
foreach(var thumb in c.Thumbnails)
{
downloadThumbnail(thumb.Resolution.Width, thumb.Resolution.Height,c.Id, thumb.Url);
}
return sc;
}
public string Id { get; set; }
public string Title { get; set; }
public string Url { get; set; }
}
}