Skip to content

Commit

Permalink
chore: bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyTheTank committed Mar 12, 2016
1 parent 424386e commit cf1313a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 31 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"authors": [
"Jonathan Hornung <jonathan.hornung@gmail.com>"
],
"version": "0.7.9",
"version": "0.7.10",
"description": "Dailymotion plugin for apiNG",
"main": "dist/aping-plugin-dailymotion.min.js",
"moduleType": [],
Expand Down
32 changes: 5 additions & 27 deletions dist/aping-plugin-dailymotion.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
@name: aping-plugin-dailymotion
@version: 0.7.9 (02-02-2016)
@version: 0.7.10 (12-03-2016)
@author: Jonathan Hornung <jonathan.hornung@gmail.com>
@url: https://github.com/JohnnyTheTank/apiNG-plugin-dailymotion#readme
@license: MIT
Expand All @@ -14,119 +14,97 @@ angular.module("jtt_aping_dailymotion", ['jtt_dailymotion'])
restrict: 'A',
replace: 'false',
link: function (scope, element, attrs, apingController) {

var appSettings = apingController.getAppSettings();

var requests = apingUtilityHelper.parseJsonFromAttributes(attrs.apingDailymotion, apingDailymotionHelper.getThisPlattformString(), appSettings);

requests.forEach(function (request) {

//create helperObject for helper function call
var helperObject = {
model: appSettings.model,
};

if (angular.isDefined(appSettings.getNativeData)) {
helperObject.getNativeData = appSettings.getNativeData;
} else {
helperObject.getNativeData = false;
}

if (request.protocol === "http" || request.protocol === "https") {
helperObject.protocol = request.protocol + "://";
} else if (appSettings.protocol === "http" || appSettings.protocol === "https") {
helperObject.protocol = appSettings.protocol + "://";
} else {
helperObject.protocol = "//";
}


//create requestObject for api request call
var requestObject = {};

if (angular.isDefined(request.items)) {
requestObject.limit = request.items;
} else {
requestObject.limit = appSettings.items;
}

if (requestObject.limit === 0 || requestObject.limit === '0') {
return false;
}

// -1 is "no explicit limit". same for NaN value
if (requestObject.limit < 0 || isNaN(requestObject.limit)) {
requestObject.limit = undefined;
}

// the api has a limit of 100 items per request
if (requestObject.limit > 100) {
requestObject.limit = 100;
}

if (angular.isDefined(request.search)) {
requestObject.search = request.search;
}

if (angular.isDefined(request.tags)) {
requestObject.tags = request.tags;
}

if (request.userId) {

requestObject.id = request.userId;
requestObject.sort = 'recent';

if (angular.isDefined(request.channelId)) {
requestObject.channel = request.channelId;
}

dailymotionFactory.getVideosFromUserById(requestObject)
.then(function (_data) {
if (_data) {
apingController.concatToResults(apingDailymotionHelper.getObjectByJsonData(_data, helperObject));
}
});
} else if (request.channelId) {

requestObject.id = request.channelId;
requestObject.sort = 'recent';

dailymotionFactory.getVideosFromChannelById(requestObject)
.then(function (_data) {
if (_data) {
apingController.concatToResults(apingDailymotionHelper.getObjectByJsonData(_data, helperObject));
}
});
} else if (request.playlistId) {

requestObject.id = request.playlistId;
requestObject.sort = 'recent';

dailymotionFactory.getVideosFromPlaylistById(requestObject)
.then(function (_data) {
if (_data) {
apingController.concatToResults(apingDailymotionHelper.getObjectByJsonData(_data, helperObject));
}
});
} else {

if (angular.isDefined(request.genre)) {
requestObject.genre = request.genre;
}

if (angular.isDefined(request.country)) {
requestObject.country = request.country;
}

if (angular.isDefined(request.language)) {
requestObject.detected_language = request.language;
}

dailymotionFactory.getVideosByParams(requestObject)
.then(function (_data) {
if (_data) {
apingController.concatToResults(apingDailymotionHelper.getObjectByJsonData(_data, helperObject));
}
});
}

});
}
}
Expand Down
4 changes: 2 additions & 2 deletions dist/aping-plugin-dailymotion.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aping-plugin-dailymotion",
"version": "0.7.9",
"version": "0.7.10",
"description": "Dailymotion plugin for apiNG",
"main": "dist/aping-plugin-dailymotion.min.js",
"scripts": {
Expand Down

0 comments on commit cf1313a

Please sign in to comment.