mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Avoid serializing default properties in databases
Less data to read/write is always better.
This commit is contained in:
@@ -340,5 +340,15 @@ namespace ArchiSteamFarm {
|
||||
FileSemaphore.Release();
|
||||
}
|
||||
}
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
public bool ShouldSerializeBlacklistedFromTradesSteamIDs() => BlacklistedFromTradesSteamIDs.Count > 0;
|
||||
public bool ShouldSerializeGamesToRedeemInBackground() => HasGamesToRedeemInBackground;
|
||||
public bool ShouldSerializeIdlingBlacklistedAppIDs() => IdlingBlacklistedAppIDs.Count > 0;
|
||||
public bool ShouldSerializeIdlingPriorityAppIDs() => IdlingPriorityAppIDs.Count > 0;
|
||||
public bool ShouldSerializeLoginKey() => !string.IsNullOrEmpty(LoginKey);
|
||||
public bool ShouldSerializeMobileAuthenticator() => MobileAuthenticator != null;
|
||||
|
||||
// ReSharper restore UnusedMember.Global
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,5 +182,12 @@ namespace ArchiSteamFarm {
|
||||
FileSemaphore.Release();
|
||||
}
|
||||
}
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
public bool ShouldSerializeCellID() => CellID != 0;
|
||||
public bool ShouldSerializePackagesData() => PackagesData.Count > 0;
|
||||
public bool ShouldSerializeServerListProvider() => ServerListProvider.ShouldSerializeServerRecords();
|
||||
|
||||
// ReSharper restore UnusedMember.Global
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,8 @@ namespace ArchiSteamFarm.SteamKit2 {
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public bool ShouldSerializeServerRecords() => ServerRecords.Count > 0;
|
||||
|
||||
internal event EventHandler ServerListUpdated;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user