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){