Skip to content

Commit 311381f

Browse files
committed
Merge pull request #713 from Pitros/fix_dupes
Remove rest of code for sorting - fix for duplicated tracks
2 parents a77b4b8 + 52e24ea commit 311381f

5 files changed

Lines changed: 0 additions & 15 deletions

File tree

app/public/js/charts/chartsCtrl.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,13 @@ app.controller('ChartsCtrl', function (
149149
}
150150

151151
$scope.title = 'Top 50 - '+genre.title;
152-
$scope.originalData = '';
153152
$scope.data = '';
154153
$scope.busy = false;
155154

156155

157156
SC2apiService.getCharts(genre.link)
158157
.then(filterCollection)
159158
.then(function (collection) {
160-
$scope.originalData = collection;
161159
$scope.data = collection;
162160
loadTracksInfo(collection);
163161
})
@@ -179,7 +177,6 @@ app.controller('ChartsCtrl', function (
179177
SC2apiService.getNextPage()
180178
.then(filterCollection)
181179
.then(function (collection) {
182-
$scope.originalData = $scope.originalData.concat(collection);
183180
$scope.data = $scope.data.concat(collection);
184181
utilsService.updateTracksLikes(collection, true);
185182
utilsService.updateTracksReposts(collection, true);

app/public/js/favorites/favoritesCtrl.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ app.controller('FavoritesCtrl', function (
1010
, params = 'linked_partitioning=1';
1111

1212
$scope.title = 'Likes';
13-
$scope.originalData = '';
1413
$scope.data = '';
1514
$scope.busy = false;
1615

1716
SCapiService.get(endpoint, params)
1817
.then(function(data) {
19-
$scope.originalData = data.collection;
2018
$scope.data = data.collection;
2119
}, function(error) {
2220
console.log('error', error);
@@ -35,7 +33,6 @@ app.controller('FavoritesCtrl', function (
3533
SCapiService.getNextPage()
3634
.then(function(data) {
3735
for ( var i = 0; i < data.collection.length; i++ ) {
38-
$scope.originalData.push( data.collection[i] );
3936
$scope.data.push( data.collection[i] )
4037
}
4138
utilsService.updateTracksReposts(data.collection, true);

app/public/js/profile/profileCtrl.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ app.controller('ProfileCtrl', function (
2121
$scope.followers_count = '';
2222
$scope.busy = false;
2323
//tracks
24-
$scope.originalData = '';
2524
$scope.data = '';
2625
$scope.follow_button_text = '';
2726

@@ -39,7 +38,6 @@ app.controller('ProfileCtrl', function (
3938

4039
SCapiService.getProfileTracks(userId)
4140
.then(function(data) {
42-
$scope.originalData = data.collection;
4341
$scope.data = data.collection;
4442
}, function(error) {
4543
console.log('error', error);
@@ -68,7 +66,6 @@ app.controller('ProfileCtrl', function (
6866
SCapiService.getNextPage()
6967
.then(function(data) {
7068
for ( var i = 0; i < data.collection.length; i++ ) {
71-
$scope.originalData.push( data.collection[i] );
7269
$scope.data.push( data.collection[i] );
7370
}
7471
utilsService.updateTracksReposts(data.collection, true);

app/public/js/stream/streamCtrl.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ app.controller('StreamCtrl', function (
1010
var tracksIds = [];
1111

1212
$scope.title = 'Stream';
13-
$scope.originalData = '';
1413
$scope.data = '';
1514
$scope.busy = false;
1615

1716
SC2apiService.getStream()
1817
.then(filterCollection)
1918
.then(function (collection) {
20-
$scope.originalData = collection;
2119
$scope.data = collection;
2220

2321
})
@@ -39,7 +37,6 @@ app.controller('StreamCtrl', function (
3937
SC2apiService.getNextPage()
4038
.then(filterCollection)
4139
.then(function (collection) {
42-
$scope.originalData = $scope.originalData.concat(collection);
4340
$scope.data = $scope.data.concat(collection);
4441
utilsService.updateTracksLikes(collection, true);
4542
utilsService.updateTracksReposts(collection, true);

app/public/js/tag/tagCtrl.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ app.controller('tagCtrl', function (
1111
var tagUrl = encodeURIComponent($stateParams.name);
1212

1313
$scope.tag = $stateParams.name;
14-
$scope.originalData = '';
1514
$scope.data = '';
1615

1716
SCapiService.get('search/sounds', 'limit=32&q=*&filter.genre_or_tag=' + tagUrl)
1817
.then(function (data) {
19-
$scope.originalData = data.collection;
2018
$scope.data = data.collection;
2119
}, function (error) {
2220
console.log('error', error);
@@ -34,7 +32,6 @@ app.controller('tagCtrl', function (
3432
SCapiService.getNextPage()
3533
.then(function (data) {
3634
for (var i = 0; i < data.collection.length; i++) {
37-
$scope.originalData.push(data.collection[i]);
3835
$scope.data.push(data.collection[i]);
3936
}
4037
utilsService.updateTracksReposts(data.collection, true);

0 commit comments

Comments
 (0)