add configuration
This commit is contained in:
@@ -2,12 +2,10 @@
|
|||||||
using OnePeek.Api.Extensions;
|
using OnePeek.Api.Extensions;
|
||||||
using OnePeek.Entities;
|
using OnePeek.Entities;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Globalization;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace OnePeek.Api
|
namespace OnePeek.Api
|
||||||
@@ -40,6 +38,10 @@ namespace OnePeek.Api
|
|||||||
// create rating
|
// create rating
|
||||||
result.Rating = Deserialize.Xml<AppRating>(xml);
|
result.Rating = Deserialize.Xml<AppRating>(xml);
|
||||||
result.Rating.AverageRating = xel.GetFloat("averageUserRating");
|
result.Rating.AverageRating = xel.GetFloat("averageUserRating");
|
||||||
|
if (Configuration.UseFiveStarSystem)
|
||||||
|
{
|
||||||
|
result.Rating.AverageRating = (float)(result.Rating.AverageRating * 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
// create images
|
// create images
|
||||||
result.Images = Deserialize.Xml<AppMetadataImages>(xml);
|
result.Images = Deserialize.Xml<AppMetadataImages>(xml);
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace OnePeek.Api
|
||||||
|
{
|
||||||
|
public static class Configuration
|
||||||
|
{
|
||||||
|
public static bool UseFiveStarSystem = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user