Refactoring deep scrape. Added tag posters.

This commit is contained in:
2020-03-16 04:10:52 +01:00
parent c8ebe7892a
commit 0f09fd53eb
31 changed files with 851 additions and 589 deletions

View File

@@ -15,7 +15,7 @@ const {
storeMedia,
associateMedia,
} = require('./media');
const { fetchSites, findSiteByUrl } = require('./sites');
const { fetchSites } = require('./sites');
const slugify = require('./utils/slugify');
const capitalize = require('./utils/capitalize');
@@ -174,16 +174,7 @@ async function attachChannelSite(release) {
};
}
try {
const urlSite = await findSiteByUrl(release.channel.url || release.channel);
return {
...release,
site: urlSite,
};
} catch (error) {
throw new Error(`Unable to derive channel site from generic URL: ${release.url}`);
}
throw new Error(`Unable to match channel '${release.channel.slug || release.channel}' from generic URL: ${release.url}`);
}
async function attachStudio(release) {