#define UPDATE_MEDIA_INFO_IN_FACE_SCAN_LIST "UPDATE "DB_TABLE_FACE_SCAN_LIST" SET modified_time = 0 WHERE media_id IN (SELECT media_id FROM "DB_TABLE_FACE" WHERE media_face_id=%d)"
#define SELECT_FACE_ID "SELECT media_face_id FROM "DB_TABLE_FACE" WHERE media_id='%q' AND face_rect_x=%d AND face_rect_y=%d AND face_rect_w=%d AND face_rect_h=%d AND face_orientation=%d"
-#define SELECT_VALID_STORAGE_FROM_PVR "WHERE storage_id IN (SELECT storage_id FROM "DB_TABLE_STORAGE" WHERE validity=1)"
+#define SELECT_VALID_STORAGE_FROM_PVR "WHERE storage_uuid IN (SELECT storage_id FROM "DB_TABLE_STORAGE" WHERE validity=1)"
#define SELECT_PVR_COUNT "SELECT COUNT(*) FROM "DB_TABLE_PVR" "SELECT_VALID_STORAGE_FROM_PVR
#define SELECT_PVR_LIST "SELECT * FROM "DB_TABLE_PVR" "SELECT_VALID_STORAGE_FROM_PVR
#define SELECT_PVR_COUNT_BY_STORAGE_ID SELECT_PVR_COUNT" AND storage_uuid='%s'"
#define SELECT_PVR_LIST_BY_STORAGE_ID SELECT_PVR_LIST" AND storage_uuid='%s'"
#define SELECT_PVR_FROM_PVR "SELECT * FROM "DB_TABLE_PVR" WHERE media_id='%q'"
#define UPDATE_PVR_META_FROM_PVR "UPDATE "DB_TABLE_PVR" SET program_title=%Q, content_lock=%d, content_watch=%d, play_count=%d, highlight=%d WHERE media_id='%q'"
-#define UPDATE_PVR_LOCAL_RECORD_PVR "UPDATE "DB_TABLE_PVR" SET is_local_record=%d WHERE path='%q' AND storage_uuid='%q'"
+#define UPDATE_PVR_LOCAL_RECORD_PVR "UPDATE "DB_TABLE_PVR" SET is_local_record=%d WHERE media_path='%q' AND storage_uuid='%q'"
#define SELECT_PVR_GROUP_LIST "SELECT DISTINCT %s FROM "DB_TABLE_PVR" "SELECT_VALID_STORAGE_FROM_PVR
#define SELECT_PVR_GROUP_LIST_BY_STORAGE_ID "SELECT DISTINCT %s FROM "DB_TABLE_PVR" WHERE storage_uuid='%s'"
#define SELECT_PVR_GROUP_AND_COUNT_BY_STORAGE_ID "SELECT %s, COUNT(*) FROM "DB_TABLE_PVR" WHERE storage_uuid='%s'"
#define SELECT_PVR_GROUP_AND_COUNT "SELECT %s, COUNT(*) FROM "DB_TABLE_PVR" "SELECT_VALID_STORAGE_FROM_PVR
-#define SELECT_VALID_STORAGE_FROM_UHD "WHERE storage_id IN (SELECT storage_id FROM "DB_TABLE_STORAGE" WHERE validity=1)"
+#define SELECT_VALID_STORAGE_FROM_UHD "WHERE storage_uuid IN (SELECT storage_id FROM "DB_TABLE_STORAGE" WHERE validity=1)"
#define SELECT_UHD_GROUP_LIST "SELECT DISTINCT %s FROM "DB_TABLE_UHD" "SELECT_VALID_STORAGE_FROM_UHD
#define SELECT_UHD_GROUP_LIST_BY_STORAGE_ID "SELECT DISTINCT %s FROM "DB_TABLE_UHD" WHERE storage_uuid='%s'"
#define SELECT_UHD_GROUP_COUNT "SELECT COUNT(*) FROM ("SELECT_UHD_GROUP_LIST