-- @query item_extended_facets -- Extended facets for a small set of items (typically 1-3 in the one-up viewer). -- Returns optional metadata that is too expensive or unnecessary to include in -- the gallery enrichment query which runs on every 60-item page. -- -- Currently returns: -- isLivePhoto — 1 if the photo facet contains an Apple Live Photo marker -- isSamsungMotionPhoto — 1 if the photo facet contains a Samsung Motion Photo marker -- -- Extend this query when new per-item facets are needed by the one-up viewer, -- details pane, or other single-item surfaces. -- @db media 11.0 -- -- @param item_ids TEXT -- JSON array of driveItemIds SELECT cloud.driveItemId, CASE WHEN json_extract(cloud.photo, '$.livePhoto') IS NOT NULL THEN 1 ELSE 0 END AS isLivePhoto, CASE WHEN json_extract(cloud.photo, '$.samsungMotionPhoto') IS NOT NULL THEN 1 ELSE 0 END AS isSamsungMotionPhoto FROM media.media_properties AS cloud WHERE cloud.driveItemId IN (SELECT value FROM json_each(?item_ids)) AND cloud.isTombstoned = 0