Skip to content

Commit

Permalink
Major refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
omarroth committed Sep 6, 2019
1 parent 122d04d commit 755c65a
Show file tree
Hide file tree
Showing 12 changed files with 249 additions and 107 deletions.
6 changes: 2 additions & 4 deletions assets/css/darktheme.css
Expand Up @@ -21,10 +21,8 @@ body {
color: #f0f0f0;
}

.pure-form > fieldset > input,
.pure-control-group > input,
.pure-form > fieldset > select,
.pure-control-group > select {
input,
select {
color: rgba(35, 35, 35, 1);
}

Expand Down
6 changes: 5 additions & 1 deletion assets/js/embed.js
Expand Up @@ -12,7 +12,8 @@ function get_playlist(plid, retries) {
'&format=html&hl=' + video_data.preferences.locale;
} else {
var plid_url = '/api/v1/playlists/' + plid +
'?continuation=' + video_data.id +
'?index=' + video_data.index +
'&continuation' + video_data.id +
'&format=html&hl=' + video_data.preferences.locale;
}

Expand Down Expand Up @@ -45,6 +46,9 @@ function get_playlist(plid, retries) {
}

url.searchParams.set('list', plid);
if (!plid.startsWith('RD')) {
url.searchParams.set('index', xhr.response.index);
}
location.assign(url.pathname + url.search);
});
}
Expand Down
6 changes: 5 additions & 1 deletion assets/js/watch.js
Expand Up @@ -133,7 +133,8 @@ function get_playlist(plid, retries) {
'&format=html&hl=' + video_data.preferences.locale;
} else {
var plid_url = '/api/v1/playlists/' + plid +
'?continuation=' + video_data.id +
'?index=' + video_data.index +
'&continuation=' + video_data.id +
'&format=html&hl=' + video_data.preferences.locale;
}

Expand Down Expand Up @@ -168,6 +169,9 @@ function get_playlist(plid, retries) {
}

url.searchParams.set('list', plid);
if (!plid.startsWith('RD')) {
url.searchParams.set('index', xhr.response.index);
}
location.assign(url.pathname + url.search);
});
}
Expand Down
21 changes: 19 additions & 2 deletions config/sql/playlist_videos.sql
@@ -1,2 +1,19 @@
-- TODO: Playlist stub, add playlist thumbnail(?)
create table playlist_videos (title text, id text, author text, ucid text, length_seconds integer, published timestamptz, plid text references playlists(id), index int8, live_now boolean, primary key (index,plid));
-- Table: public.playlist_videos

-- DROP TABLE public.playlist_videos;

CREATE TABLE playlist_videos
(
title text,
id text,
author text,
ucid text,
length_seconds integer,
published timestamptz,
plid text references playlists(id),
index int8,
live_now boolean,
PRIMARY KEY (index,plid)
);

GRANT ALL ON TABLE public.playlist_videos TO kemal;
21 changes: 18 additions & 3 deletions config/sql/playlists.sql
@@ -1,3 +1,18 @@
-- TODO: Playlist stub, check for missing enum when check_tables: true
create type privacy as enum ('Public', 'Unlisted', 'Private');
create table playlists (title text, id text primary key, author text, description text, video_count integer, created timestamptz, updated timestamptz, privacy privacy, index int8[]);
-- Table: public.playlists

-- DROP TABLE public.playlists;

CREATE TABLE public.playlists
(
title text,
id text primary key,
author text,
description text,
video_count integer,
created timestamptz,
updated timestamptz,
privacy privacy,
index int8[]
);

GRANT ALL ON public.playlists TO kemal;
10 changes: 10 additions & 0 deletions config/sql/privacy.sql
@@ -0,0 +1,10 @@
-- Type: public.privacy

-- DROP TYPE public.privacy;

CREATE TYPE public.privacy AS ENUM
(
'Public',
'Unlisted',
'Private'
);

0 comments on commit 755c65a

Please sign in to comment.