Compare commits

...

2 Commits

Author SHA1 Message Date
DebaucheryLibrarian 671e110d99 1.231.1 2023-07-25 03:22:26 +02:00
DebaucheryLibrarian b7a31b7933 Added showcase flag to batch table. 2023-07-25 03:22:24 +02:00
5 changed files with 25 additions and 6 deletions

View File

@ -0,0 +1,13 @@
exports.up = async (knex) => {
await knex.schema.alterTable('batches', (table) => {
table.boolean('showcased')
.notNullable()
.defaultTo(true);
});
};
exports.down = async (knex) => {
await knex.schema.alterTable('batches', (table) => {
table.dropColumn('showcased');
});
};

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "traxxx",
"version": "1.231.0",
"version": "1.231.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "traxxx",
"version": "1.231.0",
"version": "1.231.1",
"license": "ISC",
"dependencies": {
"@casl/ability": "^5.2.2",

View File

@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.231.0",
"version": "1.231.1",
"description": "All the latest porn releases in one place",
"main": "src/app.js",
"scripts": {

View File

@ -366,6 +366,12 @@ const { argv } = yargs
alias: ['timeout'],
default: 60000,
})
.option('showcased', {
describe: 'Whether the batch should be showcased as new.',
type: 'boolean',
alias: ['showcase', 'batch-showcased'],
default: true,
})
.coerce('after', interpretAfter)
.coerce('actors-update', (after) => interpretAfter(after, true));

View File

@ -343,7 +343,7 @@ async function storeMovies(movies, useBatchId) {
}
const { uniqueReleases } = await filterDuplicateReleases(movies);
const [batchId] = useBatchId ? [useBatchId] : await knex('batches').insert({ comment: null }).returning('id');
const [batchId] = useBatchId ? [useBatchId] : await knex('batches').insert({ showcased: argv.showcased, comment: null }).returning('id');
const curatedMovieEntries = await Promise.all(uniqueReleases.map((release) => curateReleaseEntry(release, batchId, null, 'movie')));
@ -362,7 +362,7 @@ async function storeSeries(series, useBatchId) {
}
const { uniqueReleases } = await filterDuplicateReleases(series);
const [batchId] = useBatchId ? [useBatchId] : await knex('batches').insert({ comment: null }).returning('id');
const [batchId] = useBatchId ? [useBatchId] : await knex('batches').insert({ showcased: argv.showcased, comment: null }).returning('id');
const curatedSerieEntries = await Promise.all(uniqueReleases.map((release) => curateReleaseEntry(release, batchId, null, 'serie')));
@ -380,7 +380,7 @@ async function storeScenes(releases, useBatchId) {
return [];
}
const [batchId] = useBatchId ? [useBatchId] : await knex('batches').insert({ comment: null }).returning('id');
const [batchId] = useBatchId ? [useBatchId] : await knex('batches').insert({ showcased: argv.showcased, comment: null }).returning('id');
const releasesWithChannels = await attachChannelEntities(releases);
const releasesWithBaseActors = releasesWithChannels.map((release) => ({ ...release, actors: toBaseActors(release.actors) }));