Skip to content

Commit

Permalink
Filter out unplayable tracks from library on update
Browse files Browse the repository at this point in the history
  • Loading branch information
theli-ua committed May 12, 2017
1 parent cb3747d commit afcbd75
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion amazon/content/contents/code/amazon.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,19 @@ var AmazonResolver = Tomahawk.extend( Tomahawk.Resolver, {
return that._post(this.api_location + 'cirrus/', {
data: _query
}, true).then(function(response) {
previousResults = previousResults.concat(response.searchLibraryResponse.searchLibraryResult.searchReturnItemList.map(that._convertTrack));
previousResults = previousResults.concat(response
.searchLibraryResponse
.searchLibraryResult
.searchReturnItemList
.filter(function(track) {
track = track.metadata;
return (
track.purchased == 'true' ||
track.uploaded == 'true' ||
(track.primeStatus == 'PRIME' && that._appConfig.featureController.robin == 1) ||
(track.isMusicSubscription == 'true' && that._appConfig.featureController.hawkfireAccess == 1));
})
.map(that._convertTrack));
nextResultsToken = response.searchLibraryResponse.searchLibraryResult.nextResultsToken;
if (null === nextResultsToken)
return previousResults;
Expand Down
2 changes: 1 addition & 1 deletion amazon/content/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"pluginName": "amazon",
"author": "Creepy Guy In The Corner",
"email": "",
"version": "0.0.10",
"version": "0.0.11",
"website": "http://gettomahawk.com",
"description": "Streams music from Amazon Music",
"type": "resolver/javascript",
Expand Down

0 comments on commit afcbd75

Please sign in to comment.