Current day expire time for news

You are missing a feature or need an enhancement? Post your suggestion here!
Post Reply
andreigherghe
Posts: 15
Joined: 12 Aug 2016 16:48
Current day expire time for news

Post 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
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Current day expire time for news

Post by radio42 »

That is a good point and I'll add this to the ToDo/Feature list!
andreigherghe
Posts: 15
Joined: 12 Aug 2016 16:48
Re: Current day expire time for news

Post by andreigherghe »

Excellent news! Thanks a lot! :D
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Current day expire time for news

Post 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'.
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Current day expire time for news

Post by radio42 »

A v4.0.3.68-update is available addressing the above issue.

Post Reply