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)