mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +01:00
Remove obsolete code
This commit is contained in:
parent
0f129f839d
commit
0d2d9feac4
4 changed files with 7 additions and 50 deletions
|
@ -4,7 +4,6 @@ import 'package:event_bus/event_bus.dart';
|
|||
import 'package:kiwi/kiwi.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:nc_photos/account.dart';
|
||||
import 'package:nc_photos/entity/album.dart';
|
||||
import 'package:nc_photos/entity/file.dart';
|
||||
import 'package:nc_photos/entity/file_descriptor.dart';
|
||||
import 'package:nc_photos/entity/local_file.dart';
|
||||
|
@ -46,20 +45,6 @@ class AccountPrefUpdatedEvent {
|
|||
final dynamic value;
|
||||
}
|
||||
|
||||
class AlbumCreatedEvent {
|
||||
AlbumCreatedEvent(this.account, this.album);
|
||||
|
||||
final Account account;
|
||||
final Album album;
|
||||
}
|
||||
|
||||
class AlbumUpdatedEvent {
|
||||
AlbumUpdatedEvent(this.account, this.album);
|
||||
|
||||
final Account account;
|
||||
final Album album;
|
||||
}
|
||||
|
||||
class FilePropertyUpdatedEvent {
|
||||
FilePropertyUpdatedEvent(this.account, this.file, this.properties);
|
||||
|
||||
|
@ -97,13 +82,6 @@ class FileMovedEvent {
|
|||
final String destination;
|
||||
}
|
||||
|
||||
class ShareCreatedEvent {
|
||||
const ShareCreatedEvent(this.account, this.share);
|
||||
|
||||
final Account account;
|
||||
final Share share;
|
||||
}
|
||||
|
||||
class ShareRemovedEvent {
|
||||
const ShareRemovedEvent(this.account, this.share);
|
||||
|
||||
|
|
|
@ -1,19 +1,11 @@
|
|||
import 'package:event_bus/event_bus.dart';
|
||||
import 'package:kiwi/kiwi.dart';
|
||||
import 'package:nc_photos/account.dart';
|
||||
import 'package:nc_photos/entity/album.dart';
|
||||
import 'package:nc_photos/event/event.dart';
|
||||
|
||||
class CreateAlbum {
|
||||
CreateAlbum(this.albumRepo);
|
||||
const CreateAlbum(this.albumRepo);
|
||||
|
||||
Future<Album> call(Account account, Album album) async {
|
||||
final newAlbum = await albumRepo.create(account, album);
|
||||
KiwiContainer()
|
||||
.resolve<EventBus>()
|
||||
.fire(AlbumCreatedEvent(account, newAlbum));
|
||||
return newAlbum;
|
||||
}
|
||||
Future<Album> call(Account account, Album album) async =>
|
||||
albumRepo.create(account, album);
|
||||
|
||||
final AlbumRepo albumRepo;
|
||||
}
|
||||
|
|
|
@ -1,18 +1,12 @@
|
|||
import 'package:event_bus/event_bus.dart';
|
||||
import 'package:kiwi/kiwi.dart';
|
||||
import 'package:nc_photos/account.dart';
|
||||
import 'package:nc_photos/entity/file.dart';
|
||||
import 'package:nc_photos/entity/share.dart';
|
||||
import 'package:nc_photos/event/event.dart';
|
||||
|
||||
class CreateUserShare {
|
||||
const CreateUserShare(this.shareRepo);
|
||||
|
||||
Future<Share> call(Account account, File file, String shareWith) async {
|
||||
final share = await shareRepo.create(account, file, shareWith);
|
||||
KiwiContainer().resolve<EventBus>().fire(ShareCreatedEvent(account, share));
|
||||
return share;
|
||||
}
|
||||
Future<Share> call(Account account, File file, String shareWith) =>
|
||||
shareRepo.create(account, file, shareWith);
|
||||
|
||||
final ShareRepo shareRepo;
|
||||
}
|
||||
|
@ -24,11 +18,8 @@ class CreateLinkShare {
|
|||
Account account,
|
||||
File file, {
|
||||
String? password,
|
||||
}) async {
|
||||
final share = await shareRepo.createLink(account, file, password: password);
|
||||
KiwiContainer().resolve<EventBus>().fire(ShareCreatedEvent(account, share));
|
||||
return share;
|
||||
}
|
||||
}) =>
|
||||
shareRepo.createLink(account, file, password: password);
|
||||
|
||||
final ShareRepo shareRepo;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
import 'package:event_bus/event_bus.dart';
|
||||
import 'package:kiwi/kiwi.dart';
|
||||
import 'package:nc_photos/account.dart';
|
||||
import 'package:nc_photos/entity/album.dart';
|
||||
import 'package:nc_photos/entity/album/item.dart';
|
||||
import 'package:nc_photos/entity/album/provider.dart';
|
||||
import 'package:nc_photos/event/event.dart';
|
||||
import 'package:nc_photos/exception.dart';
|
||||
|
||||
class UpdateAlbum {
|
||||
|
@ -29,7 +26,6 @@ class UpdateAlbum {
|
|||
} else {
|
||||
await albumRepo.update(account, album);
|
||||
}
|
||||
KiwiContainer().resolve<EventBus>().fire(AlbumUpdatedEvent(account, album));
|
||||
}
|
||||
|
||||
List<AlbumItem> _minimizeItems(List<AlbumItem> items) {
|
||||
|
|
Loading…
Reference in a new issue