Huge API rewrite

This commit is contained in:
2018-02-24 01:10:12 -05:00
parent a37fe30b6f
commit 038d363b00
16 changed files with 472 additions and 77 deletions

View File

@ -59,7 +59,8 @@ namespace YTManager.Tasks {
ThumbnailURL = response.Items.First().Snippet.Thumbnails.Medium.Url,
YoutubeID = channelID,
AddedtoDB = DateTime.Now,
Refreshed = DateTime.MinValue
Refreshed = DateTime.MinValue,
Videos = null
};
}
@ -70,7 +71,7 @@ namespace YTManager.Tasks {
ops.UseNpgsql(dbstr);
// Get all the channels from the db that expired.
var threshold = DateTime.Now.Subtract(TimeSpan.FromSeconds(100));
var threshold = DateTime.Now.Subtract(TimeSpan.FromMinutes(60));
var channel_ids = await
(new MediaDB(ops.Options)).Channels
.Where(ch => ch.Refreshed < threshold)
@ -104,7 +105,7 @@ namespace YTManager.Tasks {
// Say what channel all the videos came from.
foreach (var v in newvids)
v.channel = channel;
v.Channel = channel;
// Say the channel has been refreshed.
channel.Refreshed = DateTime.Now;