From 809997b34b134e57699fb7e7eda9314a6babbf4e Mon Sep 17 00:00:00 2001 From: Philippe Vienne Date: Sun, 17 Apr 2016 23:01:35 +0200 Subject: [PATCH] Load duplicates --- public/partials/dups.html | 10 ++++++++-- public/script.js | 17 +++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/public/partials/dups.html b/public/partials/dups.html index 5c9ffe8..6c8e211 100644 --- a/public/partials/dups.html +++ b/public/partials/dups.html @@ -1,2 +1,8 @@ -

UID: {{uid}}

-

ID: {{id}}

\ No newline at end of file +

Results

+
Loading...
+
No duplicates found
+
+
+ {{t.track.name}} - {{artist == t.track.artists[0]?'':', '}}{{artist.name}} +
+
\ No newline at end of file diff --git a/public/script.js b/public/script.js index a4f5bd5..6fa8dac 100644 --- a/public/script.js +++ b/public/script.js @@ -88,10 +88,23 @@ $scope.load(); }]); - app.controller("DupsCtrl",['$scope', '$stateParams',function($scope, $stateParams){ + app.controller("DupsCtrl",['$scope', '$stateParams', '$http',function($scope, $stateParams, $http){ $scope.uid = $stateParams['uid']; $scope.id = $stateParams['id']; - + $scope.tracks = []; + $scope.loaded = false; + $scope.load = function () { + $http.get('/pl/' + $scope.uid + '/' + $scope.id, { + params: { + access_token: $scope.access_token + } + }).then(function(result) { + var r = result.data; + $scope.tracks = r.data; + $scope.loaded = true; + }); + }; + $scope.load(); }]); app.controller('AuthCtrl',['$scope', '$rootScope', '$interval', '$http', function($scope, $rootScope, $interval, $http){