fix(home): get home background image from top level torrent

This commit is contained in:
OldHawk
2018-04-30 18:23:29 +08:00
parent d3e5afe4c0
commit d2b8576eb4

View File

@@ -37,6 +37,7 @@
torrent_status: 'reviewed',
torrent_type: 'movie',
torrent_vip: false,
isTop: true,
limit: 1
}, function (items) {
if (items.rows.length > 0) {
@@ -45,6 +46,22 @@
$('.body-backdrop').css('backgroundImage', 'url("' + newUrl + '")');
localStorageService.set('body_background_image', newUrl);
}
} else {
TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'movie',
torrent_vip: false,
limit: 1
}, function (items) {
if (items.rows.length > 0) {
var newUrl = vm.TGI.getTorrentBackdropImage(items.rows[0]);
if (newUrl !== url) {
$('.body-backdrop').css('backgroundImage', 'url("' + newUrl + '")');
localStorageService.set('body_background_image', newUrl);
}
}
});
}
});
};