Added attributes field to help with entry ID migrations, trial with Team Skeet.
This commit is contained in:
parent
a77e13c7de
commit
ccd833665f
|
|
@ -45,6 +45,11 @@ async function scrapeScene(scene, channel, parameters, includeTrailers) {
|
|||
const release = {};
|
||||
|
||||
release.entryId = scene.id;
|
||||
|
||||
release.attributes = {
|
||||
entryId: scene.itemId,
|
||||
};
|
||||
|
||||
release.url = `${channel.type === 'network' || channel.parameters?.layout === 'organic' ? channel.url : channel.parent.url}/movies/${release.entryId}`;
|
||||
|
||||
release.title = scene.title;
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ async function curateReleaseEntry(release, batchId, existingRelease, type = 'sce
|
|||
slug,
|
||||
description: decode(release.description),
|
||||
comment: release.comment,
|
||||
attributes: release.attributes,
|
||||
photo_count: Number(release.photoCount) || null,
|
||||
deep: typeof release.deep === 'boolean' ? release.deep : false,
|
||||
deep_url: release.deepUrl,
|
||||
|
|
@ -439,10 +440,11 @@ async function storeScenes(releases, useBatchId) {
|
|||
shoot_id = COALESCE(new.shoot_id, releases.shoot_id),
|
||||
duration = COALESCE(new.duration, releases.duration),
|
||||
comment = COALESCE(new.comment, releases.comment),
|
||||
attributes = COALESCE(new.attributes::jsonb || releases.attributes::jsonb, new.attributes::jsonb, releases.attributes::jsonb),
|
||||
deep = new.url IS NOT NULL,
|
||||
updated_at = NOW()
|
||||
FROM json_to_recordset(:scenes)
|
||||
AS new(id int, url text, date timestamptz, entity json, title text, description text, shoot_id text, duration integer, comment text, deep boolean)
|
||||
AS new(id int, url text, date timestamptz, entity json, title text, description text, shoot_id text, duration integer, comment text, attributes json, deep boolean)
|
||||
WHERE releases.id = new.id
|
||||
`, {
|
||||
scenes: JSON.stringify(curatedDuplicateReleases),
|
||||
|
|
|
|||
Loading…
Reference in New Issue