|
@@ -311,10 +311,10 @@ def list_videos(database, conf, sub_id):
|
|
|
"""
|
|
|
Lists all videos in a specified subscription
|
|
|
|
|
|
+ :param database: database object
|
|
|
+ :type database: lib_stov.database.Db
|
|
|
:param conf: configuration object
|
|
|
:type conf: lib_stov.configuration.Conf
|
|
|
- :param downloaded_videos: number of downloaded videos
|
|
|
- :type downloaded_videos: int
|
|
|
:param sub_id: ID of the subscription
|
|
|
:type sub_id: int
|
|
|
"""
|
|
@@ -340,3 +340,28 @@ def list_videos(database, conf, sub_id):
|
|
|
else:
|
|
|
LOGGER.error(_("Invalid subscription, please check the list and "
|
|
|
"try again."))
|
|
|
+
|
|
|
+
|
|
|
+def catchup(database, sub_id):
|
|
|
+ """
|
|
|
+ Marks all videos in a subscription as downloaded
|
|
|
+
|
|
|
+ :param database: database object
|
|
|
+ :type database: lib_stov.database.Db
|
|
|
+ :param sub_id: ID of the subscription
|
|
|
+ :type sub_id: int
|
|
|
+ """
|
|
|
+ try:
|
|
|
+ sub_data = database.get_subscription_title(sub_id)
|
|
|
+ except stov_exceptions.DBWriteAccessFailedException as error:
|
|
|
+ LOGGER.error(error)
|
|
|
+ sys.exit(1)
|
|
|
+ else:
|
|
|
+ if sub_data != []:
|
|
|
+ try:
|
|
|
+ database.mark_video_downloaded(sub_id)
|
|
|
+ except stov_exceptions.DBWriteAccessFailedException as error:
|
|
|
+ LOGGER.error(error)
|
|
|
+ else:
|
|
|
+ LOGGER.error(_("The subscription could not be updated, "
|
|
|
+ "please check if the ID given is correct."))
|