try to normalize URIs retrieved in video array; update tests;
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
### 3.1.1 (2014-02-23)
|
||||
|
||||
- fix SendActions when sending _add_ requests (fixes #20)
|
||||
- try to normalize URIs retrieved in video array
|
||||
|
||||
### 3.1.0 (2014-02-07)
|
||||
|
||||
- Use FullTitle if no other title props are available
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace PocketSharp.Tests
|
||||
|
||||
PocketItem item = await client.Add(uri);
|
||||
|
||||
Assert.Equal<Uri>(uri, item.Uri);
|
||||
Assert.NotNull(item);
|
||||
|
||||
itemsToDelete.Add(item.ID);
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace PocketSharp.Tests
|
||||
|
||||
await client.Unfavorite(itemToModify);
|
||||
|
||||
since = DateTime.UtcNow;
|
||||
since = DateTime.UtcNow.AddMinutes(-1);
|
||||
|
||||
await client.Archive(itemToModify);
|
||||
|
||||
|
||||
@@ -55,13 +55,6 @@ namespace PocketSharp.Tests
|
||||
Assert.True(items.Count == 5000);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AreItemsRetrievedProperlyWithoutLimit()
|
||||
{
|
||||
List<PocketItem> items = await client.Get(state: State.all);
|
||||
Assert.True(items.Count > 6000);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task IsSearchSuccessfullyOnBigList()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using PropertyChanged;
|
||||
using System;
|
||||
|
||||
namespace PocketSharp.Models
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using PropertyChanged;
|
||||
using System;
|
||||
|
||||
namespace PocketSharp.Models
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using PropertyChanged;
|
||||
using System;
|
||||
|
||||
namespace PocketSharp.Models
|
||||
{
|
||||
|
||||
@@ -22,5 +22,5 @@
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("3.1.0")]
|
||||
[assembly: AssemblyFileVersion("3.1.0")]
|
||||
[assembly: AssemblyVersion("3.1.1")]
|
||||
[assembly: AssemblyFileVersion("3.1.1")]
|
||||
@@ -79,9 +79,24 @@ namespace PocketSharp
|
||||
{
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == JsonToken.String && Uri.IsWellFormedUriString(reader.Value.ToString(), UriKind.Absolute))
|
||||
if (reader.TokenType != JsonToken.String)
|
||||
{
|
||||
return new Uri(reader.Value.ToString());
|
||||
return null;
|
||||
}
|
||||
|
||||
string value = reader.Value.ToString();
|
||||
|
||||
if (Uri.IsWellFormedUriString(value, UriKind.Absolute))
|
||||
{
|
||||
return new Uri(value);
|
||||
}
|
||||
else if (value.StartsWith("//") && Uri.IsWellFormedUriString("http:" + value, UriKind.Absolute))
|
||||
{
|
||||
return new Uri("http:" + value);
|
||||
}
|
||||
else if (value.StartsWith("www.") && Uri.IsWellFormedUriString("http://" + value, UriKind.Absolute))
|
||||
{
|
||||
return new Uri("http://" + value);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user