tytd-server/Server/Models/SavedChannel.cs

29 lines
812 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;
namespace TessesYoutubeDownloader.Server.Models
{
class SavedChannel
{
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; }
}
}