Let default state of automark be pending, not None.
This commit is contained in:
parent
af494e2684
commit
34f24d9940
2 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ class Channel(Base):
|
||||||
self.id = db_row['id']
|
self.id = db_row['id']
|
||||||
self.name = db_row['name']
|
self.name = db_row['name']
|
||||||
self.directory = db_row['directory']
|
self.directory = db_row['directory']
|
||||||
self.automark = db_row['automark']
|
self.automark = db_row['automark'] or "pending"
|
||||||
|
|
||||||
def has_pending(self):
|
def has_pending(self):
|
||||||
query = 'SELECT 1 FROM videos WHERE author_id == ? AND download == "pending" LIMIT 1'
|
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)
|
status = self.ycdldb.insert_video(video, commit=False)
|
||||||
|
|
||||||
video = status['video']
|
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)
|
video.mark_state(self.automark, commit=False)
|
||||||
if self.automark == 'downloaded':
|
if self.automark == 'downloaded':
|
||||||
self.ycdldb.download_video(video.id, commit=False)
|
self.ycdldb.download_video(video.id, commit=False)
|
||||||
|
|
|
@ -131,7 +131,7 @@ class YCDLDBChannelMixin:
|
||||||
'id': channel_id,
|
'id': channel_id,
|
||||||
'name': name,
|
'name': name,
|
||||||
'directory': download_directory,
|
'directory': download_directory,
|
||||||
'automark': None,
|
'automark': "pending",
|
||||||
}
|
}
|
||||||
self.sql_insert(table='channels', data=data)
|
self.sql_insert(table='channels', data=data)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue