From 9d5ac8ade75b976b7a41fec56f56cd9c91af5e9d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 10 May 2013 11:59:20 +0000 Subject: [PATCH] use date item.modified as uid for icons/posters to avoid cache issues --- static/js/pandora/browser.js | 4 ++-- static/js/pandora/infoView.0xdb.js | 5 ++--- static/js/pandora/infoView.indiancinema.js | 5 ++--- static/js/pandora/infoView.padma.js | 5 ++--- static/js/pandora/list.js | 19 ++++++++++--------- 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/static/js/pandora/browser.js b/static/js/pandora/browser.js index 2e7cb7524..06da1e825 100644 --- a/static/js/pandora/browser.js +++ b/static/js/pandora/browser.js @@ -77,7 +77,7 @@ pandora.ui.browser = function() { url = '/' + data.id + '/' + ( ui.icons == 'posters' ? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon' - ) + '128.jpg', + ) + '128.jpg?' + data.modified, format, info, sortKey = sort[0].key; if (['title', 'director', 'random'].indexOf(sortKey) > -1) { info = data['year']; @@ -111,7 +111,7 @@ pandora.ui.browser = function() { query: pandora.user.ui.find }), callback); }, - keys: ['director', 'id', 'posterRatio', 'title', 'year'], + keys: ['director', 'id', 'modified', 'posterRatio', 'title', 'year'], max: 1, min: 1, orientation: 'horizontal', diff --git a/static/js/pandora/infoView.0xdb.js b/static/js/pandora/infoView.0xdb.js index 95332bdfb..3c615025f 100644 --- a/static/js/pandora/infoView.0xdb.js +++ b/static/js/pandora/infoView.0xdb.js @@ -26,7 +26,6 @@ pandora.ui.infoView = function(data) { listWidth = 144 + Ox.UI.SCROLLBAR_SIZE, margin = 16, statisticsWidth = 128, - uid = Ox.uid(), that = Ox.Element(), @@ -63,7 +62,7 @@ pandora.ui.infoView = function(data) { src: '/' + data.id + '/' + ( ui.icons == 'posters' ? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon' - ) + '512.jpg?' + uid + ) + '512.jpg?' + data.modified }) .css({ position: 'absolute', @@ -96,7 +95,7 @@ pandora.ui.infoView = function(data) { src: '/' + data.id + '/' + ( ui.icons == 'posters' ? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon' - ) + '512.jpg?' + uid + ) + '512.jpg?' + data.modified }) .css({ position: 'absolute', diff --git a/static/js/pandora/infoView.indiancinema.js b/static/js/pandora/infoView.indiancinema.js index d4292fa2e..cf280cd89 100644 --- a/static/js/pandora/infoView.indiancinema.js +++ b/static/js/pandora/infoView.indiancinema.js @@ -37,7 +37,6 @@ pandora.ui.infoView = function(data) { studios: getStudios() }, statisticsWidth = 128, - uid = Ox.uid(), that = Ox.Element(), @@ -67,7 +66,7 @@ pandora.ui.infoView = function(data) { src: '/' + data.id + '/' + ( ui.icons == 'posters' ? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon' - ) + '512.jpg?' + uid + ) + '512.jpg?' + data.modified }) .css({ position: 'absolute', @@ -100,7 +99,7 @@ pandora.ui.infoView = function(data) { src: '/' + data.id + '/' + ( ui.icons == 'posters' ? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon' - ) + '512.jpg?' + uid + ) + '512.jpg?' + data.modified }) .css({ position: 'absolute', diff --git a/static/js/pandora/infoView.padma.js b/static/js/pandora/infoView.padma.js index f567f971d..93b072360 100644 --- a/static/js/pandora/infoView.padma.js +++ b/static/js/pandora/infoView.padma.js @@ -22,7 +22,6 @@ pandora.ui.infoView = function(data) { nameKeys = ['director', 'cinematograper', 'featuring'], listKeys = nameKeys.concat(['language', 'topic', 'license', 'groups']), statisticsWidth = 128, - uid = Ox.uid(), that = Ox.Element(), @@ -56,7 +55,7 @@ pandora.ui.infoView = function(data) { .attr({ src: '/' + data.id + '/' + ( ui.icons == 'posters' ? 'poster' : 'icon' - ) + '512.jpg?' + uid + ) + '512.jpg?' + data.modified }) .css({ position: 'absolute', @@ -90,7 +89,7 @@ pandora.ui.infoView = function(data) { .attr({ src: '/' + data.id + '/' + ( ui.icons == 'posters' ? 'poster' : 'icon' - ) + '512.jpg?' + uid + ) + '512.jpg?' + data.modified }) .css({ position: 'absolute', diff --git a/static/js/pandora/list.js b/static/js/pandora/list.js index 6f75b626a..ea6ba472e 100644 --- a/static/js/pandora/list.js +++ b/static/js/pandora/list.js @@ -44,7 +44,7 @@ pandora.ui.list = function() { //background: 'transparent' }); }).attr({ - src: '/' + data.id + '/' + icon + '14.jpg' + src: '/' + data.id + '/' + icon + '14.jpg?' + data.modified }); }, id: 'posterRatio', @@ -83,7 +83,8 @@ pandora.ui.list = function() { items: function(data, callback) { //Ox.Log('', 'data, pandora.Query.toObject', data, pandora.Query.toObject()) pandora.api.find(Ox.extend(data, { - query: pandora.user.ui.find + query: pandora.user.ui.find, + keys: ['modified'].concat(data.keys) }), callback); return Ox.clone(data, true); }, @@ -130,7 +131,7 @@ pandora.ui.list = function() { url = '/' + data.id + '/' + ( ui.icons == 'posters' ? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon' - ) + size + '.jpg', + ) + size + '.jpg?' + data.modified, format, info, sortKey = sort[0].key; if (['title', 'director', 'random'].indexOf(sortKey) > -1) { info = data['year']; @@ -165,7 +166,7 @@ pandora.ui.list = function() { }), callback); return Ox.clone(data, true); }, - keys: ['director', 'id', 'posterRatio', 'title', 'year'], + keys: ['director', 'id', 'modified', 'posterRatio', 'title', 'year'], selected: pandora.user.ui.listSelection, size: 128, sort: pandora.user.ui.listSort, @@ -188,7 +189,7 @@ pandora.ui.list = function() { url = '/' + data.id + '/' + ( ui.icons == 'posters' ? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon' - ) + size + '.jpg', + ) + size + '.jpg?' + data.modified, format, info, sortKey = sort[0].key; if (['title', 'director'].indexOf(sortKey) > -1) { info = data['year']; @@ -239,7 +240,7 @@ pandora.ui.list = function() { }), callback); return Ox.clone(data, true); }, - keys: ['clips', 'director', 'duration', 'id', 'posterRatio', 'title', 'videoRatio', 'year'], + keys: ['clips', 'director', 'duration', 'id', 'modified', 'posterRatio', 'title', 'videoRatio', 'year'], selected: pandora.user.ui.listSelection, size: 192, sort: pandora.user.ui.listSort, @@ -273,7 +274,7 @@ pandora.ui.list = function() { url = '/' + data.id + '/' + ( ui.icons == 'posters' ? (ui.showSitePosters ? 'siteposter' : 'poster') : 'icon' - ) + size + '.jpg', + ) + size + '.jpg?' + data.modified, format, info, sortKey = sort[0].key; if (['title', 'director'].indexOf(sortKey) > -1) { info = data['year']; @@ -355,7 +356,7 @@ pandora.ui.list = function() { }} : {})), callback); return Ox.clone(data, true); }, - keys: ['clips', 'director', 'duration', 'id', 'posterRatio', 'rendered', 'title', 'year'], + keys: ['clips', 'director', 'duration', 'id', 'modified', 'posterRatio', 'rendered', 'title', 'year'], selected: pandora.user.ui.listSelection, size: 192, sort: pandora.user.ui.listSort, @@ -448,7 +449,7 @@ pandora.ui.list = function() { } pandora.requests.preview && pandora.api.cancel(pandora.requests.preview); pandora.requests.preview = pandora.api.find({ - keys: ['director', 'id', 'posterRatio', 'title', 'year'], + keys: ['director', 'id', 'modified', 'posterRatio', 'title', 'year'], query: { conditions: data.ids.map(function(id) { return {