Renaming and formatting

This commit is contained in:
2018-02-17 20:29:25 -05:00
parent b44eedfc2a
commit f86597686f
8 changed files with 184 additions and 216 deletions

View File

@ -38,7 +38,7 @@ namespace YTManager.Tasks
query.MaxResults = 50;
var response = query.Execute();
// Get all videos which aren't already in the DB.
// Get all videos which aren't already in the DB based on the ytid.
var notindb = response.Items
.Where(i => i.Id.Kind == "youtube#video")
.Where(i => !dbcontext.Videos.Any(dbvid => dbvid.YTVideoID == i.Id.VideoId))
@ -47,10 +47,9 @@ namespace YTManager.Tasks
Title = newvid.Snippet.Title,
Description = newvid.Snippet.Description,
YTVideoID = newvid.Id.VideoId,
Uploaded = newvid.Snippet.PublishedAt.GetValueOrDefault(),
AddedToYT = newvid.Snippet.PublishedAt.GetValueOrDefault(),
AddedtoDB = DateTime.Now,
YTChannelID = newvid.Snippet.ChannelId,
Channel = ch,
channel = ch,
ThumbnailURL = newvid.Snippet.Thumbnails.Medium.Url
}).ToList();