Compare commits

...

2 Commits

Author SHA1 Message Date
DebaucheryLibrarian 15810333b9 1.138.2 2020-10-25 21:43:45 +01:00
DebaucheryLibrarian 0027be65eb Fixed CzechAV to accomodate teasers instead of photos. Fixed error trying to flush non-existent media file. 2020-10-25 21:43:36 +01:00
5 changed files with 9 additions and 11 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.138.1", "version": "1.138.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

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

View File

@ -200,8 +200,6 @@ async function findSourceDuplicates(baseMedias) {
knex('media').whereIn('source_page', extractUrls), knex('media').whereIn('source_page', extractUrls),
]); ]);
console.log(sourceUrls, existingSourceMedia);
const existingSourceMediaByUrl = itemsByKey(existingSourceMedia, 'source'); const existingSourceMediaByUrl = itemsByKey(existingSourceMedia, 'source');
const existingExtractMediaByUrl = itemsByKey(existingExtractMedia, 'source_page'); const existingExtractMediaByUrl = itemsByKey(existingExtractMedia, 'source_page');
@ -776,12 +774,12 @@ async function flushOrphanedMedia() {
.delete(); .delete();
await Promise.all(orphanedMedia.map(media => Promise.all([ await Promise.all(orphanedMedia.map(media => Promise.all([
fsPromises.unlink(path.join(config.media.path, media.path)).catch(() => { /* probably file not found */ }), media.path && fsPromises.unlink(path.join(config.media.path, media.path)).catch(() => { /* probably file not found */ }),
fsPromises.unlink(path.join(config.media.path, media.thumbnail)).catch(() => { /* probably file not found */ }), media.thumbnail && fsPromises.unlink(path.join(config.media.path, media.thumbnail)).catch(() => { /* probably file not found */ }),
fsPromises.unlink(path.join(config.media.path, media.lazy)).catch(() => { /* probably file not found */ }), media.lazy && fsPromises.unlink(path.join(config.media.path, media.lazy)).catch(() => { /* probably file not found */ }),
]))); ])));
logger.info(`Removed ${orphanedMedia.length} media files from database and disk`); logger.info(`Removed ${orphanedMedia.length} media files from database and storage`);
await fsPromises.rmdir(path.join(config.media.path, 'temp'), { recursive: true }); await fsPromises.rmdir(path.join(config.media.path, 'temp'), { recursive: true });

View File

@ -12,7 +12,8 @@ function scrapeAll(scenes, channel) {
release.title = query.cnt('.nice-title'); release.title = query.cnt('.nice-title');
release.poster = query.img('img.poster'); release.poster = query.img('img.poster');
release.photos = query.q('img.poster', 'data-urls').split(' '); release.photos = query.q('img.poster', 'data-urls')?.split(' ');
release.teaser = query.video('img.poster', 'data-thumbnail');
if (query.exists('.info')) { if (query.exists('.info')) {
release.date = query.date('.updated', 'MM/DD/YYYY'); release.date = query.date('.updated', 'MM/DD/YYYY');

View File

@ -3,13 +3,12 @@
async function fetchLatest() { async function fetchLatest() {
return [ return [
{ {
title: 'Hot chicks arse fucked', title: 'Hot chick arse fucked',
date: new Date(), date: new Date(),
}, },
]; ];
} }
module.exports = { module.exports = {
fetchLatest, fetchLatest,
}; };