From 93a196dd89b2381d445f4356293c6c6c7a795108 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Wed, 17 May 2017 11:10:59 +0800 Subject: [PATCH] load torrent detail info from local db --- .../core/client/views/home.client.view.html | 4 +- .../torrent-info.client.controller.js | 60 +++++++------- .../views/view-torrent.client.view.html | 80 +++++++++---------- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/modules/core/client/views/home.client.view.html b/modules/core/client/views/home.client.view.html index 86f8bf67..83a9a82f 100644 --- a/modules/core/client/views/home.client.view.html +++ b/modules/core/client/views/home.client.view.html @@ -23,7 +23,7 @@
{{vm.movieTopOne.torrent_director}}
- +
{{ 'TMDB_FIELDS.GENRES' | translate}}:
@@ -183,7 +183,7 @@ -
+
diff --git a/modules/torrents/client/controllers/torrent-info.client.controller.js b/modules/torrents/client/controllers/torrent-info.client.controller.js index 67c58282..cd6db456 100644 --- a/modules/torrents/client/controllers/torrent-info.client.controller.js +++ b/modules/torrents/client/controllers/torrent-info.client.controller.js @@ -121,7 +121,7 @@ if (res.torrent_backdrop_img) { $('.backdrop').css('backgroundImage', 'url(' + vm.tmdbConfig.backdrop_img_base_url + res.torrent_backdrop_img + ')'); } - vm.initInfo(res.torrent_tmdb_id); + //vm.initInfo(res.torrent_tmdb_id); vm.commentBuildPager(); vm.torrentTabs.push( @@ -185,23 +185,23 @@ /** * initInfo */ - vm.initInfo = function (tmdb_id) { - TorrentsService.getTMDBInfo({ - tmdbid: tmdb_id, - language: getStorageLangService.getLang() - }, function (res) { - Notification.success({ - message: ' ' + $translate.instant('TMDB_INFO_OK') - }); - - console.log(res); - vm.movieinfo = res; - }, function (err) { - Notification.error({ - message: ' ' + $translate.instant('TMDB_INFO_FAILED') - }); - }); - }; + //vm.initInfo = function (tmdb_id) { + // TorrentsService.getTMDBInfo({ + // tmdbid: tmdb_id, + // language: getStorageLangService.getLang() + // }, function (res) { + // Notification.success({ + // message: ' ' + $translate.instant('TMDB_INFO_OK') + // }); + // + // console.log(res); + // vm.movieinfo = res; + // }, function (err) { + // Notification.error({ + // message: ' ' + $translate.instant('TMDB_INFO_FAILED') + // }); + // }); + //}; /** * downloadTorrent @@ -256,18 +256,18 @@ * getDirector * @returns {string} */ - vm.getDirector = function () { - var n = '-'; - - if (vm.movieinfo) { - angular.forEach(vm.movieinfo.credits.crew, function (item) { - if (item.job === 'Director') { - n = item.name; - } - }); - } - return n; - }; + //vm.getDirector = function () { + // var n = '-'; + // + // if (vm.movieinfo) { + // angular.forEach(vm.movieinfo.credits.crew, function (item) { + // if (item.job === 'Director') { + // n = item.name; + // } + // }); + // } + // return n; + //}; /** * getVideoNfoHtml diff --git a/modules/torrents/client/views/view-torrent.client.view.html b/modules/torrents/client/views/view-torrent.client.view.html index 00b60bc9..14a0c665 100644 --- a/modules/torrents/client/views/view-torrent.client.view.html +++ b/modules/torrents/client/views/view-torrent.client.view.html @@ -15,122 +15,122 @@
{{ 'TMDB_FIELDS.ORIGINAL_TITLE' | translate}}:
-
{{vm.movieinfo.original_title}}
+
{{vm.torrentLocalInfo.torrent_original_title}}
{{ 'TMDB_FIELDS.TITLE' | translate}}:
-
{{vm.movieinfo.title}}
+
{{vm.torrentLocalInfo.torrent_title}}
{{ 'TMDB_FIELDS.DIRECTOR' | translate}}:
-
{{vm.getDirector()}}
+
{{vm.torrentLocalInfo.torrent_director}}
{{ 'TMDB_FIELDS.ORIGINAL_LANGUAGE' | translate}}:
-
{{vm.movieinfo.original_language}}
+
{{vm.torrentLocalInfo.torrent_original_language}}
{{ 'TMDB_FIELDS.GENRES' | translate}}:
- {{item.name}} + {{item}}
{{ 'TMDB_FIELDS.PRODUCTION_COMPANIES' | translate}}:
- {{item.name}} - - + {{item}} + -
{{ 'TMDB_FIELDS.PRODUCTION_COUNTRIES' | translate}}:
- {{item.iso_3166_1}} - - + {{item}} + -
{{ 'TMDB_FIELDS.RELEASE_DATE' | translate}}:
-
{{vm.movieinfo.release_date}}
+
{{vm.torrentLocalInfo.torrent_release}}
{{ 'TMDB_FIELDS.RUNTIME' | translate}}:
-
{{vm.movieinfo.runtime | runtime}}
+
{{vm.torrentLocalInfo.torrent_runtime | runtime}}
-
+
{{ 'TMDB_FIELDS.BUDGET' | translate}}:
-
{{vm.movieinfo.budget | dollar:2}}
+
{{vm.torrentLocalInfo.torrent_budget | dollar:2}}
-
+
{{ 'TMDB_FIELDS.REVENUE' | translate}}:
-
{{vm.movieinfo.revenue | dollar:2}}
+
{{vm.torrentLocalInfo.torrent_revenue | dollar:2}}
{{ 'TMDB_FIELDS.VOTE_AVERAGE' | translate}}:
- + IMDB - {{vm.movieinfo.vote_average}} / {{vm.movieinfo.vote_count}} {{ 'TMDB_FIELDS.VOTE_UNIT' | translate}} + {{vm.torrentLocalInfo.torrent_imdb_votes}} / {{vm.torrentLocalInfo.torrent_imdb_votes_users}} {{ 'TMDB_FIELDS.VOTE_UNIT' | translate}}
{{ 'TMDB_FIELDS.IMDB_LINK' | translate}}:
-
{{vm.imdbConfig.imdb_link_url}}{{vm.movieinfo.imdb_id}}
+
{{vm.imdbConfig.imdb_link_url}}{{vm.torrentLocalInfo.torrent_imdb_id}}
{{ 'TMDB_FIELDS.TMDB_LINK' | translate}}:
-
{{vm.tmdbConfig.tmdb_link_url}}{{vm.movieinfo.id}}
+
{{vm.tmdbConfig.tmdb_link_url}}{{vm.torrentLocalInfo.torrent_tmdb_id}}
{{ 'TMDB_FIELDS.OVERVIEW' | translate}}:
-
{{vm.movieinfo.overview}}
+
{{vm.torrentLocalInfo.torrent_overview}}
- - {{vm.movieinfo.credits.cast[0].name}} + {{vm.torrentLocalInfo.torrent_cast[0].name}} -

{{vm.movieinfo.credits.cast[0].character}}

+

{{vm.torrentLocalInfo.torrent_cast[0].character}}

- - {{vm.movieinfo.credits.cast[1].name}} + {{vm.torrentLocalInfo.torrent_cast[1].name}} -

{{vm.movieinfo.credits.cast[1].character}}

+

{{vm.torrentLocalInfo.torrent_cast[1].character}}

- - {{vm.movieinfo.credits.cast[2].name}} + {{vm.torrentLocalInfo.torrent_cast[2].name}} -

{{vm.movieinfo.credits.cast[2].character}}

+

{{vm.torrentLocalInfo.torrent_cast[2].character}}

- - {{vm.movieinfo.credits.cast[3].name}} + {{vm.torrentLocalInfo.torrent_cast[3].name}} -

{{vm.movieinfo.credits.cast[3].character}}

+

{{vm.torrentLocalInfo.torrent_cast[3].character}}

- - {{vm.movieinfo.credits.cast[4].name}} + {{vm.torrentLocalInfo.torrent_cast[4].name}} -

{{vm.movieinfo.credits.cast[4].character}}

+

{{vm.torrentLocalInfo.torrent_cast[4].character}}

- - {{vm.movieinfo.credits.cast[5].name}} + {{vm.torrentLocalInfo.torrent_cast[5].name}} -

{{vm.movieinfo.credits.cast[5].character}}

+

{{vm.torrentLocalInfo.torrent_cast[5].character}}