Closed welwood08 closed 6 years ago
Thanks for the PR. There is a slightly simpler way to do this with Time::Piece:
my $timepiece = gmtime($limit);
my $stop = gmtime($now);
while ( $timepiece->week != $stop->week ) {
...
}
Silly me, that is much more obvious! I assume you can easily commit that yourself, closing.
As mentioned here, when refresh limit is not a multiple of 7 days and depending on the current day, an unnecessary extra schedule page before the limit might be downloaded for each channel. Clamping to Mondays prevents this.
Tested on FreeBSD and Windows using
get_iplayer --refresh --refresh-limit 30
confirming that2017/w50
,2017/w51
,2017/w52
,2018/w01
andthis_week
schedules are downloaded and2017/w49
are not.