From cd5c22d86234929bc82bd17f0ed75e24ed4dbb5c Mon Sep 17 00:00:00 2001 From: whimsical-c4lic0 Date: Mon, 9 Feb 2026 00:46:19 -0600 Subject: [PATCH] Refactor Subscriptions entities into DTOs and application entities with standardized naming conventions and default values --- .../{Users => Common}/SubscribedByDataDto.cs | 20 ++- .../{Users => Common}/SubscribedOnDataDto.cs | 16 +- .../Models/Dtos/Subscriptions/ListItemDto.cs | 111 ++++++++++++ .../Dtos/Subscriptions/ListsStateDto.cs | 16 ++ .../Models/Dtos/Subscriptions/SubscribeDto.cs | 38 +++++ .../Dtos/Subscriptions/SubscriptionsDto.cs | 10 ++ .../Models/Entities/Subscriptions/ListItem.cs | 10 ++ .../Entities/Subscriptions/Subscriptions.cs | 8 + OF DL/Models/Mappers/SubscriptionsMapper.cs | 27 +++ OF DL/Models/Subscriptions/Subscriptions.cs | 159 ------------------ OF DL/Services/APIService.cs | 37 ++-- 11 files changed, 263 insertions(+), 189 deletions(-) rename OF DL/Models/Dtos/{Users => Common}/SubscribedByDataDto.cs (59%) rename OF DL/Models/Dtos/{Users => Common}/SubscribedOnDataDto.cs (77%) create mode 100644 OF DL/Models/Dtos/Subscriptions/ListItemDto.cs create mode 100644 OF DL/Models/Dtos/Subscriptions/ListsStateDto.cs create mode 100644 OF DL/Models/Dtos/Subscriptions/SubscribeDto.cs create mode 100644 OF DL/Models/Dtos/Subscriptions/SubscriptionsDto.cs create mode 100644 OF DL/Models/Entities/Subscriptions/ListItem.cs create mode 100644 OF DL/Models/Entities/Subscriptions/Subscriptions.cs create mode 100644 OF DL/Models/Mappers/SubscriptionsMapper.cs delete mode 100644 OF DL/Models/Subscriptions/Subscriptions.cs diff --git a/OF DL/Models/Dtos/Users/SubscribedByDataDto.cs b/OF DL/Models/Dtos/Common/SubscribedByDataDto.cs similarity index 59% rename from OF DL/Models/Dtos/Users/SubscribedByDataDto.cs rename to OF DL/Models/Dtos/Common/SubscribedByDataDto.cs index 1ec6f04..f1bc4d9 100644 --- a/OF DL/Models/Dtos/Users/SubscribedByDataDto.cs +++ b/OF DL/Models/Dtos/Common/SubscribedByDataDto.cs @@ -1,6 +1,7 @@ using Newtonsoft.Json; +using OF_DL.Models.Dtos.Subscriptions; -namespace OF_DL.Models.Dtos.Users; +namespace OF_DL.Models.Dtos.Common; public class SubscribedByDataDto { @@ -20,21 +21,24 @@ public class SubscribedByDataDto [JsonProperty("expiredAt")] public DateTime? ExpiredAt { get; set; } - [JsonProperty("renewedAt")] public object? RenewedAt { get; set; } + [JsonProperty("renewedAt")] public DateTime? RenewedAt { get; set; } - [JsonProperty("discountFinishedAt")] public object? DiscountFinishedAt { get; set; } + [JsonProperty("discountFinishedAt")] public object? DiscountFinishedAt { get; set; } = new(); - [JsonProperty("discountStartedAt")] public object? DiscountStartedAt { get; set; } + [JsonProperty("discountStartedAt")] public object? DiscountStartedAt { get; set; } = new(); - [JsonProperty("status")] public string? Status { get; set; } + [JsonProperty("status")] public string Status { get; set; } = ""; [JsonProperty("isMuted")] public bool? IsMuted { get; set; } - [JsonProperty("unsubscribeReason")] public string? UnsubscribeReason { get; set; } + [JsonProperty("unsubscribeReason")] public string UnsubscribeReason { get; set; } = ""; - [JsonProperty("duration")] public string? Duration { get; set; } + [JsonProperty("duration")] public string Duration { get; set; } = ""; [JsonProperty("showPostsInFeed")] public bool? ShowPostsInFeed { get; set; } - [JsonProperty("subscribes")] public List? Subscribes { get; set; } + [JsonProperty("subscribes")] public List Subscribes { get; set; } = []; + + [JsonProperty("hasActivePaidSubscriptions")] + public bool? HasActivePaidSubscriptions { get; set; } } diff --git a/OF DL/Models/Dtos/Users/SubscribedOnDataDto.cs b/OF DL/Models/Dtos/Common/SubscribedOnDataDto.cs similarity index 77% rename from OF DL/Models/Dtos/Users/SubscribedOnDataDto.cs rename to OF DL/Models/Dtos/Common/SubscribedOnDataDto.cs index d373156..b0c0cee 100644 --- a/OF DL/Models/Dtos/Users/SubscribedOnDataDto.cs +++ b/OF DL/Models/Dtos/Common/SubscribedOnDataDto.cs @@ -1,6 +1,7 @@ using Newtonsoft.Json; +using OF_DL.Models.Dtos.Subscriptions; -namespace OF_DL.Models.Dtos.Users; +namespace OF_DL.Models.Dtos.Common; public class SubscribedOnDataDto { @@ -22,17 +23,17 @@ public class SubscribedOnDataDto [JsonProperty("renewedAt")] public DateTime? RenewedAt { get; set; } - [JsonProperty("discountFinishedAt")] public object? DiscountFinishedAt { get; set; } + [JsonProperty("discountFinishedAt")] public object? DiscountFinishedAt { get; set; } = new(); - [JsonProperty("discountStartedAt")] public object? DiscountStartedAt { get; set; } + [JsonProperty("discountStartedAt")] public object? DiscountStartedAt { get; set; } = new(); [JsonProperty("status")] public object? Status { get; set; } [JsonProperty("isMuted")] public bool? IsMuted { get; set; } - [JsonProperty("unsubscribeReason")] public string? UnsubscribeReason { get; set; } + [JsonProperty("unsubscribeReason")] public string? UnsubscribeReason { get; set; } = ""; - [JsonProperty("duration")] public string? Duration { get; set; } + [JsonProperty("duration")] public string Duration { get; set; } = ""; [JsonProperty("tipsSumm")] public string? TipsSumm { get; set; } @@ -46,5 +47,8 @@ public class SubscribedOnDataDto [JsonProperty("totalSumm")] public string? TotalSumm { get; set; } - [JsonProperty("subscribes")] public List? Subscribes { get; set; } + [JsonProperty("subscribes")] public List Subscribes { get; set; } = []; + + [JsonProperty("hasActivePaidSubscriptions")] + public bool? HasActivePaidSubscriptions { get; set; } } diff --git a/OF DL/Models/Dtos/Subscriptions/ListItemDto.cs b/OF DL/Models/Dtos/Subscriptions/ListItemDto.cs new file mode 100644 index 0000000..8b60c38 --- /dev/null +++ b/OF DL/Models/Dtos/Subscriptions/ListItemDto.cs @@ -0,0 +1,111 @@ +using Newtonsoft.Json; +using OF_DL.Models.Dtos.Common; + +namespace OF_DL.Models.Dtos.Subscriptions; + +public class ListItemDto +{ + [JsonProperty("view")] public string View { get; set; } = ""; + + [JsonProperty("avatar")] public string? Avatar { get; set; } + + [JsonProperty("avatarThumbs")] public AvatarThumbsDto AvatarThumbs { get; set; } = new(); + + [JsonProperty("header")] public string? Header { get; set; } + + [JsonProperty("headerSize")] public HeaderSizeDto HeaderSize { get; set; } = new(); + + [JsonProperty("headerThumbs")] public HeaderThumbsDto HeaderThumbs { get; set; } = new(); + + [JsonProperty("id")] public long Id { get; set; } + + [JsonProperty("name")] public string Name { get; set; } = ""; + + [JsonProperty("username")] public string? Username { get; set; } + + [JsonProperty("canLookStory")] public bool? CanLookStory { get; set; } + + [JsonProperty("canCommentStory")] public bool? CanCommentStory { get; set; } + + [JsonProperty("hasNotViewedStory")] public bool? HasNotViewedStory { get; set; } + + [JsonProperty("isVerified")] public bool? IsVerified { get; set; } + + [JsonProperty("canPayInternal")] public bool? CanPayInternal { get; set; } + + [JsonProperty("hasScheduledStream")] public bool? HasScheduledStream { get; set; } + + [JsonProperty("hasStream")] public bool? HasStream { get; set; } + + [JsonProperty("hasStories")] public bool? HasStories { get; set; } + + [JsonProperty("tipsEnabled")] public bool? TipsEnabled { get; set; } + + [JsonProperty("tipsTextEnabled")] public bool? TipsTextEnabled { get; set; } + + [JsonProperty("tipsMin")] public int? TipsMin { get; set; } + + [JsonProperty("tipsMinInternal")] public int? TipsMinInternal { get; set; } + + [JsonProperty("tipsMax")] public int? TipsMax { get; set; } + + [JsonProperty("canEarn")] public bool? CanEarn { get; set; } + + [JsonProperty("canAddSubscriber")] public bool? CanAddSubscriber { get; set; } + + [JsonProperty("subscribePrice")] public string? SubscribePrice { get; set; } + + [JsonProperty("isPaywallRequired")] public bool? IsPaywallRequired { get; set; } + + [JsonProperty("unprofitable")] public bool? Unprofitable { get; set; } + + [JsonProperty("listsStates")] public List ListsStates { get; set; } = []; + + [JsonProperty("isMuted")] public bool? IsMuted { get; set; } + + [JsonProperty("isRestricted")] public bool? IsRestricted { get; set; } + + [JsonProperty("canRestrict")] public bool? CanRestrict { get; set; } + + [JsonProperty("subscribedBy")] public bool? SubscribedBy { get; set; } + + [JsonProperty("subscribedByExpire")] public bool? SubscribedByExpire { get; set; } + + [JsonProperty("subscribedByExpireDate")] public DateTime? SubscribedByExpireDate { get; set; } + + [JsonProperty("subscribedByAutoprolong")] public bool? SubscribedByAutoprolong { get; set; } + + [JsonProperty("subscribedIsExpiredNow")] public bool? SubscribedIsExpiredNow { get; set; } + + [JsonProperty("currentSubscribePrice")] public string? CurrentSubscribePrice { get; set; } + + [JsonProperty("subscribedOn")] public bool? SubscribedOn { get; set; } + + [JsonProperty("subscribedOnExpiredNow")] public bool? SubscribedOnExpiredNow { get; set; } + + [JsonProperty("subscribedOnDuration")] public string SubscribedOnDuration { get; set; } = ""; + + [JsonProperty("canReport")] public bool? CanReport { get; set; } + + [JsonProperty("canReceiveChatMessage")] public bool? CanReceiveChatMessage { get; set; } + + [JsonProperty("hideChat")] public bool? HideChat { get; set; } + + [JsonProperty("lastSeen")] public DateTime? LastSeen { get; set; } + + [JsonProperty("isPerformer")] public bool? IsPerformer { get; set; } + + [JsonProperty("isRealPerformer")] public bool? IsRealPerformer { get; set; } + + [JsonProperty("subscribedByData")] public SubscribedByDataDto SubscribedByData { get; set; } = new(); + + [JsonProperty("subscribedOnData")] public SubscribedOnDataDto SubscribedOnData { get; set; } = new(); + + [JsonProperty("canTrialSend")] public bool? CanTrialSend { get; set; } + + [JsonProperty("isBlocked")] public bool? IsBlocked { get; set; } + + [JsonProperty("displayName")] public string DisplayName { get; set; } = ""; + + [JsonProperty("notice")] public string Notice { get; set; } = ""; +} diff --git a/OF DL/Models/Dtos/Subscriptions/ListsStateDto.cs b/OF DL/Models/Dtos/Subscriptions/ListsStateDto.cs new file mode 100644 index 0000000..fc4929f --- /dev/null +++ b/OF DL/Models/Dtos/Subscriptions/ListsStateDto.cs @@ -0,0 +1,16 @@ +using Newtonsoft.Json; + +namespace OF_DL.Models.Dtos.Subscriptions; + +public class ListsStateDto +{ + [JsonProperty("id")] public object Id { get; set; } = new(); + + [JsonProperty("type")] public string Type { get; set; } = ""; + + [JsonProperty("name")] public string Name { get; set; } = ""; + + [JsonProperty("hasUser")] public bool? HasUser { get; set; } + + [JsonProperty("canAddUser")] public bool? CanAddUser { get; set; } +} diff --git a/OF DL/Models/Dtos/Subscriptions/SubscribeDto.cs b/OF DL/Models/Dtos/Subscriptions/SubscribeDto.cs new file mode 100644 index 0000000..2dfeef8 --- /dev/null +++ b/OF DL/Models/Dtos/Subscriptions/SubscribeDto.cs @@ -0,0 +1,38 @@ +using Newtonsoft.Json; + +namespace OF_DL.Models.Dtos.Subscriptions; + +public class SubscribeDto +{ + [JsonProperty("id")] public object Id { get; set; } = new(); + + [JsonProperty("userId")] public long? UserId { get; set; } + + [JsonProperty("subscriberId")] public int? SubscriberId { get; set; } + + [JsonProperty("date")] public DateTime? Date { get; set; } + + [JsonProperty("duration")] public int? Duration { get; set; } + + [JsonProperty("startDate")] public DateTime? StartDate { get; set; } + + [JsonProperty("expireDate")] public DateTime? ExpireDate { get; set; } + + [JsonProperty("cancelDate")] public object CancelDate { get; set; } = new(); + + [JsonProperty("price")] public string? Price { get; set; } + + [JsonProperty("regularPrice")] public string? RegularPrice { get; set; } + + [JsonProperty("discount")] public string? Discount { get; set; } + + [JsonProperty("action")] public string Action { get; set; } = ""; + + [JsonProperty("type")] public string Type { get; set; } = ""; + + [JsonProperty("offerStart")] public object OfferStart { get; set; } = new(); + + [JsonProperty("offerEnd")] public object OfferEnd { get; set; } = new(); + + [JsonProperty("isCurrent")] public bool? IsCurrent { get; set; } +} diff --git a/OF DL/Models/Dtos/Subscriptions/SubscriptionsDto.cs b/OF DL/Models/Dtos/Subscriptions/SubscriptionsDto.cs new file mode 100644 index 0000000..3743c8a --- /dev/null +++ b/OF DL/Models/Dtos/Subscriptions/SubscriptionsDto.cs @@ -0,0 +1,10 @@ +using Newtonsoft.Json; + +namespace OF_DL.Models.Dtos.Subscriptions; + +public class SubscriptionsDto +{ + [JsonProperty("list")] public List List { get; set; } = []; + + [JsonProperty("hasMore")] public bool HasMore { get; set; } +} diff --git a/OF DL/Models/Entities/Subscriptions/ListItem.cs b/OF DL/Models/Entities/Subscriptions/ListItem.cs new file mode 100644 index 0000000..a9fe450 --- /dev/null +++ b/OF DL/Models/Entities/Subscriptions/ListItem.cs @@ -0,0 +1,10 @@ +namespace OF_DL.Models.Entities.Subscriptions; + +public class ListItem +{ + public string Username { get; set; } = ""; + + public bool? IsRestricted { get; set; } + + public long Id { get; set; } +} diff --git a/OF DL/Models/Entities/Subscriptions/Subscriptions.cs b/OF DL/Models/Entities/Subscriptions/Subscriptions.cs new file mode 100644 index 0000000..4b8dfb2 --- /dev/null +++ b/OF DL/Models/Entities/Subscriptions/Subscriptions.cs @@ -0,0 +1,8 @@ +namespace OF_DL.Models.Entities.Subscriptions; + +public class Subscriptions +{ + public List List { get; set; } = []; + + public bool HasMore { get; set; } +} diff --git a/OF DL/Models/Mappers/SubscriptionsMapper.cs b/OF DL/Models/Mappers/SubscriptionsMapper.cs new file mode 100644 index 0000000..29859d5 --- /dev/null +++ b/OF DL/Models/Mappers/SubscriptionsMapper.cs @@ -0,0 +1,27 @@ +using OF_DL.Models.Dtos.Subscriptions; +using OF_DL.Models.Entities.Subscriptions; + +namespace OF_DL.Models.Mappers; + +public static class SubscriptionsMapper +{ + public static Subscriptions FromDto(SubscriptionsDto? dto) + { + Subscriptions mapped = new() { HasMore = dto?.HasMore ?? false }; + + if (dto?.List == null) + { + return mapped; + } + + foreach (ListItemDto entry in dto.List) + { + mapped.List.Add(MapList(entry)); + } + + return mapped; + } + + private static ListItem MapList(ListItemDto dto) => + new() { Id = dto.Id, Username = dto.Username ?? string.Empty, IsRestricted = dto.IsRestricted }; +} diff --git a/OF DL/Models/Subscriptions/Subscriptions.cs b/OF DL/Models/Subscriptions/Subscriptions.cs deleted file mode 100644 index 6903743..0000000 --- a/OF DL/Models/Subscriptions/Subscriptions.cs +++ /dev/null @@ -1,159 +0,0 @@ -namespace OF_DL.Models.Subscriptions; - -public class Subscriptions -{ - public List list { get; set; } - public bool hasMore { get; set; } - - public class AvatarThumbs - { - public string c50 { get; set; } - public string c144 { get; set; } - } - - public class HeaderSize - { - public int? width { get; set; } - public int? height { get; set; } - } - - public class HeaderThumbs - { - public string w480 { get; set; } - public string w760 { get; set; } - } - - public class List - { - public string view { get; set; } - public string avatar { get; set; } - public AvatarThumbs avatarThumbs { get; set; } - public string header { get; set; } - public HeaderSize headerSize { get; set; } - public HeaderThumbs headerThumbs { get; set; } - public long id { get; set; } - public string name { get; set; } - public string username { get; set; } - public bool? canLookStory { get; set; } - public bool? canCommentStory { get; set; } - public bool? hasNotViewedStory { get; set; } - public bool? isVerified { get; set; } - public bool? canPayInternal { get; set; } - public bool? hasScheduledStream { get; set; } - public bool? hasStream { get; set; } - public bool? hasStories { get; set; } - public bool? tipsEnabled { get; set; } - public bool? tipsTextEnabled { get; set; } - public int? tipsMin { get; set; } - public int? tipsMinInternal { get; set; } - public int? tipsMax { get; set; } - public bool? canEarn { get; set; } - public bool? canAddSubscriber { get; set; } - public string? subscribePrice { get; set; } - public bool? isPaywallRequired { get; set; } - public bool? unprofitable { get; set; } - public List listsStates { get; set; } - public bool? isMuted { get; set; } - public bool? isRestricted { get; set; } - public bool? canRestrict { get; set; } - public bool? subscribedBy { get; set; } - public bool? subscribedByExpire { get; set; } - public DateTime? subscribedByExpireDate { get; set; } - public bool? subscribedByAutoprolong { get; set; } - public bool? subscribedIsExpiredNow { get; set; } - public string? currentSubscribePrice { get; set; } - public bool? subscribedOn { get; set; } - public bool? subscribedOnExpiredNow { get; set; } - public string subscribedOnDuration { get; set; } - public bool? canReport { get; set; } - public bool? canReceiveChatMessage { get; set; } - public bool? hideChat { get; set; } - public DateTime? lastSeen { get; set; } - public bool? isPerformer { get; set; } - public bool? isRealPerformer { get; set; } - public SubscribedByData subscribedByData { get; set; } - public SubscribedOnData subscribedOnData { get; set; } - public bool? canTrialSend { get; set; } - public bool? isBlocked { get; set; } - public string displayName { get; set; } - public string notice { get; set; } - } - - public class ListsState - { - public object id { get; set; } - public string type { get; set; } - public string name { get; set; } - public bool? hasUser { get; set; } - public bool? canAddUser { get; set; } - } - - public class Subscribe - { - public object id { get; set; } - public long? userId { get; set; } - public int? subscriberId { get; set; } - public DateTime? date { get; set; } - public int? duration { get; set; } - public DateTime? startDate { get; set; } - public DateTime? expireDate { get; set; } - public object cancelDate { get; set; } - public string? price { get; set; } - public string? regularPrice { get; set; } - public string? discount { get; set; } - public string action { get; set; } - public string type { get; set; } - public object offerStart { get; set; } - public object offerEnd { get; set; } - public bool? isCurrent { get; set; } - } - - public class SubscribedByData - { - public string? price { get; set; } - public string? newPrice { get; set; } - public string? regularPrice { get; set; } - public string? subscribePrice { get; set; } - public int? discountPercent { get; set; } - public int? discountPeriod { get; set; } - public DateTime? subscribeAt { get; set; } - public DateTime? expiredAt { get; set; } - public DateTime? renewedAt { get; set; } - public object discountFinishedAt { get; set; } - public object discountStartedAt { get; set; } - public string status { get; set; } - public bool? isMuted { get; set; } - public string unsubscribeReason { get; set; } - public string duration { get; set; } - public bool? showPostsInFeed { get; set; } - public List subscribes { get; set; } - public bool? hasActivePaidSubscriptions { get; set; } - } - - public class SubscribedOnData - { - public string? price { get; set; } - public string? newPrice { get; set; } - public string? regularPrice { get; set; } - public string? subscribePrice { get; set; } - public int? discountPercent { get; set; } - public int? discountPeriod { get; set; } - public DateTime? subscribeAt { get; set; } - public DateTime? expiredAt { get; set; } - public DateTime? renewedAt { get; set; } - public object discountFinishedAt { get; set; } - public object discountStartedAt { get; set; } - public object status { get; set; } - public bool? isMuted { get; set; } - public string unsubscribeReason { get; set; } - public string duration { get; set; } - public string? tipsSumm { get; set; } - public string? subscribesSumm { get; set; } - public string? messagesSumm { get; set; } - public string? postsSumm { get; set; } - public string? streamsSumm { get; set; } - public string? totalSumm { get; set; } - public List subscribes { get; set; } - public bool? hasActivePaidSubscriptions { get; set; } - } -} diff --git a/OF DL/Services/APIService.cs b/OF DL/Services/APIService.cs index 4260832..e3b6e88 100644 --- a/OF DL/Services/APIService.cs +++ b/OF DL/Services/APIService.cs @@ -16,6 +16,7 @@ using PurchasedDtos = OF_DL.Models.Dtos.Purchased; using StoriesDtos = OF_DL.Models.Dtos.Stories; using StreamsDtos = OF_DL.Models.Dtos.Streams; using UserDtos = OF_DL.Models.Dtos.Users; +using SubscriptionsDtos = OF_DL.Models.Dtos.Subscriptions; using ArchivedEntities = OF_DL.Models.Entities.Archived; using HighlightEntities = OF_DL.Models.Entities.Highlights; using ListEntities = OF_DL.Models.Entities.Lists; @@ -24,9 +25,9 @@ using PostEntities = OF_DL.Models.Entities.Posts; using PurchasedEntities = OF_DL.Models.Entities.Purchased; using StoryEntities = OF_DL.Models.Entities.Stories; using StreamEntities = OF_DL.Models.Entities.Streams; +using SubscriptionEntities = OF_DL.Models.Entities.Subscriptions; using UserEntities = OF_DL.Models.Entities.Users; using OF_DL.Models.Mappers; -using OF_DL.Models.Subscriptions; using OF_DL.Widevine; using Serilog; using Spectre.Console; @@ -3412,49 +3413,53 @@ public class APIService(IAuthService authService, IConfigService configService, try { Dictionary users = new(); - Subscriptions subscriptions = new(); + SubscriptionEntities.Subscriptions subscriptions = new(); Log.Debug("Calling GetAllSubscrptions"); string? body = await BuildHeaderAndExecuteRequests(getParams, endpoint, new HttpClient()); - subscriptions = JsonConvert.DeserializeObject(body); - if (subscriptions != null && subscriptions.hasMore) + SubscriptionsDtos.SubscriptionsDto? subscriptionsDto = + JsonConvert.DeserializeObject(body, m_JsonSerializerSettings); + subscriptions = SubscriptionsMapper.FromDto(subscriptionsDto); + if (subscriptions.HasMore) { - getParams["offset"] = subscriptions.list.Count.ToString(); + getParams["offset"] = subscriptions.List.Count.ToString(); while (true) { - Subscriptions newSubscriptions = new(); + SubscriptionEntities.Subscriptions newSubscriptions = new(); string? loopbody = await BuildHeaderAndExecuteRequests(getParams, endpoint, new HttpClient()); if (!string.IsNullOrEmpty(loopbody) && (!loopbody.Contains("[]") || loopbody.Trim() != "[]")) { - newSubscriptions = - JsonConvert.DeserializeObject(loopbody, m_JsonSerializerSettings); + SubscriptionsDtos.SubscriptionsDto? newSubscriptionsDto = + JsonConvert.DeserializeObject(loopbody, + m_JsonSerializerSettings); + newSubscriptions = SubscriptionsMapper.FromDto(newSubscriptionsDto); } else { break; } - subscriptions.list.AddRange(newSubscriptions.list); - if (!newSubscriptions.hasMore) + subscriptions.List.AddRange(newSubscriptions.List); + if (!newSubscriptions.HasMore) { break; } - getParams["offset"] = subscriptions.list.Count.ToString(); + getParams["offset"] = subscriptions.List.Count.ToString(); } } - foreach (Subscriptions.List subscription in subscriptions.list) + foreach (SubscriptionEntities.ListItem subscription in subscriptions.List) { - if ((!(subscription.isRestricted ?? false) || - ((subscription.isRestricted ?? false) && includeRestricted)) - && !users.ContainsKey(subscription.username)) + if ((!(subscription.IsRestricted ?? false) || + ((subscription.IsRestricted ?? false) && includeRestricted)) + && !users.ContainsKey(subscription.Username)) { - users.Add(subscription.username, subscription.id); + users.Add(subscription.Username, subscription.Id); } }