mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-03 12:11:22 +05:30
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
|
CREATE TABLE IF NOT EXISTS public.compilations
|
||||||
(
|
|
||||||
'Public',
|
|
||||||
'Unlisted',
|
|
||||||
'Private'
|
|
||||||
);
|
|
||||||
|
|
||||||
-- Table: public.playlists
|
|
||||||
|
|
||||||
-- DROP TABLE public.playlists;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS public.playlists
|
|
||||||
(
|
(
|
||||||
title text,
|
title text,
|
||||||
id text primary key,
|
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/annotations.sql
|
||||||
psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < config/sql/playlists.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/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.
|
# This module contains functions related to the "playlists" table.
|
||||||
#
|
#
|
||||||
module Invidious::Database::Playlists
|
module Invidious::Database::Compilations
|
||||||
extend self
|
extend self
|
||||||
|
|
||||||
# -------------------
|
# -------------------
|
||||||
@ -173,16 +173,14 @@ end
|
|||||||
#
|
#
|
||||||
# This module contains functions related to the "playlist_videos" table.
|
# This module contains functions related to the "playlist_videos" table.
|
||||||
#
|
#
|
||||||
module Invidious::Database::PlaylistVideos
|
module Invidious::Database::CompilationVideos
|
||||||
extend self
|
extend self
|
||||||
|
|
||||||
private alias VideoIndex = Int64 | Array(Int64)
|
|
||||||
|
|
||||||
# -------------------
|
# -------------------
|
||||||
# Insert / Delete
|
# Insert / Delete
|
||||||
# -------------------
|
# -------------------
|
||||||
|
|
||||||
def insert(video : PlaylistVideo)
|
def insert(video : CompilationVideo)
|
||||||
video_array = video.to_a
|
video_array = video.to_a
|
||||||
|
|
||||||
request = <<-SQL
|
request = <<-SQL
|
||||||
|
Loading…
Reference in New Issue
Block a user