diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-02-16 16:11:53 -0800 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-02-16 16:11:53 -0800 |
commit | 4a54c4fe301f37ae63e98defe8240a5d526361c6 (patch) | |
tree | f118173ce70fd94423a60d06e67d851fde09723e /youtube/subscriptions.py | |
parent | c65df7d27df64049e1597e245758f70e808173e1 (diff) | |
download | yt-local-4a54c4fe301f37ae63e98defe8240a5d526361c6.tar.lz yt-local-4a54c4fe301f37ae63e98defe8240a5d526361c6.tar.xz yt-local-4a54c4fe301f37ae63e98defe8240a5d526361c6.zip |
subscriptions: store video duration in database
Diffstat (limited to 'youtube/subscriptions.py')
-rw-r--r-- | youtube/subscriptions.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube/subscriptions.py b/youtube/subscriptions.py index 0d31bd4..a0f7e48 100644 --- a/youtube/subscriptions.py +++ b/youtube/subscriptions.py @@ -33,6 +33,7 @@ def open_database(): uploader_id integer NOT NULL REFERENCES subscribed_channels(id) ON UPDATE CASCADE ON DELETE CASCADE, video_id text NOT NULL, title text NOT NULL, + duration text, time_published integer NOT NULL, description text, )''') @@ -72,7 +73,7 @@ def _get_videos(number, offset): connection = open_database() try: cursor = connection.cursor() - cursor.execute('''SELECT video_id, title, time_published, description, channel_id, channel_name + cursor.execute('''SELECT video_id, title, duration, time_published, description, channel_id, channel_name FROM videos INNER JOIN subscribed_channels on videos.uploader_id = subscribed_channels.id ORDER BY time_published DESC |