Page 1 of 1

Current day expire time for news

Posted: 04 Sep 2017 22:11
by andreigherghe
Hi Bernd,

Is there a way to schedule news for the current day only? By setting the Max. Age to 1, the news are currently played during 24 hours relative to the file's timestamp.

It would be useful to have an option to check the validity relative to the day, instead of relative to the timestamp,

e. g.: I add an audio file in the news folder at 6 PM, I set the Max. Age to 1, after 11:59:59 PM the file expires. If I set the Max. Age to 2, it should expire the next day at midnight, not after 48 hours.

This would be used in situations where the news are only valid during the current day, having been added in the same day.

Thanks!

Andrei
Radio Terra @ Romania

Re: Current day expire time for news

Posted: 04 Sep 2017 22:24
by radio42
That is a good point and I'll add this to the ToDo/Feature list!

Re: Current day expire time for news

Posted: 05 Sep 2017 11:12
by andreigherghe
Excellent news! Thanks a lot! :D

Re: Current day expire time for news

Posted: 05 Sep 2017 20:25
by radio42
I already took a look to the current code. And it is actually already only measuring full calendar days based on the file's 'LastWriteTime' (which is the modification date) - however, it considers only the full date portion and NOT the time.
E.g. when a file is last modified on: 2017-08-27 14:55; it would have on the next day (regardless of the time) already an age of 1 day.

The problem is, that I currently check, if the 'Age' is greater than the 'Max Age'.
As such if the 'Max Age' is set to 1, it would only expire the day after the next day.
As in the example:
2017-08-27 : Age=0
2017-08-28 : Age=1
2017-08-29 : Age=2 expired

I will change this check in the next version to expired = 'Age' >= 'Max Age'.

Re: Current day expire time for news

Posted: 06 Sep 2017 21:23
by radio42
A v4.0.3.68-update is available addressing the above issue.