Exemple #1
0
 public void MergeFrom(TestSuite other)
 {
     if (other == null)
     {
         return;
     }
     if (other.startedAt_ != null)
     {
         if (startedAt_ == null)
         {
             startedAt_ = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         StartedAt.MergeFrom(other.StartedAt);
     }
     if (other.completedAt_ != null)
     {
         if (completedAt_ == null)
         {
             completedAt_ = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         CompletedAt.MergeFrom(other.CompletedAt);
     }
     results_.Add(other.results_);
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Exemple #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (startedAt_ != null)
            {
                hash ^= StartedAt.GetHashCode();
            }
            if (completedAt_ != null)
            {
                hash ^= CompletedAt.GetHashCode();
            }
            hash ^= results_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemple #3
0
            public string GetFormattedProgressString(MediaType type, int?maxProgress)
            {
                var retStr = "";

                if (Status == MediaListStatus.Completed)
                {
                    retStr = CompletedAt?.IsValid() == true
                        ? $"Completed on:  {CompletedAt.GetFuzzyDateString()}"
                        : "Completed on unknown date";
                }
                else if (Status == MediaListStatus.Planning)
                {
                    retStr = $"Added to lists:  {GetFormattedDateString(CreatedAt)}";
                }
                else if (Status == MediaListStatus.Current || Status == MediaListStatus.Dropped || Status == MediaListStatus.Paused || Status == MediaListStatus.Repeating)
                {
                    var progressType = "";

                    if (type == MediaType.Anime)
                    {
                        progressType = $"episode{(Progress == 1 ? "" : "s")}";
                    }
                    else if (type == MediaType.Manga)
                    {
                        progressType = $"chapter{(Progress == 1 ? "" : "s")}";
                    }

                    retStr =
                        $"Progress:  {Progress}{(maxProgress.HasValue ? $" / {maxProgress} " : " ")}{progressType}";
                }

                if ((Repeat ?? 0) > 0)
                {
                    retStr += $"  (Repeats:  {Repeat})";
                }

                return(retStr);
            }
 /// <summary>
 /// Filter by the date the user completed the media.
 /// </summary>
 public GraphQueryArgument <FuzzyDateInt> CompletedAtQueryArgument(FuzzyDateInt value)
 {
     return(CompletedAt.GetQueryArgumentAndSetValue(value));
 }