Skip to content

Commit

Permalink
Improve auto backup flow (#60)
Browse files Browse the repository at this point in the history
* Improve auto-backup-flow

* Did improvement
  • Loading branch information
cp-pratik-k authored Dec 9, 2024
1 parent ccb96dc commit 6385817
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/lib/ui/flow/home/home_screen_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ class HomeViewStateNotifier extends StateNotifier<HomeViewState>
if (media.dropboxMediaRefId != null &&
ids.contains(media.dropboxMediaRefId) &&
media.isCommonStored) {
return media.removeLocalRef();
return media.removeDropboxRef();
} else if (media.dropboxMediaRefId != null &&
ids.contains(media.dropboxMediaRefId) &&
media.isDropboxStored) {
Expand Down
18 changes: 12 additions & 6 deletions data/lib/repositories/media_process_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,13 @@ class MediaProcessRepo extends ChangeNotifier {

for (AppMedia localMedia in localMedias.toList()) {
if (_uploadQueue
.where((element) => element.media_id == localMedia.id)
.where(
(element) =>
element.media_id == localMedia.id &&
element.status.isRunning,
)
.isNotEmpty ||
dgMedias
.where((gdMedia) => gdMedia.path == localMedia.id)
.isNotEmpty) {
dgMedias.where((gdMedia) => gdMedia.id == localMedia.id).isNotEmpty) {
localMedias.removeWhere((media) => media.id == localMedia.id);
}
}
Expand Down Expand Up @@ -227,10 +229,14 @@ class MediaProcessRepo extends ChangeNotifier {

for (AppMedia localMedia in localMedias.toList()) {
if (_uploadQueue
.where((element) => element.media_id == localMedia.id)
.where(
(element) =>
element.media_id == localMedia.id &&
element.status.isRunning,
)
.isNotEmpty ||
dropboxMedias
.where((gdMedia) => gdMedia.path == localMedia.id)
.where((gdMedia) => gdMedia.id == localMedia.id)
.isNotEmpty) {
localMedias.removeWhere((media) => media.id == localMedia.id);
}
Expand Down

0 comments on commit 6385817

Please sign in to comment.