跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

提交记录
修改Core/Servicers/Instances/Main.cs+2 −12看文件
@@ -105,10 +105,7 @@ namespace Core.Servicers.Instances
105105 {
106106 Logger.Info("[time changed] status:" + sleepStatus + ",process:" + activeProcess + ",start:" + activeStartTime.ToString() + ",end:" + DateTime.Now.ToString() + ",time:" + time.ToString());
107107
108删除: if (sleepStatus == SleepStatus.Wake)
109删除: {
110删除: UpdateTime(time);
111删除: }
108新增: UpdateTime(time);
112109 }
113110
114111 private void AppConfig_ConfigChanged(ConfigModel oldConfig, ConfigModel newConfig)
@@ -165,8 +162,6 @@ namespace Core.Servicers.Instances
165162 public void Exit()
166163 {
167164 observer?.Stop();
168删除:
169删除: //appData.SaveAppChanges();
170165 }
171166
172167
@@ -201,11 +196,6 @@ namespace Core.Servicers.Instances
201196 UpdateTime();
202197
203198 activeProcess = null;
204删除: //activeSeconds = 0;
205删除: //activeTimer.Stop();
206删除:
207删除: // 更新app数据
208删除: //appData.SaveAppChanges();
209199 }
210200 else if (sleepStatus == SleepStatus.Wake)
211201 {
@@ -362,7 +352,7 @@ namespace Core.Servicers.Instances
362352 HandleLinks(activeProcess, seconds, time);
363353 }
364354
365删除: Logger.Info("status:" + sleepStatus + ",process:" + activeProcess + ",seconds:" + seconds + ",start:" + activeStartTime.ToString() + ",end:" + DateTime.Now.ToString());
355新增: Logger.Info("status:" + sleepStatus + ",process:" + activeProcess + ",seconds:" + seconds + ",start:" + activeStartTime.ToString() + ",end:" + DateTime.Now.ToString() + ",time:" + time.ToString());
366356
367357 activeStartTime = DateTime.Now;
368358
修改Core/Servicers/Instances/Sleepdiscover.cs+11 −4看文件
@@ -77,6 +77,7 @@ namespace Core.Servicers.Instances
7777 }
7878 else
7979 {
80新增: playSoundStartTime = DateTime.MinValue;
8081 pressKeyboardLastTime = DateTime.Now;
8182 }
8283 }
@@ -99,6 +100,7 @@ namespace Core.Servicers.Instances
99100 //电脑恢复
100101 if (status == SleepStatus.Sleep)
101102 {
103新增: playSoundStartTime = DateTime.MinValue;
102104 status = SleepStatus.Wake;
103105 SleepStatusChanged?.Invoke(status);
104106 }
@@ -119,6 +121,7 @@ namespace Core.Servicers.Instances
119121 return;
120122 }
121123
124新增: playSoundStartTime = DateTime.MinValue;
122125 status = SleepStatus.Wake;
123126 SleepStatusChanged?.Invoke(status);
124127 }
@@ -183,7 +186,7 @@ namespace Core.Servicers.Instances
183186
184187 if (playSoundStartTime == DateTime.MinValue)
185188 {
186删除: playSoundStartTime = DateTime.Now;
189新增: playSoundStartTime = DateTime.Now;//没有正确更新时间导致没超过2个小时就进入睡眠状态了
187190 }
188191 else
189192 {
@@ -196,7 +199,7 @@ namespace Core.Servicers.Instances
196199 status = SleepStatus.Sleep;
197200
198201 playSoundStartTime = DateTime.MinValue;
199删除:
202新增: Logger.Info("[sleep] [1] time:" + timeSpan.TotalHours + ",start:" + playSoundStartTime);
200203 SleepStatusChanged?.Invoke(status);
201204 }
202205 }
@@ -207,10 +210,16 @@ namespace Core.Servicers.Instances
207210 {
208211 // 没有播放声音且键盘休眠超时
209212 status = SleepStatus.Sleep;
213新增: Logger.Info("[sleep] [2]");
214新增:
210215 SleepStatusChanged?.Invoke(status);
211216 }
212217 }
213218 }
219新增: else
220新增: {
221新增: playSoundStartTime = DateTime.MinValue;
222新增: }
214223 }
215224 else
216225 {
@@ -223,8 +232,6 @@ namespace Core.Servicers.Instances
223232 }
224233 }
225234
226删除: Logger.Info("【当前坐标】status:" + status + ",lastPoint:" + lastPoint.ToString() + ",now point:" + point.ToString());
227删除:
228235 lastPoint = point;
229236 }
230237