mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
A Bunny guid is stored twice per row: in `VideoVersion.videoId` and `VideoAsset.providerVideoId` on its own, and inside `originalUrl` / `sourceUrl` as `https://iframe.mediadelivery.net/embed/<library>/<guid>`. The lookup read only the id columns. They are written together so they normally agree, but this query decides what gets deleted. A row whose id column was left empty or drifted while its url still carried the guid would present a live video as an orphan, and the script would delete media the product is still serving. Reading both makes a disagreement harmless instead of destructive. Bunny rows are now read in one pass rather than filtered per candidate id: the url match is a substring test, and there are only as many of these rows as there are Bunny videos in the product, so one small scan beats a LIKE per id.