Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement basic file retention policy #90

Merged
merged 3 commits into from
Jun 18, 2022
Merged

Implement basic file retention policy #90

merged 3 commits into from
Jun 18, 2022

Conversation

chenxiaolong
Copy link
Owner

This PR implements a simple file retention policy mechanism. The output directory preference now opens a bottom sheet that allows for the configuration of the file retention. The available options are hardcoded to:

  • 1 day
  • 7 days
  • 30 days
  • 90 days
  • Half year (182 days)
  • Full year (365 days)
  • Keep all (default)

The cleanup procedure runs at the end of a call recording. If eg. the file retention is set to 30 days and there are files older than 30 days, they will not be deleted until the next phone call. There is no background process to run the cleanup periodically.

The age of past recordings is determined by the filename only. In other words, the start times of the calls are used for comparison. The file modification time is completely ignored. For example, if the current time is:

20220618_150000.000-0400

and a past 2-hour recording is:

20220617_140000.000-0400

then the file is considered 25 hours old, not 23 hours.

Fixes: #25
Fixes: #81
Fixes: #88

@chenxiaolong chenxiaolong self-assigned this Jun 18, 2022
@chenxiaolong chenxiaolong force-pushed the retention branch 2 times, most recently from 970f42c to e763fc4 Compare June 18, 2022 19:13
The output directory selection has been moved to a new bottom sheet,
which also contains a new slider for setting the file retention period.
The actual cleanup functionality will be implemented in a separate
commit.

Signed-off-by: Andrew Gunnerson <chillermillerlong@hotmail.com>
Signed-off-by: Andrew Gunnerson <chillermillerlong@hotmail.com>
Signed-off-by: Andrew Gunnerson <chillermillerlong@hotmail.com>
@chenxiaolong chenxiaolong merged commit c11af72 into master Jun 18, 2022
@chenxiaolong chenxiaolong deleted the retention branch June 18, 2022 19:35
chenxiaolong added a commit that referenced this pull request Jun 18, 2022
Signed-off-by: Andrew Gunnerson <chillermillerlong@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment