From 34f24d994033664d8fdcd08915f784762b9b6f26 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 21 May 2020 17:25:06 -0700 Subject: [PATCH] Let default state of automark be pending, not None. --- ycdl/objects.py | 4 ++-- ycdl/ycdldb.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ycdl/objects.py b/ycdl/objects.py index ae6f2b7..9b4aa21 100644 --- a/ycdl/objects.py +++ b/ycdl/objects.py @@ -21,7 +21,7 @@ class Channel(Base): self.id = db_row['id'] self.name = db_row['name'] self.directory = db_row['directory'] - self.automark = db_row['automark'] + self.automark = db_row['automark'] or "pending" def has_pending(self): query = 'SELECT 1 FROM videos WHERE author_id == ? AND download == "pending" LIMIT 1' @@ -37,7 +37,7 @@ class Channel(Base): status = self.ycdldb.insert_video(video, commit=False) video = status['video'] - if status['new'] and self.automark is not None: + if status['new'] and self.automark not in [None, "pending"]: video.mark_state(self.automark, commit=False) if self.automark == 'downloaded': self.ycdldb.download_video(video.id, commit=False) diff --git a/ycdl/ycdldb.py b/ycdl/ycdldb.py index c3148fc..b5fd3ae 100644 --- a/ycdl/ycdldb.py +++ b/ycdl/ycdldb.py @@ -131,7 +131,7 @@ class YCDLDBChannelMixin: 'id': channel_id, 'name': name, 'directory': download_directory, - 'automark': None, + 'automark': "pending", } self.sql_insert(table='channels', data=data)