-- @query item_extended_facets
-- @db media 11.0
-- @param item_ids TEXT
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
