MCPcopy Create free account
hub / github.com/AandStep/ResultV / adBlockStatusDTO

Method adBlockStatusDTO

app.go:1100–1134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1098}
1099
1100func (a *App) adBlockStatusDTO() AdBlockStatusDTO {
1101 enabled := false
1102 if a.config != nil {
1103 enabled = a.config.GetConfig().Settings.AdBlock
1104 }
1105 connected := false
1106 engineAdBlock := false
1107 if a.proxy != nil {
1108 st := a.proxy.GetStatus()
1109 connected = st.IsConnected
1110 engineAdBlock = a.proxy.IsAdBlockActive()
1111 }
1112 if a.filters == nil {
1113 return AdBlockStatusDTO{Enabled: enabled, CAInstalled: filter.CAInstalled()}
1114 }
1115 s := a.filters.Status(enabled, connected, engineAdBlock)
1116 return AdBlockStatusDTO{
1117 Enabled: s.Enabled,
1118 FilterCount: s.FilterCount,
1119 RuleSetsReady: s.RuleSetsReady,
1120 RuleSetsTotal: s.RuleSetsTotal,
1121 LastUpdatedUnix: s.LastUpdatedUnix,
1122 LastError: s.LastError,
1123 CAInstalled: s.CAInstalled,
1124 NetworkBlocked: s.NetworkBlocked,
1125 CosmeticBlocked: s.CosmeticBlocked,
1126 UpdateInProgress: s.UpdateInProgress,
1127 UpdatePhase: s.UpdatePhase,
1128 UpdateCurrent: s.UpdateCurrent,
1129 UpdateTotal: s.UpdateTotal,
1130 UpdateItem: s.UpdateItem,
1131 NetworkBlockActive: s.NetworkBlockActive,
1132 NeedsReconnect: s.NeedsReconnect,
1133 }
1134}
1135
1136func (a *App) GetAdBlockStatus() AdBlockStatusDTO {
1137 return a.adBlockStatusDTO()

Callers 2

GetAdBlockStatusMethod · 0.95
UpdateAdBlockFiltersMethod · 0.95

Calls 5

CAInstalledFunction · 0.92
IsAdBlockActiveMethod · 0.80
StatusMethod · 0.80
GetConfigMethod · 0.45
GetStatusMethod · 0.45

Tested by

no test coverage detected