Change the way restrictions are applied
This commit is contained in:
@@ -283,9 +283,14 @@ exports.getWeather = function( req, res ) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var scale = calculateWeatherScale( adjustmentMethod, adjustmentOptions, weather );
|
||||||
|
|
||||||
|
if ( checkWeatherRestriction( req.params[0], weather ) ) {
|
||||||
|
scale = 0;
|
||||||
|
}
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
scale: calculateWeatherScale( adjustmentMethod, adjustmentOptions, weather ),
|
scale: scale,
|
||||||
restrict: checkWeatherRestriction( req.params[0], weather ) ? 1 : 0,
|
|
||||||
tz: getTimezone( weather.timezone ),
|
tz: getTimezone( weather.timezone ),
|
||||||
sunrise: weather.sunrise,
|
sunrise: weather.sunrise,
|
||||||
sunset: weather.sunset,
|
sunset: weather.sunset,
|
||||||
@@ -297,7 +302,6 @@ exports.getWeather = function( req, res ) {
|
|||||||
res.json( data );
|
res.json( data );
|
||||||
} else {
|
} else {
|
||||||
res.send( "&scale=" + data.scale +
|
res.send( "&scale=" + data.scale +
|
||||||
"&restrict=" + data.restrict +
|
|
||||||
"&tz=" + data.tz +
|
"&tz=" + data.tz +
|
||||||
"&sunrise=" + data.sunrise +
|
"&sunrise=" + data.sunrise +
|
||||||
"&sunset=" + data.sunset +
|
"&sunset=" + data.sunset +
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
"WSI": {
|
"WSI": {
|
||||||
"01002": {
|
"01002": {
|
||||||
"scale": 83,
|
"scale": 83,
|
||||||
"restrict": 0,
|
|
||||||
"tz": 32,
|
"tz": 32,
|
||||||
"sunrise": 324,
|
"sunrise": 324,
|
||||||
"sunset": 1226,
|
"sunset": 1226,
|
||||||
@@ -12,7 +11,6 @@
|
|||||||
"WU": {
|
"WU": {
|
||||||
"01002": {
|
"01002": {
|
||||||
"scale": 61,
|
"scale": 61,
|
||||||
"restrict": 0,
|
|
||||||
"tz": 32,
|
"tz": 32,
|
||||||
"sunrise": 324,
|
"sunrise": 324,
|
||||||
"sunset": 1228,
|
"sunset": 1228,
|
||||||
@@ -22,7 +20,6 @@
|
|||||||
"noWeather": {
|
"noWeather": {
|
||||||
"01002": {
|
"01002": {
|
||||||
"scale": -1,
|
"scale": -1,
|
||||||
"restrict": 0,
|
|
||||||
"tz": 32,
|
"tz": 32,
|
||||||
"sunrise": 324,
|
"sunrise": 324,
|
||||||
"sunset": 1226,
|
"sunset": 1226,
|
||||||
|
|||||||
Reference in New Issue
Block a user