diff --git a/CHANGES.md b/CHANGES.md index 2266d244..0f0618f6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ * Add Kodi notifier and metadata * Add priority, device, and sound support to Pushover notifier (port from midgetspy/sickbeard) * Fix updating of pull requests +* Add hidden cache debug page [develop changelog] * Fix traceback error when using the menu item Manage/Update Kodi diff --git a/gui/slick/css/style.css b/gui/slick/css/style.css index 7b430766..22034050 100644 --- a/gui/slick/css/style.css +++ b/gui/slick/css/style.css @@ -1781,6 +1781,31 @@ h2.day, h2.network { top:0; } +/* ======================================================================= +cache.tmpl +========================================================================== */ + +#cacheTable { + text-align: center; +} + +th.col-name-cache, +td.col-name-cache { + text-align: left; +} + +th.col-episodes, +td.col-episodes { + max-width: 250px; + word-wrap: break-word; +} + +th.col-cache, +td.col-cache { + width: 20px; +} + + /* ======================================================================= config*.tmpl ========================================================================== */ diff --git a/gui/slick/interfaces/default/cache.tmpl b/gui/slick/interfaces/default/cache.tmpl new file mode 100644 index 00000000..30c20f71 --- /dev/null +++ b/gui/slick/interfaces/default/cache.tmpl @@ -0,0 +1,85 @@ +#import sickbeard +#import os.path +#set global $title='Cache' +#set global $header='Cache' +#set global $sbPath='..' +#set global $topmenu='cache'# + +#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl') + + + + + +#if $varExists('header') +

$header

+#else +

$title

+#end if + + + + + + + + + + + + + + + + + + + + + + + + +#for $provider in $cacheResults: + #for $hItem in $provider[1]: + + + + + + + + + + + + + #end for +#end for + +
ProviderNameSeasonEpisodesIndexer IdUrlTimeQualityRelease GroupVersion
 
$provider[0]$hItem['name']$hItem['season']$hItem['episodes']$hItem['indexerid']$hItem['time']$hItem['quality']$hItem['release_group']$hItem['version']
+ +#include $os.path.join($sickbeard.PROG_DIR,'gui/slick/interfaces/default/inc_bottom.tmpl') diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 8953625b..f1ffacf3 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -4627,4 +4627,21 @@ class ApiBuilder(MainHandler): else: t.apikey = 'api key not generated' + return t.respond() + + +class Cache(MainHandler): + def index(self): + myDB = db.DBConnection('cache.db') + results = [] + for provider in sickbeard.providers.sortedProviderList(): + try: + sqlResults = myDB.select('SELECT * FROM %s' % provider.cache.providerID) + except: + continue + results.append((provider.name, sqlResults)) + + t = PageTemplate(headers=self.request.headers, file='cache.tmpl') + t.cacheResults = results + return t.respond() \ No newline at end of file diff --git a/sickbeard/webserveInit.py b/sickbeard/webserveInit.py index 67805582..88296bbd 100644 --- a/sickbeard/webserveInit.py +++ b/sickbeard/webserveInit.py @@ -89,6 +89,7 @@ class WebServer(threading.Thread): self.app.add_handlers('.*$', [ (r'%s/api/builder(/?)(.*)' % self.options['web_root'], webserve.ApiBuilder), (r'%s/api(/?.*)' % self.options['web_root'], webapi.Api), + (r'%s/cache(/?.*)' % self.options['web_root'], webserve.Cache), (r'%s/config/general(/?.*)' % self.options['web_root'], webserve.ConfigGeneral), (r'%s/config/search(/?.*)' % self.options['web_root'], webserve.ConfigSearch), (r'%s/config/providers(/?.*)' % self.options['web_root'], webserve.ConfigProviders),