<commit_before>﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SyncTrayzor.Syncthing.ApiClient
{
    public class ConfigFolderDevice : IEquatable<ConfigFolderDevice>
    {
        [JsonProperty("deviceId")]
        public string DeviceId { get; set; }

        public bool Equals(ConfigFolderDevice other)
        {
            return other != null && this.DeviceId == other.DeviceId;
        }

        public override string ToString()
        {
            return $"<Device deviceId={this.DeviceId}>";
        }
    }

    public class ConfigFolder : IEquatable<ConfigFolder>
    {
        [JsonProperty("id")]
        public string ID { get; set; }

        [JsonProperty("path")]
        public string Path { get; set; }

        [JsonProperty("devices")]
        public List<ConfigFolderDevice> Devices { get; set; }

        [JsonProperty("type")]
        public bool Type { get; set; }

        [JsonProperty("rescanIntervalS")]
        public long RescanIntervalSeconds { get; set; }

        public TimeSpan RescanInterval
        {
            get { return TimeSpan.FromSeconds(this.RescanIntervalSeconds); }
            set { this.RescanIntervalSeconds = (long)value.TotalSeconds; }
        }

        [JsonProperty("invalid")]
        public string Invalid { get; set; }

        public bool Equals(ConfigFolder other)
        {
            return other != null &&
                this.ID == other.ID &&
                this.Path == other.Path &&
                this.Devices.SequenceEqual(other.Devices) &&
                this.Type == other.Type &&
                this.RescanIntervalSeconds == other.RescanIntervalSeconds &&
                this.Invalid == other.Invalid;
        }

        public override string ToString()
        {
            return $"<Folder id={this.ID} path={this.Path} devices=[{String.Join(", ", this.Devices)}] type={this.Type} rescalinterval={this.RescanInterval} invalid={this.Invalid}>";
        }
    }

    public class ConfigDevice : IEquatable<ConfigDevice>
    {
        [JsonProperty("deviceID")]<commit_msg>Don't try and deserialize folder type.<commit_after>﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SyncTrayzor.Syncthing.ApiClient
{
    public class ConfigFolderDevice : IEquatable<ConfigFolderDevice>
    {
        [JsonProperty("deviceId")]
        public string DeviceId { get; set; }

        public bool Equals(ConfigFolderDevice other)
        {
            return other != null && this.DeviceId == other.DeviceId;
        }

        public override string ToString()
        {
            return $"<Device deviceId={this.DeviceId}>";
        }
    }

    public class ConfigFolder : IEquatable<ConfigFolder>
    {
        [JsonProperty("id")]
        public string ID { get; set; }

        [JsonProperty("path")]
        public string Path { get; set; }

        [JsonProperty("devices")]
        public List<ConfigFolderDevice> Devices { get; set; }

        // This has changed type, and we don't use it anyway
        //[JsonProperty("type")]
        //public bool Type { get; set; }

        [JsonProperty("rescanIntervalS")]
        public long RescanIntervalSeconds { get; set; }

        public TimeSpan RescanInterval
        {
            get { return TimeSpan.FromSeconds(this.RescanIntervalSeconds); }
            set { this.RescanIntervalSeconds = (long)value.TotalSeconds; }
        }

        [JsonProperty("invalid")]
        public string Invalid { get; set; }

        public bool Equals(ConfigFolder other)
        {
            return other != null &&
                this.ID == other.ID &&
                this.Path == other.Path &&
                this.Devices.SequenceEqual(other.Devices) &&
                //this.Type == other.Type &&
                this.RescanIntervalSeconds == other.RescanIntervalSeconds &&
                this.Invalid == other.Invalid;
        }

        public override string ToString()
        {
            return $"<Folder id={this.ID} path={this.Path} devices=[{String.Join(", ", this.Devices)}] rescalinterval={this.RescanInterval} invalid={this.Invalid}>";
        }
    }

    public class ConfigDevice : IEquatable<ConfigDevice>
    {
        [JsonProperty("deviceID")]
{'fraction_non_alphanumeric': 0.11247966534975598, 'fraction_numerical': 0.0, 'mean_word_length': 2.1834319526627217, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2358479', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1119, 'n_words': 255}