From ce36b197f0cabce193c2f7d54434c7e73ddff322 Mon Sep 17 00:00:00 2001 From: nicain Date: Tue, 7 Dec 2021 08:38:23 -0800 Subject: [PATCH] chore: Cleanup timestamp setting blocks in samples (#631) --- packages/google-cloud-videointelligence/README.md | 12 ------------ .../samples/quickstart.js | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/packages/google-cloud-videointelligence/README.md b/packages/google-cloud-videointelligence/README.md index 9a589287e32..a72e06ba690 100644 --- a/packages/google-cloud-videointelligence/README.md +++ b/packages/google-cloud-videointelligence/README.md @@ -91,18 +91,6 @@ labels.forEach(label => { console.log(`Label ${label.entity.description} occurs at:`); label.segments.forEach(segment => { segment = segment.segment; - if (segment.startTimeOffset.seconds === undefined) { - segment.startTimeOffset.seconds = 0; - } - if (segment.startTimeOffset.nanos === undefined) { - segment.startTimeOffset.nanos = 0; - } - if (segment.endTimeOffset.seconds === undefined) { - segment.endTimeOffset.seconds = 0; - } - if (segment.endTimeOffset.nanos === undefined) { - segment.endTimeOffset.nanos = 0; - } console.log( `\tStart: ${segment.startTimeOffset.seconds}` + `.${(segment.startTimeOffset.nanos / 1e6).toFixed(0)}s` diff --git a/packages/google-cloud-videointelligence/samples/quickstart.js b/packages/google-cloud-videointelligence/samples/quickstart.js index 66866db4f46..92ee050f9fc 100644 --- a/packages/google-cloud-videointelligence/samples/quickstart.js +++ b/packages/google-cloud-videointelligence/samples/quickstart.js @@ -48,18 +48,6 @@ async function main() { console.log(`Label ${label.entity.description} occurs at:`); label.segments.forEach(segment => { segment = segment.segment; - if (segment.startTimeOffset.seconds === undefined) { - segment.startTimeOffset.seconds = 0; - } - if (segment.startTimeOffset.nanos === undefined) { - segment.startTimeOffset.nanos = 0; - } - if (segment.endTimeOffset.seconds === undefined) { - segment.endTimeOffset.seconds = 0; - } - if (segment.endTimeOffset.nanos === undefined) { - segment.endTimeOffset.nanos = 0; - } console.log( `\tStart: ${segment.startTimeOffset.seconds}` + `.${(segment.startTimeOffset.nanos / 1e6).toFixed(0)}s`