diff --git a/pandora/item/models.py b/pandora/item/models.py index 0e944d7..a1be0d1 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -813,7 +813,7 @@ class Item(models.Model): def make_poster(self, force=False): posters = glob(os.path.abspath(os.path.join(settings.MEDIA_ROOT, self.path('poster.*.jpg')))) - for f in filter(posters, lambda p: not p.endswith('poster.local.jpg')): + for f in filter(lambda p: not p.endswith('poster.local.jpg'), posters): os.unlink(f) if not self.poster or force: url = self.prefered_poster_url() diff --git a/pandora/item/views.py b/pandora/item/views.py index b8e042e..5dd0713 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -479,7 +479,7 @@ def setPoster(request): #parse path and return info if item.poster: item.poster.delete() item.save() - tasks.update_poster.delay(item.itemId) + tasks.update_poster(item.itemId) response = json_response() response['data']['poster'] = item.get_poster() else: diff --git a/static/js/pandora/ui/list.js b/static/js/pandora/ui/list.js index abd0804..442bfdb 100644 --- a/static/js/pandora/ui/list.js +++ b/static/js/pandora/ui/list.js @@ -439,6 +439,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument pandora.$ui.mainMenu.disableItem('openmovie'); } if (data.ids.length == 1) { + pandora.user.ui.listItem = data.ids[0]; pandora.api.get({id: data.ids[0], keys:['stream']}, function(result) { pandora.user.infoRatio = result.data.stream.aspectRatio; var height = pandora.$ui.info.width() / pandora.user.infoRatio + 16; diff --git a/static/js/pandora/ui/menu.js b/static/js/pandora/ui/menu.js index 2fc9de9..34e4393 100644 --- a/static/js/pandora/ui/menu.js +++ b/static/js/pandora/ui/menu.js @@ -406,7 +406,8 @@ pandora.ui.mainMenu = function() { pandora.$ui.accountDialog = (pandora.user.level == 'guest' ? pandora.ui.accountDialog('login') : pandora.ui.accountLogoutDialog()).open(); } else if (data.id == 'posters') { - pandora.$ui.postersDialog = pandora.ui.postersDialog(pandora.user.ui.item).open(); + var id = pandora.user.ui.item || pandora.user.ui.listItem; + pandora.$ui.postersDialog = pandora.ui.postersDialog(id).open(); } else if (data.id == 'places') { pandora.$ui.placesDialog = pandora.ui.placesDialog().open(); /* diff --git a/static/js/pandora/ui/postersDialog.js b/static/js/pandora/ui/postersDialog.js index 31596ea..0cac0a4 100644 --- a/static/js/pandora/ui/postersDialog.js +++ b/static/js/pandora/ui/postersDialog.js @@ -95,7 +95,7 @@ pandora.ui.postersDialog = function(id) { }) ); pandora.api.setPoster({ - id: pandora.user.ui.item, + id: id, source: source }); }