From 15a0131587a271a6d357fe678b4a881e53cbf7e0 Mon Sep 17 00:00:00 2001 From: voidstarstar Date: Thu, 27 Nov 2014 21:51:30 -0500 Subject: [PATCH] Added renamer.progress API function. Fixes #4211. This function reports the status of the renamer. Progress value True means the renamer is currently running. Progress value False means the renamer is not currently running. --- couchpotato/core/plugins/renamer.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/couchpotato/core/plugins/renamer.py b/couchpotato/core/plugins/renamer.py index d6381a3..a52e8ba 100755 --- a/couchpotato/core/plugins/renamer.py +++ b/couchpotato/core/plugins/renamer.py @@ -44,6 +44,13 @@ class Renamer(Plugin): }, }) + addApiView('renamer.progress', self.getProgress, docs = { + 'desc': 'Get the progress of current renamer scan', + 'return': {'type': 'object', 'example': """{ + 'progress': False || True, +}"""}, + }) + addEvent('renamer.scan', self.scan) addEvent('renamer.check_snatched', self.checkSnatched) @@ -67,6 +74,11 @@ class Renamer(Plugin): return True + def getProgress(self, **kwargs): + return { + 'progress': self.renaming_started + } + def scanView(self, **kwargs): async = tryInt(kwargs.get('async', 0))