|
@@ -98,3 +98,27 @@ def add_subscription(conf, database, channel="", search="", playlist=""):
|
|
|
"database."), video.title)
|
|
|
LOGGER.info(_("New subscription ") + new_subscription.get_title() +
|
|
|
_(" successfully added"))
|
|
|
+
|
|
|
+
|
|
|
+def list_subscriptions(conf, db):
|
|
|
+ """
|
|
|
+ Prints a list of subscriptions from the database.
|
|
|
+
|
|
|
+ :param conf: configuration object
|
|
|
+ :type conf: lib_stov.configuration.Conf
|
|
|
+ :param db: database object
|
|
|
+ :type db: lib_stov.database.Db
|
|
|
+ """
|
|
|
+ subscriptions_list = db.get_subscriptions(conf)
|
|
|
+ sub_state = None
|
|
|
+ if len(subscriptions_list) != 0:
|
|
|
+ LOGGER.info(_("ID Title"))
|
|
|
+ for sub in subscriptions_list:
|
|
|
+ if not sub.disabled:
|
|
|
+ sub_state = _("enabled")
|
|
|
+ elif sub.disabled:
|
|
|
+ sub_state = _("disabled")
|
|
|
+ LOGGER.info(str(sub.get_id()) + " " + sub.get_title() +
|
|
|
+ " (%s)" % sub_state)
|
|
|
+ else:
|
|
|
+ LOGGER.info(_("No subscriptions added yet, add one!"))
|