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

@@ -5,7 +5,7 @@ const moment = require('moment');
const { cmToFeetInches, kgToLbs } = require('../../utils/convert');
const schemaExtender = makeExtendSchemaPlugin(_build => ({
typeDefs: gql`
typeDefs: gql`
enum Units {
METRIC
IMPERIAL
@@ -17,32 +17,32 @@ const schemaExtender = makeExtendSchemaPlugin(_build => ({
weight(units:Units): String @requires(columns: ["weight"])
}
`,
resolvers: {
Actor: {
age(parent, _args, _context, _info) {
if (!parent.birthdate) return null;
resolvers: {
Actor: {
age(parent, _args, _context, _info) {
if (!parent.birthdate) return null;
return moment().diff(parent.birthdate, 'years');
},
height(parent, args, _context, _info) {
if (!parent.height) return null;
return moment().diff(parent.birthdate, 'years');
},
height(parent, args, _context, _info) {
if (!parent.height) return null;
if (args.units === 'IMPERIAL') {
const { feet, inches } = cmToFeetInches(parent.height);
return `${feet}' ${inches}"`;
}
if (args.units === 'IMPERIAL') {
const { feet, inches } = cmToFeetInches(parent.height);
return `${feet}' ${inches}"`;
}
return parent.height.toString();
},
weight(parent, args, _context, _info) {
if (!parent.weight) return null;
return parent.height.toString();
},
weight(parent, args, _context, _info) {
if (!parent.weight) return null;
return args.units === 'IMPERIAL'
? kgToLbs(parent.weight).toString()
: parent.weight.toString();
},
},
},
return args.units === 'IMPERIAL'
? kgToLbs(parent.weight).toString()
: parent.weight.toString();
},
},
},
}));
module.exports = [schemaExtender];

View File

@@ -5,7 +5,7 @@ const SitePlugins = require('./sites');
// const ReleasePlugins = require('./releases');
module.exports = {
ActorPlugins,
SitePlugins,
ReleasePlugins: [],
ActorPlugins,
SitePlugins,
ReleasePlugins: [],
};

View File

@@ -3,16 +3,16 @@
const { makeExtendSchemaPlugin, gql } = require('graphile-utils');
const schemaExtender = makeExtendSchemaPlugin(_build => ({
typeDefs: gql`
typeDefs: gql`
extend type Release {}
`,
resolvers: {
Release: {
async foo(_parent, _args, _context, _info) {
// template
},
},
},
resolvers: {
Release: {
async foo(_parent, _args, _context, _info) {
// template
},
},
},
}));
module.exports = [schemaExtender];

View File

@@ -3,18 +3,18 @@
const { makeExtendSchemaPlugin, gql } = require('graphile-utils');
const schemaExtender = makeExtendSchemaPlugin(_build => ({
typeDefs: gql`
typeDefs: gql`
extend type Site {
independent: Boolean @requires(columns: ["parameters"])
}
`,
resolvers: {
Site: {
independent(parent, _args, _context, _info) {
return !!parent.parameters?.independent;
},
},
},
resolvers: {
Site: {
independent(parent, _args, _context, _info) {
return !!parent.parameters?.independent;
},
},
},
}));
module.exports = [schemaExtender];