mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-11 20:09:35 +00:00
refactor: update cover image handling to use item IDs and simplify library item actions
This commit is contained in:
parent
d25d23a0b7
commit
405d625cdc
15 changed files with 305 additions and 362 deletions
|
|
@ -26,17 +26,19 @@ import 'package:vaani/shared/extensions/model_conversions.dart';
|
|||
import 'package:vaani/shared/utils.dart';
|
||||
|
||||
class LibraryItemActions extends HookConsumerWidget {
|
||||
LibraryItemActions({
|
||||
const LibraryItemActions({
|
||||
super.key,
|
||||
required this.item,
|
||||
}) {
|
||||
book = item.media.asBookExpanded;
|
||||
}
|
||||
required this.id,
|
||||
});
|
||||
|
||||
final String id;
|
||||
|
||||
final shelfsdk.LibraryItemExpanded item;
|
||||
late final shelfsdk.BookExpanded book;
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final item = ref.watch(libraryItemProvider(id)).valueOrNull;
|
||||
if (item == null) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
final downloadHistory = ref.watch(downloadHistoryProvider(group: item.id));
|
||||
final apiSettings = ref.watch(apiSettingsProvider);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue