improve db
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
import { sanitizeStreamUrl } from './feedUtils.js'
|
||||
|
||||
const DEVICE_TYPES = Object.freeze(['alpr', 'nvr', 'doorbell', 'feed', 'traffic', 'ip', 'drone'])
|
||||
const SOURCE_TYPES = Object.freeze(['mjpeg', 'hls'])
|
||||
|
||||
const sanitizeStreamUrl = (url) => {
|
||||
if (typeof url !== 'string' || !url.trim()) return ''
|
||||
const u = url.trim()
|
||||
return (u.startsWith('https://') || u.startsWith('http://')) ? u : ''
|
||||
}
|
||||
|
||||
/** @typedef {{ id: string, name: string, device_type: string, vendor: string | null, lat: number, lng: number, stream_url: string, source_type: string, config: string | null }} DeviceRow */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user