mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-25 19:27:24 +02:00
client: Don't sync within database update methods
This commit is contained in:
parent
60989b2e18
commit
608726f555
1 changed files with 0 additions and 27 deletions
|
|
@ -119,12 +119,7 @@ class MusicusClientDatabase extends _$MusicusClientDatabase {
|
|||
person,
|
||||
mode: InsertMode.insertOrReplace,
|
||||
);
|
||||
|
||||
if (person.sync && !person.synced) {
|
||||
await client.putPerson(person);
|
||||
await updatePerson(person.copyWith(synced: true));
|
||||
}
|
||||
}
|
||||
|
||||
/// Delete the person by [id].
|
||||
///
|
||||
|
|
@ -163,12 +158,7 @@ class MusicusClientDatabase extends _$MusicusClientDatabase {
|
|||
instrument,
|
||||
mode: InsertMode.insertOrReplace,
|
||||
);
|
||||
|
||||
if (instrument.sync && !instrument.synced) {
|
||||
await client.putInstrument(instrument);
|
||||
await updateInstrument(instrument.copyWith(synced: true));
|
||||
}
|
||||
}
|
||||
|
||||
/// Delete the instrument by [id].
|
||||
///
|
||||
|
|
@ -299,13 +289,7 @@ class MusicusClientDatabase extends _$MusicusClientDatabase {
|
|||
await into(workSections).insert(section);
|
||||
}
|
||||
});
|
||||
|
||||
if (workInfo.work.sync && !workInfo.work.synced) {
|
||||
await client.putWork(workInfo);
|
||||
await into(works)
|
||||
.insertOnConflictUpdate(workInfo.work.copyWith(synced: true));
|
||||
}
|
||||
}
|
||||
|
||||
/// Delete the work by [id].
|
||||
///
|
||||
|
|
@ -346,12 +330,7 @@ class MusicusClientDatabase extends _$MusicusClientDatabase {
|
|||
ensemble,
|
||||
mode: InsertMode.insertOrReplace,
|
||||
);
|
||||
|
||||
if (ensemble.sync && !ensemble.synced) {
|
||||
await client.putEnsemble(ensemble);
|
||||
await updateEnsemble(ensemble.copyWith(synced: true));
|
||||
}
|
||||
}
|
||||
|
||||
/// Delete the ensemble by [id].
|
||||
///
|
||||
|
|
@ -400,12 +379,6 @@ class MusicusClientDatabase extends _$MusicusClientDatabase {
|
|||
));
|
||||
}
|
||||
});
|
||||
|
||||
if (recordingInfo.recording.sync && !recordingInfo.recording.synced) {
|
||||
await client.putRecording(recordingInfo);
|
||||
await into(recordings).insertOnConflictUpdate(
|
||||
recordingInfo.recording.copyWith(synced: true));
|
||||
}
|
||||
}
|
||||
|
||||
/// Retreive more information on an already queried recording.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue