Let default state of automark be pending, not None.

This commit is contained in:
voussoir 2020-05-21 17:25:06 -07:00
parent af494e2684
commit 34f24d9940
2 changed files with 3 additions and 3 deletions

View file

@ -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)

View file

@ -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)