mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 04:04:21 -04:00
Auto calculate next refresh dates for episodes
This commit is contained in:
parent
274d2987d2
commit
5c6bcee763
@ -91,6 +91,16 @@ public class EpisodeRepository(
|
|||||||
.Select(x => x.Id)
|
.Select(x => x.Id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Refresh metadata every day if the item aired this week, refresh every two mounts otherwise
|
||||||
|
if (
|
||||||
|
resource.ReleaseDate is not DateOnly date
|
||||||
|
|| (date.DayNumber - DateOnly.FromDateTime(DateTime.UtcNow).DayNumber) < 7
|
||||||
|
)
|
||||||
|
resource.NextMetadataRefresh = DateTime.UtcNow.AddDays(1);
|
||||||
|
else
|
||||||
|
resource.NextMetadataRefresh = DateTime.UtcNow.AddMonths(2);
|
||||||
|
|
||||||
await thumbnails.DownloadImages(resource);
|
await thumbnails.DownloadImages(resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user