Always add timestamp to registered statics

This commit is contained in:
Ruud
2013-09-03 21:12:22 +02:00
parent cd8d2d4808
commit 400fd461ab
+3 -1
View File
@@ -80,7 +80,7 @@ class ClientScript(Plugin):
for static_type in self.core_static:
for rel_path in self.core_static.get(static_type):
file_path = os.path.join(Env.get('app_dir'), 'couchpotato', 'static', rel_path)
core_url = 'api/%s/static/%s?%s' % (Env.setting('api_key'), rel_path, tryInt(os.path.getmtime(file_path)))
core_url = 'api/%s/static/%s' % (Env.setting('api_key'), rel_path)
if static_type == 'script':
self.registerScript(core_url, file_path, position = 'front')
@@ -165,6 +165,8 @@ class ClientScript(Plugin):
def register(self, api_path, file_path, type, location):
api_path = '%s?%s' % (api_path, tryInt(os.path.getmtime(file_path)))
if not self.urls[type].get(location):
self.urls[type][location] = []
self.urls[type][location].append(api_path)