Added date range to flush commands.

This commit is contained in:
DebaucheryLibrarian
2024-06-06 00:20:54 +02:00
parent 00653a7cab
commit a0ed434360
3 changed files with 73 additions and 7 deletions

View File

@@ -4,7 +4,7 @@ const config = require('config');
const yargs = require('yargs');
const moment = require('moment');
function interpretAfter(after, ignoreIfEmpty = false) {
function interpretDate(after, ignoreIfEmpty = false) {
if (!after && ignoreIfEmpty) {
return null;
}
@@ -341,6 +341,14 @@ const { argv } = yargs
describe: 'Remove all movies.',
type: 'boolean',
})
.option('flush-after', {
describe: 'Only delete scenes release after including',
type: 'string',
})
.option('flush-before', {
describe: 'Only delete scenes released before including',
type: 'string',
})
.option('delete-actors', {
describe: 'Remove actors by ID.',
type: 'array',
@@ -378,7 +386,9 @@ const { argv } = yargs
alias: ['showcase', 'batch-showcased'],
default: true,
})
.coerce('after', interpretAfter)
.coerce('actors-update', (after) => interpretAfter(after, true));
.coerce('after', interpretDate)
.coerce('flush-after', interpretDate)
.coerce('flush-before', interpretDate)
.coerce('actors-update', (after) => interpretDate(after, true));
module.exports = argv;