tytd-server/Server/Models/SavedChannel.cs

30 lines
861 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-06-27 17:22:18 +00:00
using youtube_downloader.Server.Functions;
2021-06-24 01:10:20 +00:00
namespace TessesYoutubeDownloader.Server.Models
{
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; }
}
}