Switched to tabs. Adding missing actor entries when scraping actors, with batch ID.

This commit is contained in:
2020-05-14 04:26:05 +02:00
parent f1eb29c713
commit 11eb66f834
178 changed files with 16594 additions and 16929 deletions

View File

@@ -4,10 +4,10 @@ import { curateSite } from '../curate';
import getDateRange from '../get-date-range';
function initSitesActions(store, _router) {
async function fetchSiteBySlug({ _commit }, { siteSlug, limit = 100, range = 'latest' }) {
const { before, after, orderBy } = getDateRange(range);
async function fetchSiteBySlug({ _commit }, { siteSlug, limit = 100, range = 'latest' }) {
const { before, after, orderBy } = getDateRange(range);
const { site } = await graphql(`
const { site } = await graphql(`
query Site(
$siteSlug: String!,
$limit:Int = 100,
@@ -37,20 +37,20 @@ function initSitesActions(store, _router) {
}
}
`, {
siteSlug,
limit,
after,
before,
orderBy,
isNew: store.getters.isNew,
exclude: store.state.ui.filter,
});
siteSlug,
limit,
after,
before,
orderBy,
isNew: store.getters.isNew,
exclude: store.state.ui.filter,
});
return curateSite(site);
}
return curateSite(site);
}
async function fetchSites({ _commit }, { limit = 100 }) {
const { sites } = await graphql(`
async function fetchSites({ _commit }, { limit = 100 }) {
const { sites } = await graphql(`
query Sites(
$actorSlug: String!
$limit:Int = 100,
@@ -64,16 +64,16 @@ function initSitesActions(store, _router) {
}
}
`, {
limit,
after: store.getters.after,
before: store.getters.before,
});
limit,
after: store.getters.after,
before: store.getters.before,
});
return sites;
}
return sites;
}
async function searchSites({ _commit }, { query, limit = 20 }) {
const { sites } = await graphql(`
async function searchSites({ _commit }, { query, limit = 20 }) {
const { sites } = await graphql(`
query SearchSites(
$query: String!
$limit:Int = 20,
@@ -93,18 +93,18 @@ function initSitesActions(store, _router) {
}
}
`, {
query,
limit,
});
query,
limit,
});
return sites;
}
return sites;
}
return {
fetchSiteBySlug,
fetchSites,
searchSites,
};
return {
fetchSiteBySlug,
fetchSites,
searchSites,
};
}
export default initSitesActions;

View File

@@ -3,11 +3,11 @@ import mutations from './mutations';
import actions from './actions';
function initSitesStore(store, router) {
return {
state,
mutations,
actions: actions(store, router),
};
return {
state,
mutations,
actions: actions(store, router),
};
}
export default initSitesStore;