nix: set up project-wide formatter
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I4806c58aa0a17f504c9312723ad770166a6a6964
This commit is contained in:
parent
aa9c55277c
commit
9e5eb41d39
78 changed files with 7406 additions and 2504 deletions
|
|
@ -1,27 +1,114 @@
|
|||
CREATE VIRTUAL TABLE IF NOT EXISTS media_fts USING fts5(
|
||||
CREATE VIRTUAL TABLE IF NOT EXISTS media_fts USING fts5 (
|
||||
title,
|
||||
artist,
|
||||
album,
|
||||
genre,
|
||||
description,
|
||||
file_name,
|
||||
content = 'media_items',
|
||||
content_rowid = 'rowid'
|
||||
);
|
||||
|
||||
CREATE TRIGGER IF NOT EXISTS media_fts_insert
|
||||
AFTER INSERT ON media_items
|
||||
BEGIN
|
||||
INSERT INTO
|
||||
media_fts (
|
||||
rowid,
|
||||
title,
|
||||
artist,
|
||||
album,
|
||||
genre,
|
||||
description,
|
||||
file_name,
|
||||
content='media_items',
|
||||
content_rowid='rowid'
|
||||
);
|
||||
file_name
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
new.rowid,
|
||||
new.title,
|
||||
new.artist,
|
||||
new.album,
|
||||
new.genre,
|
||||
new.description,
|
||||
new.file_name
|
||||
);
|
||||
|
||||
CREATE TRIGGER IF NOT EXISTS media_fts_insert AFTER INSERT ON media_items BEGIN
|
||||
INSERT INTO media_fts(rowid, title, artist, album, genre, description, file_name)
|
||||
VALUES (new.rowid, new.title, new.artist, new.album, new.genre, new.description, new.file_name);
|
||||
END;
|
||||
|
||||
CREATE TRIGGER IF NOT EXISTS media_fts_update AFTER UPDATE ON media_items BEGIN
|
||||
INSERT INTO media_fts(media_fts, rowid, title, artist, album, genre, description, file_name)
|
||||
VALUES ('delete', old.rowid, old.title, old.artist, old.album, old.genre, old.description, old.file_name);
|
||||
INSERT INTO media_fts(rowid, title, artist, album, genre, description, file_name)
|
||||
VALUES (new.rowid, new.title, new.artist, new.album, new.genre, new.description, new.file_name);
|
||||
CREATE TRIGGER IF NOT EXISTS media_fts_update
|
||||
AFTER
|
||||
UPDATE ON media_items
|
||||
BEGIN
|
||||
INSERT INTO
|
||||
media_fts (
|
||||
media_fts,
|
||||
rowid,
|
||||
title,
|
||||
artist,
|
||||
album,
|
||||
genre,
|
||||
description,
|
||||
file_name
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'delete',
|
||||
old.rowid,
|
||||
old.title,
|
||||
old.artist,
|
||||
old.album,
|
||||
old.genre,
|
||||
old.description,
|
||||
old.file_name
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
media_fts (
|
||||
rowid,
|
||||
title,
|
||||
artist,
|
||||
album,
|
||||
genre,
|
||||
description,
|
||||
file_name
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
new.rowid,
|
||||
new.title,
|
||||
new.artist,
|
||||
new.album,
|
||||
new.genre,
|
||||
new.description,
|
||||
new.file_name
|
||||
);
|
||||
|
||||
END;
|
||||
|
||||
CREATE TRIGGER IF NOT EXISTS media_fts_delete AFTER DELETE ON media_items BEGIN
|
||||
INSERT INTO media_fts(media_fts, rowid, title, artist, album, genre, description, file_name)
|
||||
VALUES ('delete', old.rowid, old.title, old.artist, old.album, old.genre, old.description, old.file_name);
|
||||
CREATE TRIGGER IF NOT EXISTS media_fts_delete
|
||||
AFTER DELETE ON media_items
|
||||
BEGIN
|
||||
INSERT INTO
|
||||
media_fts (
|
||||
media_fts,
|
||||
rowid,
|
||||
title,
|
||||
artist,
|
||||
album,
|
||||
genre,
|
||||
description,
|
||||
file_name
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'delete',
|
||||
old.rowid,
|
||||
old.title,
|
||||
old.artist,
|
||||
old.album,
|
||||
old.genre,
|
||||
old.description,
|
||||
old.file_name
|
||||
);
|
||||
|
||||
END;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue