pinakes-core: improve media management features; various configuration improvements
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I2d1f04f13970d21c36067f30bc04a9176a6a6964
This commit is contained in:
parent
cfdc3d0622
commit
e02c15490e
31 changed files with 1167 additions and 197 deletions
15
migrations/postgres/V13__photo_metadata.sql
Normal file
15
migrations/postgres/V13__photo_metadata.sql
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
-- V13: Enhanced photo metadata support
|
||||
-- Add photo-specific fields to media_items table
|
||||
|
||||
ALTER TABLE media_items ADD COLUMN date_taken TIMESTAMPTZ;
|
||||
ALTER TABLE media_items ADD COLUMN latitude DOUBLE PRECISION;
|
||||
ALTER TABLE media_items ADD COLUMN longitude DOUBLE PRECISION;
|
||||
ALTER TABLE media_items ADD COLUMN camera_make TEXT;
|
||||
ALTER TABLE media_items ADD COLUMN camera_model TEXT;
|
||||
ALTER TABLE media_items ADD COLUMN rating INTEGER CHECK (rating >= 0 AND rating <= 5);
|
||||
|
||||
-- Indexes for photo queries
|
||||
CREATE INDEX idx_media_date_taken ON media_items(date_taken) WHERE date_taken IS NOT NULL;
|
||||
CREATE INDEX idx_media_location ON media_items(latitude, longitude) WHERE latitude IS NOT NULL AND longitude IS NOT NULL;
|
||||
CREATE INDEX idx_media_camera ON media_items(camera_make) WHERE camera_make IS NOT NULL;
|
||||
CREATE INDEX idx_media_rating ON media_items(rating) WHERE rating IS NOT NULL;
|
||||
7
migrations/postgres/V14__perceptual_hash.sql
Normal file
7
migrations/postgres/V14__perceptual_hash.sql
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
-- V14: Perceptual hash for duplicate detection
|
||||
-- Add perceptual hash column for image similarity detection
|
||||
|
||||
ALTER TABLE media_items ADD COLUMN perceptual_hash TEXT;
|
||||
|
||||
-- Index for perceptual hash lookups
|
||||
CREATE INDEX idx_media_phash ON media_items(perceptual_hash) WHERE perceptual_hash IS NOT NULL;
|
||||
15
migrations/sqlite/V13__photo_metadata.sql
Normal file
15
migrations/sqlite/V13__photo_metadata.sql
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
-- V13: Enhanced photo metadata support
|
||||
-- Add photo-specific fields to media_items table
|
||||
|
||||
ALTER TABLE media_items ADD COLUMN date_taken TIMESTAMP;
|
||||
ALTER TABLE media_items ADD COLUMN latitude REAL;
|
||||
ALTER TABLE media_items ADD COLUMN longitude REAL;
|
||||
ALTER TABLE media_items ADD COLUMN camera_make TEXT;
|
||||
ALTER TABLE media_items ADD COLUMN camera_model TEXT;
|
||||
ALTER TABLE media_items ADD COLUMN rating INTEGER CHECK (rating >= 0 AND rating <= 5);
|
||||
|
||||
-- Indexes for photo queries
|
||||
CREATE INDEX idx_media_date_taken ON media_items(date_taken) WHERE date_taken IS NOT NULL;
|
||||
CREATE INDEX idx_media_location ON media_items(latitude, longitude) WHERE latitude IS NOT NULL AND longitude IS NOT NULL;
|
||||
CREATE INDEX idx_media_camera ON media_items(camera_make) WHERE camera_make IS NOT NULL;
|
||||
CREATE INDEX idx_media_rating ON media_items(rating) WHERE rating IS NOT NULL;
|
||||
7
migrations/sqlite/V14__perceptual_hash.sql
Normal file
7
migrations/sqlite/V14__perceptual_hash.sql
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
-- V14: Perceptual hash for duplicate detection
|
||||
-- Add perceptual hash column for image similarity detection
|
||||
|
||||
ALTER TABLE media_items ADD COLUMN perceptual_hash TEXT;
|
||||
|
||||
-- Index for perceptual hash lookups
|
||||
CREATE INDEX idx_media_phash ON media_items(perceptual_hash) WHERE perceptual_hash IS NOT NULL;
|
||||
Loading…
Add table
Add a link
Reference in a new issue