()
| 115 | } |
| 116 | |
| 117 | func (s *folderDB) ListDevicesForFolder() ([]protocol.DeviceID, error) { |
| 118 | var res []string |
| 119 | err := s.stmt(` |
| 120 | SELECT DISTINCT d.device_id FROM counts s |
| 121 | INNER JOIN devices d ON d.idx = s.device_idx |
| 122 | WHERE s.count > 0 AND s.device_idx != {{.LocalDeviceIdx}} |
| 123 | ORDER BY d.device_id |
| 124 | `).Select(&res) |
| 125 | if err != nil { |
| 126 | return nil, wrap(err) |
| 127 | } |
| 128 | |
| 129 | devs := make([]protocol.DeviceID, len(res)) |
| 130 | for i, s := range res { |
| 131 | devs[i], err = protocol.DeviceIDFromString(s) |
| 132 | if err != nil { |
| 133 | return nil, wrap(err) |
| 134 | } |
| 135 | } |
| 136 | return devs, nil |
| 137 | } |
| 138 | |
| 139 | func (s *folderDB) DebugCounts(out io.Writer) error { |
| 140 | type deviceCountsRow struct { |
nothing calls this directly
no test coverage detected