Fix importing older export files

This commit is contained in:
Ske 2020-03-07 17:30:22 +01:00
parent 329a337518
commit a1d91784a0

View File

@ -271,11 +271,13 @@ namespace PluralKit.Core
!Pronouns.IsLongerThan(Limits.MaxPronounsLength) && !Pronouns.IsLongerThan(Limits.MaxPronounsLength) &&
(Color == null || Regex.IsMatch(Color, "[0-9a-fA-F]{6}")) && (Color == null || Regex.IsMatch(Color, "[0-9a-fA-F]{6}")) &&
(Birthday == null || DateTimeFormats.DateExportFormat.Parse(Birthday).Success) && (Birthday == null || DateTimeFormats.DateExportFormat.Parse(Birthday).Success) &&
// Sanity checks // Sanity checks
!AvatarUrl.IsLongerThan(1000) && !AvatarUrl.IsLongerThan(1000) &&
ProxyTags.Count < 100 &&
ProxyTags.All(t => !t.ProxyString.IsLongerThan(100)) && // Older versions have Prefix and Suffix as fields, meaning ProxyTags is null
(ProxyTags == null || ProxyTags.Count < 100 &&
ProxyTags.All(t => !t.ProxyString.IsLongerThan(100))) &&
!Prefix.IsLongerThan(100) && !Suffix.IsLongerThan(100); !Prefix.IsLongerThan(100) && !Suffix.IsLongerThan(100);
} }