Skip to content

Commit

Permalink
removed unneeded code
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyTheTank committed Nov 17, 2015
1 parent 9fec190 commit 2438b80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dist/angular-youtube-api-factory.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 5 additions & 14 deletions src/angular-youtube-api-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ angular.module("jtt_youtube", [])
return youtubeFactory;
}])
.service('youtubeSearchDataService', function () {
this.getYoutubeApiBaseUrl = function (_params) {
this.getApiBaseUrl = function (_params) {
return "https://content.googleapis.com/youtube/v3/";
};


this.getNew = function (_type, _params) {

var youtubeSearchData = {
Expand All @@ -85,7 +84,7 @@ angular.module("jtt_youtube", [])
youtubeSearchData.object.q = _params.searchString;
}

youtubeSearchData.url = this.getYoutubeApiBaseUrl()+"search?";
youtubeSearchData.url = this.getApiBaseUrl()+"search?";

if (_params.nextPageToken) {
youtubeSearchData.url += "pageToken="+_params.nextPageToken+"&";
Expand All @@ -102,11 +101,7 @@ angular.module("jtt_youtube", [])
maxResults: _params.maxResults || 20,
};

if (_params.nextPageToken) {
youtubeSearchData.object.pakeToken = _params.nextPageToken;
}

youtubeSearchData.url = this.getYoutubeApiBaseUrl()+"search?";
youtubeSearchData.url = this.getApiBaseUrl()+"search?";
if (_params.nextPageToken) {
youtubeSearchData.url += "pageToken="+_params.nextPageToken+"&";
}
Expand All @@ -121,11 +116,7 @@ angular.module("jtt_youtube", [])
maxResults: _params.maxResults || 20,
};

if (_params.nextPageToken) {
youtubeSearchData.object.pakeToken = _params.nextPageToken;
}

youtubeSearchData.url = this.getYoutubeApiBaseUrl()+"playlistItems?";
youtubeSearchData.url = this.getApiBaseUrl()+"playlistItems?";
if (_params.nextPageToken) {
youtubeSearchData.url += "pageToken="+_params.nextPageToken+"&";
}
Expand All @@ -140,7 +131,7 @@ angular.module("jtt_youtube", [])
maxResults: _params.maxResults || 1,
};

youtubeSearchData.url = this.getYoutubeApiBaseUrl()+"search?";
youtubeSearchData.url = this.getApiBaseUrl()+"search?";
if (_params.nextPageToken) {
youtubeSearchData.url += "pageToken="+_params.nextPageToken+"&";
}
Expand Down

0 comments on commit 2438b80

Please sign in to comment.