diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-01-05 12:48:55 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-01-05 12:48:55 +0100 |
commit | 25c271af32dcd65246f2a32b6e020d00a1445cee (patch) | |
tree | 5c7175450bb98be51d1d06e4fd43be78eba0ab2f | |
parent | try to get colored log on windows working (diff) | |
download | pyload-25c271af32dcd65246f2a32b6e020d00a1445cee.tar.xz |
update multihoster when account updates
-rw-r--r-- | pyload/plugins/addons/MultiHoster.py | 9 | ||||
-rw-r--r-- | pyload/web/pyload_app.py | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/pyload/plugins/addons/MultiHoster.py b/pyload/plugins/addons/MultiHoster.py index f3d88a50d..871defb05 100644 --- a/pyload/plugins/addons/MultiHoster.py +++ b/pyload/plugins/addons/MultiHoster.py @@ -34,6 +34,10 @@ class MultiHoster(Addon, PluginMatcher): def matchPlugin(self, plugin, name): """ Overwritten to overwrite already supported plugins """ + + # TODO: check if account is usable + # TODO: multiuser + # Chooses a random multi hoster plugin if name in self.plugins: return plugin, choice(self.plugins[name]) @@ -63,6 +67,9 @@ class MultiHoster(Addon, PluginMatcher): klass = self.core.pluginManager.getPluginClass("hoster", account.__name__, overwrite=False) + if not klass: + return + # inject plugin plugin account.logDebug("Overwritten Hosters: %s" % ", ".join(sorted(supported))) for hoster in supported: @@ -82,7 +89,7 @@ class MultiHoster(Addon, PluginMatcher): self.regexp[klass.__name__] = re.compile(r".*(%s).*" % "|".join(patterns)) - @AddEventListener("account:deleted") + @AddEventListener(["account:deleted", "account:updated"]) def refreshAccounts(self, plugin=None, loginname=None): self.logDebug("Re-checking accounts") diff --git a/pyload/web/pyload_app.py b/pyload/web/pyload_app.py index 32b288e57..bb75fe385 100644 --- a/pyload/web/pyload_app.py +++ b/pyload/web/pyload_app.py @@ -87,7 +87,7 @@ def index(): if resp.status_code == 200: content = resp.body.read() resp.body = template(content, ws=ws, web=web, setup=setup, external=external, prefix=PREFIX) - resp.content_length = len(resp.body) + resp.content_length = len(resp.body) + 1 # these page should not be cached at all resp.headers.append("Cache-Control", "no-cache") |