mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-24 12:02:39 +00:00
Add compilations to DB
This commit is contained in:
parent
24f55a7876
commit
bef234fd74
@ -1,19 +1,8 @@
|
||||
-- Type: public.privacy
|
||||
-- Table: public.compilations
|
||||
|
||||
-- DROP TYPE public.privacy;
|
||||
-- DROP TABLE public.compilations;
|
||||
|
||||
CREATE TYPE public.privacy AS ENUM
|
||||
(
|
||||
'Public',
|
||||
'Unlisted',
|
||||
'Private'
|
||||
);
|
||||
|
||||
-- Table: public.playlists
|
||||
|
||||
-- DROP TABLE public.playlists;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.playlists
|
||||
CREATE TABLE IF NOT EXISTS public.compilations
|
||||
(
|
||||
title text,
|
||||
id text primary key,
|
||||
|
@ -10,3 +10,5 @@ psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/nonces.sql
|
||||
psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/annotations.sql
|
||||
psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/playlists.sql
|
||||
psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/playlist_videos.sql
|
||||
psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/compilations.sql
|
||||
psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/compilation_videos.sql
|
||||
|
@ -3,7 +3,7 @@ require "./base.cr"
|
||||
#
|
||||
# This module contains functions related to the "playlists" table.
|
||||
#
|
||||
module Invidious::Database::Playlists
|
||||
module Invidious::Database::Compilations
|
||||
extend self
|
||||
|
||||
# -------------------
|
||||
@ -173,16 +173,14 @@ end
|
||||
#
|
||||
# This module contains functions related to the "playlist_videos" table.
|
||||
#
|
||||
module Invidious::Database::PlaylistVideos
|
||||
module Invidious::Database::CompilationVideos
|
||||
extend self
|
||||
|
||||
private alias VideoIndex = Int64 | Array(Int64)
|
||||
|
||||
# -------------------
|
||||
# Insert / Delete
|
||||
# -------------------
|
||||
|
||||
def insert(video : PlaylistVideo)
|
||||
def insert(video : CompilationVideo)
|
||||
video_array = video.to_a
|
||||
|
||||
request = <<-SQL
|
||||
|
Loading…
Reference in New Issue
Block a user