complete PocketItem properties; add PocketImage, PocketVideo, PocketAuthor;

This commit is contained in:
2013-06-26 12:17:01 +02:00
parent f84c0a9c20
commit 899a2e1c4c
12 changed files with 189 additions and 24 deletions
+81
View File
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace PocketSharp.Models
@@ -21,8 +22,88 @@ namespace PocketSharp.Models
[DataMember]
public string Excerpt { get; set; }
[DataMember]
public int Status { get; set; }
[DataMember(Name = "favorite")]
public bool IsFavorite { get; set; }
[IgnoreDataMember]
public bool IsArchive { get { return Status == 1; } }
[IgnoreDataMember]
public bool IsDeleted { get { return Status == 2; } }
[DataMember(Name = "is_article")]
public bool IsArticle { get; set; }
[DataMember(Name = "has_image")]
public bool HasImage { get; set; }
[DataMember(Name = "has_video")]
public bool HasVideo { get; set; }
[DataMember(Name = "word_count")]
public int WordCount { get; set; }
[DataMember(Name = "sort_id")]
public int Sort { get; set; }
[DataMember(Name = "time_added")]
public DateTime? AddTime { get; set; }
[DataMember(Name = "time_updated")]
public DateTime? UpdateTime { get; set; }
[DataMember(Name = "time_read")]
public DateTime? ReadTime { get; set; }
[DataMember(Name = "time_favorited")]
public DateTime? FavoriteTime { get; set; }
[DataMember(Name = "tags")]
public Dictionary<string, PocketTag> _TagDictionary { get; set; }
[DataMember(Name = "images")]
public Dictionary<string, PocketImage> _ImageDictionary { get; set; }
[DataMember(Name = "videos")]
public Dictionary<string, PocketVideo> _VideoDictionary { get; set; }
[DataMember(Name = "authors")]
public Dictionary<string, PocketAuthor> _AuthorDictionary { get; set; }
[IgnoreDataMember]
public List<PocketTag> Tags
{
get { return PocketClient.DictionaryToList<PocketTag>(_TagDictionary); }
}
[IgnoreDataMember]
public List<PocketImage> Images
{
get { return PocketClient.DictionaryToList<PocketImage>(_ImageDictionary); }
}
[IgnoreDataMember]
public PocketImage LeadImage
{
get { return Images != null ? Images[0] : null; }
}
[IgnoreDataMember]
public List<PocketVideo> Videos
{
get { return PocketClient.DictionaryToList<PocketVideo>(_VideoDictionary); }
}
[IgnoreDataMember]
public List<PocketAuthor> Authors
{
get { return PocketClient.DictionaryToList<PocketAuthor>(_AuthorDictionary); }
}
}
}