Fix private members not named correctly

This commit is contained in:
Ming Ming 2022-06-07 13:36:23 +08:00
parent 5d8e5b25b3
commit e99711e317

View file

@ -52,11 +52,11 @@ class UpdateMissingMetadata {
try { try {
// since we need to download multiple images in their original size, // since we need to download multiple images in their original size,
// we only do it with WiFi // we only do it with WiFi
await ensureWifi(); await _ensureWifi();
await ensureBattery(); await _ensureBattery();
KiwiContainer().resolve<EventBus>().fire( KiwiContainer().resolve<EventBus>().fire(
const MetadataTaskStateChangedEvent(MetadataTaskState.prcoessing)); const MetadataTaskStateChangedEvent(MetadataTaskState.prcoessing));
if (!shouldRun) { if (!_shouldRun) {
return; return;
} }
_log.fine("[call] Updating metadata for ${file.path}"); _log.fine("[call] Updating metadata for ${file.path}");
@ -86,13 +86,13 @@ class UpdateMissingMetadata {
} }
void stop() { void stop() {
shouldRun = false; _shouldRun = false;
} }
Future<void> ensureWifi() async { Future<void> _ensureWifi() async {
var count = 0; var count = 0;
while (!await connectivity_util.isWifi()) { while (!await connectivity_util.isWifi()) {
if (!shouldRun) { if (!_shouldRun) {
throw const InterruptedException(); throw const InterruptedException();
} }
// give a chance to reconnect with the WiFi network // give a chance to reconnect with the WiFi network
@ -105,9 +105,9 @@ class UpdateMissingMetadata {
} }
} }
Future<void> ensureBattery() async { Future<void> _ensureBattery() async {
while (await Battery().batteryLevel <= 15) { while (await Battery().batteryLevel <= 15) {
if (!shouldRun) { if (!_shouldRun) {
throw const InterruptedException(); throw const InterruptedException();
} }
KiwiContainer().resolve<EventBus>().fire( KiwiContainer().resolve<EventBus>().fire(
@ -118,7 +118,7 @@ class UpdateMissingMetadata {
final FileRepo fileRepo; final FileRepo fileRepo;
bool shouldRun = true; bool _shouldRun = true;
static final _log = static final _log =
Logger("use_case.update_missing_metadata.UpdateMissingMetadata"); Logger("use_case.update_missing_metadata.UpdateMissingMetadata");