marcus67 / little_brother

Parental Control Application implemented in Python 3 packaged for Debian and Ubuntu to monitor and limit kids' play time on Linux hosts
GNU General Public License v3.0
59 stars 9 forks source link

Playtime on a weekly basis #160

Open klimacht opened 2 years ago

klimacht commented 2 years ago

Hi,

thanks for the project. I would like to grant my kids a certain playtime per week, and they would than use/distribute it on their own.

Im wondering if it would be possible to use the optional Time but on a weekly basis? As far as i can tell from the code the dailystatistic handles this right now but each day has his own statistic.

Where would i start when i would like to implement something like an accounting for personal playtime? In my mind they would have a daily amount like it is at the moment and additionally an weekly/monthly amount that they can spend.

Cheers Thomas

marcus67 commented 2 years ago

Hi Thomas,

having weekly (or monthly) time budgets is probably an interesting add-on to LittleBrother. However, the current time-extension is not well suited to cover this requirement, for two reasons: a) The time spent on time-extension is not extra time but only time extending the current session deactivating all other restriction such as time of day. b) If the normal time is spent it is difficult to login even if time extension is still available.

What is the best way to start? Without really having thought about it sufficiently, I would assume that it would be necessary to add a second aggregation method which aggregates over all days of the week (analog to class DayStatistics in process_statistics.py). The configuration of the user would contain an extra field for the maximum time budget per week. If this value is empty the logic would fall back to the status quo. If it is filled the extra weekly aggregation would be called and used as a limit.