From d2b8576eb4eb432e580ed9ecb5b1073c9506df27 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Mon, 30 Apr 2018 18:23:29 +0800 Subject: [PATCH] fix(home): get home background image from top level torrent --- .../controllers/home.client.controller.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/core/client/controllers/home.client.controller.js b/modules/core/client/controllers/home.client.controller.js index f616fa3a..0e613246 100644 --- a/modules/core/client/controllers/home.client.controller.js +++ b/modules/core/client/controllers/home.client.controller.js @@ -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); + } + } + }); + } }); };