setPoster
This commit is contained in:
parent
7d47ba13a5
commit
8026c64e41
5 changed files with 6 additions and 4 deletions
|
@ -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()
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
/*
|
||||
|
|
|
@ -95,7 +95,7 @@ pandora.ui.postersDialog = function(id) {
|
|||
})
|
||||
);
|
||||
pandora.api.setPoster({
|
||||
id: pandora.user.ui.item,
|
||||
id: id,
|
||||
source: source
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue