From 291db7321f7a73e9e8388f199ec2900a25e129fc Mon Sep 17 00:00:00 2001 From: Jagandeep Brar Date: Sun, 16 Aug 2020 14:01:11 -0500 Subject: [PATCH] [Release] v3.3.0+330001 (#235) NEW - [Home/Calendar] New "schedule" view to view all days as one list - [Home/Modules] Option to use module "brand" colours or the LunaSea list colours - [Search] Option to hide adult categories - [-arr/Catalogue] Ability to sort by date added - [-arr/Search] Show the indexer/tracker on the collapsed tile TWEAKS - [Development] Updated Flutter packages FIXES - Multiple smaller crash/error fixes Thanks to @lightglitch on GitHub for implementing the schedule calendar mode! --- CONTRIBUTERS.md | 6 ++ lib/core/database/adapters/indexer.g.dart | 18 ++++-- lib/core/database/adapters/profile.g.dart | 18 ++++-- lib/core/extensions/string/links.g.dart | 12 +++- lib/core/ui/description_block.dart | 1 - .../adapters/calendar_starting_day.g.dart | 12 +++- .../core/adapters/calendar_starting_size.dart | 5 ++ .../adapters/calendar_starting_size.g.dart | 17 +++++- lib/modules/home/core/database.dart | 3 + lib/modules/home/core/state_global.dart | 8 +++ lib/modules/home/routes/home.dart | 17 +++++- lib/modules/home/routes/quick_access.dart | 3 + lib/modules/home/widgets/calendar.dart | 56 +++++++++++++++---- lib/modules/home/widgets/summary_tile.dart | 32 +++++++---- lib/modules/lidarr/core/api/api.dart | 2 + .../lidarr/core/api/data/catalogue.dart | 13 +++++ .../lidarr/core/api/data/metadata.g.dart | 18 ++++-- .../core/api/data/qualityprofile.g.dart | 18 ++++-- .../lidarr/core/api/data/rootfolder.g.dart | 18 ++++-- lib/modules/lidarr/core/constants.dart | 2 + .../lidarr/core/sorting/catalogue.dart | 16 ++++++ .../lidarr/widgets/search_result_tile.dart | 3 +- lib/modules/nzbget/core/constants.dart | 2 + lib/modules/radarr/core/api/api.dart | 2 + .../radarr/core/api/data/availability.g.dart | 18 ++++-- .../radarr/core/api/data/catalogue.dart | 12 ++++ .../core/api/data/qualityprofile.g.dart | 18 ++++-- .../radarr/core/api/data/rootfolder.g.dart | 18 ++++-- lib/modules/radarr/core/constants.dart | 2 + .../radarr/core/sorting/catalogue.dart | 16 ++++++ .../radarr/widgets/details_search_tile.dart | 3 +- lib/modules/sabnzbd/core/constants.dart | 2 + lib/modules/search/core/constants.dart | 2 + lib/modules/search/core/database.dart | 5 ++ lib/modules/search/routes/categories.dart | 4 +- lib/modules/settings/core/constants.dart | 2 + lib/modules/settings/core/dialogs.dart | 1 + .../settings/routes/modules/general_home.dart | 21 +++++-- .../routes/modules/general_search.dart | 20 +++++++ lib/modules/settings/widgets/modules.dart | 2 +- .../modules/{calendar.dart => home.dart} | 1 + .../widgets/modules/home/enable_lidarr.dart | 7 +-- .../widgets/modules/home/enable_radarr.dart | 7 +-- .../widgets/modules/home/enable_sonarr.dart | 7 +-- .../modules/home/module_brand_colours.dart | 18 ++++++ .../widgets/modules/home/start_date_tile.dart | 2 +- .../widgets/modules/home/start_size_tile.dart | 2 +- lib/modules/sonarr/core/api/api.dart | 2 + .../sonarr/core/api/data/catalogue.dart | 20 +++++-- .../core/api/data/monitor_status.g.dart | 12 +++- .../core/api/data/qualityprofile.g.dart | 18 ++++-- .../sonarr/core/api/data/rootfolder.g.dart | 18 ++++-- .../sonarr/core/api/data/seriestype.g.dart | 18 ++++-- lib/modules/sonarr/core/constants.dart | 2 + .../sonarr/core/sorting/catalogue.dart | 16 ++++++ .../sonarr/widgets/search_result_tile.dart | 3 +- pubspec.lock | 27 +++++---- pubspec.yaml | 27 ++++++--- scripts/generate_adapters | 4 -- scripts/generate_icons | 4 -- scripts/generate_splash | 4 -- 61 files changed, 528 insertions(+), 139 deletions(-) create mode 100644 CONTRIBUTERS.md rename lib/modules/settings/widgets/modules/{calendar.dart => home.dart} (83%) create mode 100644 lib/modules/settings/widgets/modules/home/module_brand_colours.dart delete mode 100755 scripts/generate_adapters delete mode 100755 scripts/generate_icons delete mode 100755 scripts/generate_splash diff --git a/CONTRIBUTERS.md b/CONTRIBUTERS.md new file mode 100644 index 00000000..1de14cd4 --- /dev/null +++ b/CONTRIBUTERS.md @@ -0,0 +1,6 @@ +# LunaSea Additional Contributers + +> Thank you to everyone who has or will contribute to LunaSea! + +1. [@lightglitch/Mário Franco](https://github.com/lightglitch) + - Added new calendar mode "schedule" ([#233](https://github.com/CometTools/LunaSea/pull/233)) diff --git a/lib/core/database/adapters/indexer.g.dart b/lib/core/database/adapters/indexer.g.dart index 812b747c..05fea58f 100644 --- a/lib/core/database/adapters/indexer.g.dart +++ b/lib/core/database/adapters/indexer.g.dart @@ -8,13 +8,13 @@ part of 'indexer.dart'; class IndexerHiveObjectAdapter extends TypeAdapter { @override - final typeId = 1; + final int typeId = 1; @override IndexerHiveObject read(BinaryReader reader) { - var numOfFields = reader.readByte(); - var fields = { - for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return IndexerHiveObject( displayName: fields[0] as String, @@ -34,4 +34,14 @@ class IndexerHiveObjectAdapter extends TypeAdapter { ..writeByte(2) ..write(obj.key); } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is IndexerHiveObjectAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/core/database/adapters/profile.g.dart b/lib/core/database/adapters/profile.g.dart index 234d019d..f62dfd97 100644 --- a/lib/core/database/adapters/profile.g.dart +++ b/lib/core/database/adapters/profile.g.dart @@ -8,13 +8,13 @@ part of 'profile.dart'; class ProfileHiveObjectAdapter extends TypeAdapter { @override - final typeId = 0; + final int typeId = 0; @override ProfileHiveObject read(BinaryReader reader) { - var numOfFields = reader.readByte(); - var fields = { - for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return ProfileHiveObject( lidarrEnabled: fields[0] as bool, @@ -118,4 +118,14 @@ class ProfileHiveObjectAdapter extends TypeAdapter { ..writeByte(25) ..write(obj.wakeOnLANMACAddress); } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ProfileHiveObjectAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/core/extensions/string/links.g.dart b/lib/core/extensions/string/links.g.dart index 9d115074..abcb0e08 100644 --- a/lib/core/extensions/string/links.g.dart +++ b/lib/core/extensions/string/links.g.dart @@ -8,7 +8,7 @@ part of 'links.dart'; class LSBrowsersAdapter extends TypeAdapter { @override - final typeId = 11; + final int typeId = 11; @override LSBrowsers read(BinaryReader reader) { @@ -48,4 +48,14 @@ class LSBrowsersAdapter extends TypeAdapter { break; } } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LSBrowsersAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/core/ui/description_block.dart b/lib/core/ui/description_block.dart index 5c3f083e..4084a361 100644 --- a/lib/core/ui/description_block.dart +++ b/lib/core/ui/description_block.dart @@ -26,7 +26,6 @@ class LSDescriptionBlock extends StatefulWidget { class _State extends State { @override Widget build(BuildContext context) { - print(widget.uri); return LSCard( child: InkWell( child: Row( diff --git a/lib/modules/home/core/adapters/calendar_starting_day.g.dart b/lib/modules/home/core/adapters/calendar_starting_day.g.dart index 1d5e3bdc..5c85540c 100644 --- a/lib/modules/home/core/adapters/calendar_starting_day.g.dart +++ b/lib/modules/home/core/adapters/calendar_starting_day.g.dart @@ -8,7 +8,7 @@ part of 'calendar_starting_day.dart'; class CalendarStartingDayAdapter extends TypeAdapter { @override - final typeId = 12; + final int typeId = 12; @override CalendarStartingDay read(BinaryReader reader) { @@ -58,4 +58,14 @@ class CalendarStartingDayAdapter extends TypeAdapter { break; } } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is CalendarStartingDayAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/modules/home/core/adapters/calendar_starting_size.dart b/lib/modules/home/core/adapters/calendar_starting_size.dart index cc2ce3bb..5e09cbdc 100644 --- a/lib/modules/home/core/adapters/calendar_starting_size.dart +++ b/lib/modules/home/core/adapters/calendar_starting_size.dart @@ -12,6 +12,8 @@ enum CalendarStartingSize { TWO_WEEKS, @HiveField(2) ONE_MONTH, + @HiveField(3) + SCHEDULE, } extension CalendarStartingSizeExtension on CalendarStartingSize { @@ -20,6 +22,7 @@ extension CalendarStartingSizeExtension on CalendarStartingSize { case CalendarStartingSize.TWO_WEEKS: return CalendarFormat.twoWeeks; case CalendarStartingSize.ONE_MONTH: return CalendarFormat.month; case CalendarStartingSize.ONE_WEEK: + case CalendarStartingSize.SCHEDULE: default: return CalendarFormat.week; } } @@ -28,6 +31,7 @@ extension CalendarStartingSizeExtension on CalendarStartingSize { switch(this) { case CalendarStartingSize.TWO_WEEKS: return 'Two Weeks'; case CalendarStartingSize.ONE_MONTH: return 'One Month'; + case CalendarStartingSize.SCHEDULE: return 'Schedule'; case CalendarStartingSize.ONE_WEEK: default: return 'One Week'; } @@ -37,6 +41,7 @@ extension CalendarStartingSizeExtension on CalendarStartingSize { switch(this) { case CalendarStartingSize.TWO_WEEKS: return Icons.photo_size_select_large; case CalendarStartingSize.ONE_MONTH: return Icons.photo_size_select_actual; + case CalendarStartingSize.SCHEDULE: return Icons.calendar_view_day; case CalendarStartingSize.ONE_WEEK: default: return Icons.photo_size_select_small; } diff --git a/lib/modules/home/core/adapters/calendar_starting_size.g.dart b/lib/modules/home/core/adapters/calendar_starting_size.g.dart index eade443b..d3db066e 100644 --- a/lib/modules/home/core/adapters/calendar_starting_size.g.dart +++ b/lib/modules/home/core/adapters/calendar_starting_size.g.dart @@ -8,7 +8,7 @@ part of 'calendar_starting_size.dart'; class CalendarStartingSizeAdapter extends TypeAdapter { @override - final typeId = 13; + final int typeId = 13; @override CalendarStartingSize read(BinaryReader reader) { @@ -19,6 +19,8 @@ class CalendarStartingSizeAdapter extends TypeAdapter { return CalendarStartingSize.TWO_WEEKS; case 2: return CalendarStartingSize.ONE_MONTH; + case 3: + return CalendarStartingSize.SCHEDULE; default: return null; } @@ -36,6 +38,19 @@ class CalendarStartingSizeAdapter extends TypeAdapter { case CalendarStartingSize.ONE_MONTH: writer.writeByte(2); break; + case CalendarStartingSize.SCHEDULE: + writer.writeByte(3); + break; } } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is CalendarStartingSizeAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/modules/home/core/database.dart b/lib/modules/home/core/database.dart index 9d55160b..161fa7dd 100644 --- a/lib/modules/home/core/database.dart +++ b/lib/modules/home/core/database.dart @@ -18,6 +18,7 @@ enum HomeDatabaseValue { CALENDAR_ENABLE_LIDARR, CALENDAR_ENABLE_RADARR, CALENDAR_ENABLE_SONARR, + MODULES_BRAND_COLOURS, } extension HomeDatabaseValueExtension on HomeDatabaseValue { @@ -29,6 +30,7 @@ extension HomeDatabaseValueExtension on HomeDatabaseValue { case HomeDatabaseValue.CALENDAR_ENABLE_LIDARR: return 'HOME_CALENDAR_ENABLE_LIDARR'; case HomeDatabaseValue.CALENDAR_ENABLE_RADARR: return 'HOME_CALENDAR_ENABLE_RADARR'; case HomeDatabaseValue.CALENDAR_ENABLE_SONARR: return 'HOME_CALENDAR_ENABLE_SONARR'; + case HomeDatabaseValue.MODULES_BRAND_COLOURS: return 'HOME_MODULES_BRAND_COLOURS'; } throw Exception('key not found'); } @@ -42,6 +44,7 @@ extension HomeDatabaseValueExtension on HomeDatabaseValue { case HomeDatabaseValue.CALENDAR_ENABLE_LIDARR: return _box.get(this.key, defaultValue: true); case HomeDatabaseValue.CALENDAR_ENABLE_RADARR: return _box.get(this.key, defaultValue: true); case HomeDatabaseValue.CALENDAR_ENABLE_SONARR: return _box.get(this.key, defaultValue: true); + case HomeDatabaseValue.MODULES_BRAND_COLOURS: return _box.get(this.key, defaultValue: false); } throw Exception('data not found'); } diff --git a/lib/modules/home/core/state_global.dart b/lib/modules/home/core/state_global.dart index b156c050..fc3ad155 100644 --- a/lib/modules/home/core/state_global.dart +++ b/lib/modules/home/core/state_global.dart @@ -8,4 +8,12 @@ class HomeModel extends ChangeNotifier { _navigationIndex = navigationIndex; notifyListeners(); } + + bool _showCalendarSchedule = false; + bool get showCalendarSchedule => _showCalendarSchedule; + set showCalendarSchedule(bool showCalendarSchedule) { + assert(showCalendarSchedule != null); + _showCalendarSchedule = showCalendarSchedule; + notifyListeners(); + } } \ No newline at end of file diff --git a/lib/modules/home/routes/home.dart b/lib/modules/home/routes/home.dart index 9b2d30c7..0d3c04c2 100644 --- a/lib/modules/home/routes/home.dart +++ b/lib/modules/home/routes/home.dart @@ -14,7 +14,7 @@ class _State extends State { final _pageController = PageController(initialPage: HomeDatabaseValue.NAVIGATION_INDEX.data); final List _refreshKeys = [GlobalKey()]; String _profileState = Database.currentProfileObject.toString(); - + @override void initState() { super.initState(); @@ -55,7 +55,20 @@ class _State extends State { Widget get _drawer => LSDrawer(page: 'home'); - Widget get _appBar => LSAppBar(title: Constants.APPLICATION_NAME); + Widget get _appBar => LSAppBar( + title: Constants.APPLICATION_NAME, + actions: [ + Consumer( + builder: (context, home, child) => Visibility( + visible: home.navigationIndex == 1, + child: LSIconButton( + icon: !home.showCalendarSchedule ? Icons.calendar_view_day : CustomIcons.calendar, + onPressed: () async => Provider.of(context, listen: false).showCalendarSchedule ^= true, + ), + ), + ), + ], + ); Widget get _bottomNavigationBar => HomeNavigationBar(pageController: _pageController); diff --git a/lib/modules/home/routes/quick_access.dart b/lib/modules/home/routes/quick_access.dart index dfb6a2c6..dbafb1a0 100644 --- a/lib/modules/home/routes/quick_access.dart +++ b/lib/modules/home/routes/quick_access.dart @@ -35,6 +35,7 @@ class _State extends State with AutomaticKeepAliveClientMixin { icon: Constants.MODULE_MAP['search']['icon'], index: index, route: Constants.MODULE_MAP['search']['route'], + color: Constants.MODULE_MAP['search']['color'], ); if(index == _serviceCount-1) return HomeSummaryTile( title: Constants.MODULE_MAP['settings']['name'], @@ -42,6 +43,7 @@ class _State extends State with AutomaticKeepAliveClientMixin { icon: Constants.MODULE_MAP['settings']['icon'], index: index, route: Constants.MODULE_MAP['settings']['route'], + color: Constants.MODULE_MAP['settings']['color'], justPush: true, ); Map data = Constants.MODULE_MAP[widget.profile.enabledModules[_hasIndexers ? index-1 : index]]; @@ -51,6 +53,7 @@ class _State extends State with AutomaticKeepAliveClientMixin { icon: data['icon'], index: index, route: data['route'], + color: data['color'], ); return Container(); }, diff --git a/lib/modules/home/widgets/calendar.dart b/lib/modules/home/widgets/calendar.dart index ca004c16..bf5dbdd2 100644 --- a/lib/modules/home/widgets/calendar.dart +++ b/lib/modules/home/widgets/calendar.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:intl/intl.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/home.dart'; import 'package:table_calendar/table_calendar.dart'; @@ -37,7 +39,7 @@ class _State extends State with TickerProviderStateMixin { List _selectedEvents; AnimationController _animationController; CalendarController _calendarController; - + @override void initState() { super.initState(); @@ -45,6 +47,9 @@ class _State extends State with TickerProviderStateMixin { _calendarController = CalendarController(); _animationController = AnimationController( vsync: this, duration: kThemeAnimationDuration); _animationController?.forward(); + SchedulerBinding.instance.scheduleFrameCallback((_) =>{ + Provider.of(context, listen: false).showCalendarSchedule = (HomeDatabaseValue.CALENDAR_STARTING_SIZE.data as CalendarStartingSize) == CalendarStartingSize.SCHEDULE + }); } @override @@ -63,16 +68,18 @@ class _State extends State with TickerProviderStateMixin { @override Widget build(BuildContext context) { return Scaffold( - body: Padding( - child: Column( - children: [ - _calendar, - LSDivider(), - _list, - ], - ), - padding: EdgeInsets.only(top: 8.0), - ), + body: Provider.of(context).showCalendarSchedule + ? Padding( + child: Column( + children: [ + _calendar, + LSDivider(), + _list, + ], + ), + padding: EdgeInsets.only(top: 8.0), + ) + : _schedule ); } @@ -136,6 +143,33 @@ class _State extends State with TickerProviderStateMixin { ), ); + Widget get _schedule => LSListView( + children: widget.events.length == 0 + ? [LSGenericMessage(text: 'No New Content')] + : _days.expand((element) => element).toList(), + ); + + List> get _days { + List> days = []; + List keys = widget.events.keys.toList(); + keys.sort(); + for(var key in keys) { + if(key.isAfter(widget.today.subtract(Duration(days: 1))) && widget.events[key].length > 0) days.add(_day(key)); + } + return days; + } + + List _day(DateTime day) { + List listCards = []; + for(int i=0; i LSCardTile( - title: LSTitle(text: title), - subtitle: LSSubtitle(text: subtitle), - leading: LSIconButton( - icon: icon, - color: LSColors.list(index), + Widget build(BuildContext context) => ValueListenableBuilder( + valueListenable: Database.lunaSeaBox.listenable(keys: [HomeDatabaseValue.MODULES_BRAND_COLOURS.key]), + builder: (context, box, _) => LSCardTile( + title: LSTitle(text: title), + subtitle: LSSubtitle(text: subtitle), + leading: LSIconButton( + icon: icon, + color: HomeDatabaseValue.MODULES_BRAND_COLOURS.data + ? color + : LSColors.list(index), + ), + trailing: LSIconButton( + icon: Icons.arrow_forward_ios, + ), + onTap: () async => justPush + ? Navigator.of(context).pushNamed(route) + : Navigator.of(context).pushNamedAndRemoveUntil(route, (Route route) => false), ), - trailing: LSIconButton( - icon: Icons.arrow_forward_ios, - ), - onTap: () async => justPush - ? Navigator.of(context).pushNamed(route) - : Navigator.of(context).pushNamedAndRemoveUntil(route, (Route route) => false), ); } \ No newline at end of file diff --git a/lib/modules/lidarr/core/api/api.dart b/lib/modules/lidarr/core/api/api.dart index 47f542dc..c802021c 100644 --- a/lib/modules/lidarr/core/api/api.dart +++ b/lib/modules/lidarr/core/api/api.dart @@ -92,6 +92,7 @@ class LidarrAPI extends API { albumFolders: entry['albumFolder'] ?? false, foreignArtistID: entry['foreignArtistId'] ?? '', sizeOnDisk: entry['statistics'] != null ? entry['statistics']['sizeOnDisk'] ?? 0 : 0, + added: entry['added'] ?? '', )); } return entries; @@ -152,6 +153,7 @@ class LidarrAPI extends API { artistType: response.data['artistType'] ?? 'Unknown Artist Type', path: response.data['path'] ?? 'Unknown Path', artistID: response.data['id'] ?? 0, + added: response.data['added'] ?? '', monitored: response.data['monitored'] ?? false, statistics: response.data['statistics'] ?? {}, qualityProfile: response.data['qualityProfileId'] ?? 0, diff --git a/lib/modules/lidarr/core/api/data/catalogue.dart b/lib/modules/lidarr/core/api/data/catalogue.dart index 8e072319..d859ef66 100644 --- a/lib/modules/lidarr/core/api/data/catalogue.dart +++ b/lib/modules/lidarr/core/api/data/catalogue.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/lidarr.dart'; @@ -9,6 +10,7 @@ class LidarrCatalogueData { String overview; String path; String artistType; + String added; int artistID; int qualityProfile; int metadataProfile; @@ -40,6 +42,7 @@ class LidarrCatalogueData { @required this.foreignArtistID, @required this.sizeOnDisk, @required this.artistType, + @required this.added, }); String get genre { @@ -49,6 +52,15 @@ class LidarrCatalogueData { return genres[0]; } + DateTime get dateAddedObject => DateTime.tryParse(added)?.toLocal(); + + String get dateAdded { + if(added != null) { + return DateFormat('MMMM dd, y').format(dateAddedObject); + } + return 'Unknown'; + } + String subtitle(LidarrCatalogueSorting sorting) => '$albums\t•\t$tracks\n${_sortSubtitle(sorting)}'; String _sortSubtitle(LidarrCatalogueSorting sorting) { @@ -57,6 +69,7 @@ class LidarrCatalogueData { case LidarrCatalogueSorting.quality: return quality; case LidarrCatalogueSorting.tracks: return trackStats; case LidarrCatalogueSorting.type: return artistType; + case LidarrCatalogueSorting.dateAdded: return dateAdded; case LidarrCatalogueSorting.size: case LidarrCatalogueSorting.alphabetical: return sizeOnDisk?.lsBytes_BytesToString(); } diff --git a/lib/modules/lidarr/core/api/data/metadata.g.dart b/lib/modules/lidarr/core/api/data/metadata.g.dart index ccf870d9..0206a114 100644 --- a/lib/modules/lidarr/core/api/data/metadata.g.dart +++ b/lib/modules/lidarr/core/api/data/metadata.g.dart @@ -8,13 +8,13 @@ part of 'metadata.dart'; class LidarrMetadataProfileAdapter extends TypeAdapter { @override - final typeId = 10; + final int typeId = 10; @override LidarrMetadataProfile read(BinaryReader reader) { - var numOfFields = reader.readByte(); - var fields = { - for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return LidarrMetadataProfile( id: fields[0] as int, @@ -31,4 +31,14 @@ class LidarrMetadataProfileAdapter extends TypeAdapter { ..writeByte(1) ..write(obj.name); } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LidarrMetadataProfileAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/modules/lidarr/core/api/data/qualityprofile.g.dart b/lib/modules/lidarr/core/api/data/qualityprofile.g.dart index 4856b7e1..685747c4 100644 --- a/lib/modules/lidarr/core/api/data/qualityprofile.g.dart +++ b/lib/modules/lidarr/core/api/data/qualityprofile.g.dart @@ -8,13 +8,13 @@ part of 'qualityprofile.dart'; class LidarrQualityProfileAdapter extends TypeAdapter { @override - final typeId = 9; + final int typeId = 9; @override LidarrQualityProfile read(BinaryReader reader) { - var numOfFields = reader.readByte(); - var fields = { - for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return LidarrQualityProfile( id: fields[0] as int, @@ -31,4 +31,14 @@ class LidarrQualityProfileAdapter extends TypeAdapter { ..writeByte(1) ..write(obj.name); } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LidarrQualityProfileAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/modules/lidarr/core/api/data/rootfolder.g.dart b/lib/modules/lidarr/core/api/data/rootfolder.g.dart index 04d2d8b9..eb892c51 100644 --- a/lib/modules/lidarr/core/api/data/rootfolder.g.dart +++ b/lib/modules/lidarr/core/api/data/rootfolder.g.dart @@ -8,13 +8,13 @@ part of 'rootfolder.dart'; class LidarrRootFolderAdapter extends TypeAdapter { @override - final typeId = 8; + final int typeId = 8; @override LidarrRootFolder read(BinaryReader reader) { - var numOfFields = reader.readByte(); - var fields = { - for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return LidarrRootFolder( id: fields[0] as int, @@ -34,4 +34,14 @@ class LidarrRootFolderAdapter extends TypeAdapter { ..writeByte(2) ..write(obj.freeSpace); } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LidarrRootFolderAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/modules/lidarr/core/constants.dart b/lib/modules/lidarr/core/constants.dart index 898837f8..ea1e8362 100644 --- a/lib/modules/lidarr/core/constants.dart +++ b/lib/modules/lidarr/core/constants.dart @@ -1,3 +1,4 @@ +import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; class LidarrConstants { @@ -10,6 +11,7 @@ class LidarrConstants { 'desc': 'Manage Music', 'icon': CustomIcons.music, 'route': '/lidarr', + 'color': Color(0xFF159552), }; static const Map EVENT_TYPE_MESSAGES = { diff --git a/lib/modules/lidarr/core/sorting/catalogue.dart b/lib/modules/lidarr/core/sorting/catalogue.dart index 8a381076..a1013762 100644 --- a/lib/modules/lidarr/core/sorting/catalogue.dart +++ b/lib/modules/lidarr/core/sorting/catalogue.dart @@ -3,6 +3,7 @@ import 'package:lunasea/modules/lidarr.dart'; enum LidarrCatalogueSorting { alphabetical, + dateAdded, metadata, quality, size, @@ -16,6 +17,7 @@ extension LidarrCatalogueSortingExtension on LidarrCatalogueSorting { String get value { switch(this) { case LidarrCatalogueSorting.alphabetical: return 'abc'; + case LidarrCatalogueSorting.dateAdded: return 'date_added'; case LidarrCatalogueSorting.size: return 'size'; case LidarrCatalogueSorting.metadata: return 'metadata'; case LidarrCatalogueSorting.quality: return 'quality'; @@ -28,6 +30,7 @@ extension LidarrCatalogueSortingExtension on LidarrCatalogueSorting { String get readable { switch(this) { case LidarrCatalogueSorting.alphabetical: return 'Alphabetical'; + case LidarrCatalogueSorting.dateAdded: return 'Date Added'; case LidarrCatalogueSorting.size: return 'Size'; case LidarrCatalogueSorting.metadata: return 'Metadata Profile'; case LidarrCatalogueSorting.quality: return 'Quality Profile'; @@ -52,6 +55,7 @@ class _Sorter extends Sorter { ) { switch(type) { case LidarrCatalogueSorting.alphabetical: return _alphabetical(data, ascending); + case LidarrCatalogueSorting.dateAdded: return _dateAdded(data, ascending); case LidarrCatalogueSorting.size: return _size(data, ascending); case LidarrCatalogueSorting.metadata: return _metadata(data, ascending); case LidarrCatalogueSorting.quality: return _quality(data, ascending); @@ -69,6 +73,18 @@ class _Sorter extends Sorter { return _data; } + List _dateAdded(List data, bool ascending) { + List _data = _alphabetical(data, true); + List _hasNoDate = _data.where((item) => item.dateAddedObject == null).toList(); + List _hasDate = _data.where((item) => item.dateAddedObject != null).toList(); + _hasDate.sort((a,b) { + return ascending + ? a.dateAddedObject.compareTo(b.dateAddedObject) + : b.dateAddedObject.compareTo(a.dateAddedObject); + }); + return [..._hasDate, ..._hasNoDate]; + } + List _size(List data, bool ascending) { List _data = _alphabetical(data, true); ascending diff --git a/lib/modules/lidarr/widgets/search_result_tile.dart b/lib/modules/lidarr/widgets/search_result_tile.dart index 8f16e1dd..c8e8326b 100644 --- a/lib/modules/lidarr/widgets/search_result_tile.dart +++ b/lib/modules/lidarr/widgets/search_result_tile.dart @@ -131,7 +131,8 @@ class LidarrSearchResultTile extends StatelessWidget { fontWeight: FontWeight.bold, ), ), - TextSpan(text: '\t•\t${data.ageHours.lsTime_releaseAgeString() ?? 'Unknown'}\n'), + TextSpan(text: '\t•\t${data.indexer}\t•\t'), + TextSpan(text: '${data.ageHours.lsTime_releaseAgeString() ?? 'Unknown'}\n'), TextSpan(text: '${data.quality ?? 'Unknown'}\t•\t'), TextSpan(text: '${data.size.lsBytes_BytesToString() ?? 'Unknown'}'), ], diff --git a/lib/modules/nzbget/core/constants.dart b/lib/modules/nzbget/core/constants.dart index 3f212b64..99526842 100644 --- a/lib/modules/nzbget/core/constants.dart +++ b/lib/modules/nzbget/core/constants.dart @@ -1,3 +1,4 @@ +import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; class NZBGetConstants { @@ -10,5 +11,6 @@ class NZBGetConstants { 'desc': 'Manage Usenet Downloads', 'icon': CustomIcons.nzbget, 'route': '/nzbget', + 'color': Color(0xFF42D535), }; } diff --git a/lib/modules/radarr/core/api/api.dart b/lib/modules/radarr/core/api/api.dart index 70061156..739e6983 100644 --- a/lib/modules/radarr/core/api/api.dart +++ b/lib/modules/radarr/core/api/api.dart @@ -220,6 +220,7 @@ class RadarrAPI extends API { studio: entry['studio'] ?? 'Unknown Studio', physicalRelease: entry['physicalRelease'] ?? '', inCinemas: entry['inCinemas'] ?? '', + added: entry['added'] ?? '', status: entry['status'] ?? 'Unknown Status', year: entry['year'] ?? 0, movieID: entry['id'] ?? -1, @@ -277,6 +278,7 @@ class RadarrAPI extends API { studio: response.data['studio'] ?? 'Unknown Studio', physicalRelease: response.data['physicalRelease'] ?? '', inCinemas: response.data['inCinemas'] ?? '', + added: response.data['added'] ?? '', status: response.data['status'] ?? 'Unknown Status', year: response.data['year'] ?? 0, movieID: response.data['id'] ?? -1, diff --git a/lib/modules/radarr/core/api/data/availability.g.dart b/lib/modules/radarr/core/api/data/availability.g.dart index adcb5ccf..5694f387 100644 --- a/lib/modules/radarr/core/api/data/availability.g.dart +++ b/lib/modules/radarr/core/api/data/availability.g.dart @@ -8,13 +8,13 @@ part of 'availability.dart'; class RadarrAvailabilityAdapter extends TypeAdapter { @override - final typeId = 7; + final int typeId = 7; @override RadarrAvailability read(BinaryReader reader) { - var numOfFields = reader.readByte(); - var fields = { - for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return RadarrAvailability( id: fields[0] as String, @@ -31,4 +31,14 @@ class RadarrAvailabilityAdapter extends TypeAdapter { ..writeByte(1) ..write(obj.name); } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RadarrAvailabilityAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/modules/radarr/core/api/data/catalogue.dart b/lib/modules/radarr/core/api/data/catalogue.dart index f77b6427..366e4e01 100644 --- a/lib/modules/radarr/core/api/data/catalogue.dart +++ b/lib/modules/radarr/core/api/data/catalogue.dart @@ -10,6 +10,7 @@ class RadarrCatalogueData { String studio; String physicalRelease; String inCinemas; + String added; String status; String profile; String overview; @@ -34,6 +35,7 @@ class RadarrCatalogueData { @required this.studio, @required this.physicalRelease, @required this.inCinemas, + @required this.added, @required this.status, @required this.year, @required this.movieID, @@ -102,6 +104,15 @@ class RadarrCatalogueData { return null; } + DateTime get dateAddedObject => DateTime.tryParse(added)?.toLocal(); + + String get dateAdded { + if(dateAddedObject != null) { + return DateFormat('MMMM dd, y').format(dateAddedObject); + } + return 'Unknown'; + } + String get inCinemasString { if(inCinemasObject != null) { return DateFormat('MMMM dd, y').format(inCinemasObject); @@ -131,6 +142,7 @@ class RadarrCatalogueData { String _sortSubtitle(RadarrCatalogueSorting sorting) { switch(sorting) { case RadarrCatalogueSorting.studio: return studio; + case RadarrCatalogueSorting.dateAdded: return dateAdded; case RadarrCatalogueSorting.year: case RadarrCatalogueSorting.runtime: case RadarrCatalogueSorting.alphabetical: diff --git a/lib/modules/radarr/core/api/data/qualityprofile.g.dart b/lib/modules/radarr/core/api/data/qualityprofile.g.dart index ab4d9a64..41b295b3 100644 --- a/lib/modules/radarr/core/api/data/qualityprofile.g.dart +++ b/lib/modules/radarr/core/api/data/qualityprofile.g.dart @@ -8,13 +8,13 @@ part of 'qualityprofile.dart'; class RadarrQualityProfileAdapter extends TypeAdapter { @override - final typeId = 6; + final int typeId = 6; @override RadarrQualityProfile read(BinaryReader reader) { - var numOfFields = reader.readByte(); - var fields = { - for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return RadarrQualityProfile( id: fields[0] as int, @@ -31,4 +31,14 @@ class RadarrQualityProfileAdapter extends TypeAdapter { ..writeByte(1) ..write(obj.name); } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RadarrQualityProfileAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/modules/radarr/core/api/data/rootfolder.g.dart b/lib/modules/radarr/core/api/data/rootfolder.g.dart index 1834a3d2..799372b2 100644 --- a/lib/modules/radarr/core/api/data/rootfolder.g.dart +++ b/lib/modules/radarr/core/api/data/rootfolder.g.dart @@ -8,13 +8,13 @@ part of 'rootfolder.dart'; class RadarrRootFolderAdapter extends TypeAdapter { @override - final typeId = 5; + final int typeId = 5; @override RadarrRootFolder read(BinaryReader reader) { - var numOfFields = reader.readByte(); - var fields = { - for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return RadarrRootFolder( id: fields[0] as int, @@ -34,4 +34,14 @@ class RadarrRootFolderAdapter extends TypeAdapter { ..writeByte(2) ..write(obj.freeSpace); } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RadarrRootFolderAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/modules/radarr/core/constants.dart b/lib/modules/radarr/core/constants.dart index 1b652d71..303a8244 100644 --- a/lib/modules/radarr/core/constants.dart +++ b/lib/modules/radarr/core/constants.dart @@ -1,3 +1,4 @@ +import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/radarr.dart'; @@ -11,6 +12,7 @@ class RadarrConstants { 'desc': 'Manage Movies', 'icon': CustomIcons.movies, 'route': '/radarr', + 'color': Color(0xFFFEC333), }; static const Map EVENT_TYPE_MESSAGES = { diff --git a/lib/modules/radarr/core/sorting/catalogue.dart b/lib/modules/radarr/core/sorting/catalogue.dart index 61448d12..3fdd764d 100644 --- a/lib/modules/radarr/core/sorting/catalogue.dart +++ b/lib/modules/radarr/core/sorting/catalogue.dart @@ -3,6 +3,7 @@ import 'package:lunasea/modules/radarr.dart'; enum RadarrCatalogueSorting { alphabetical, + dateAdded, quality, runtime, size, @@ -16,6 +17,7 @@ extension RadarrCatalogueSortingExtension on RadarrCatalogueSorting { String get value { switch(this) { case RadarrCatalogueSorting.alphabetical: return 'abc'; + case RadarrCatalogueSorting.dateAdded: return 'date_added'; case RadarrCatalogueSorting.size: return 'size'; case RadarrCatalogueSorting.quality: return 'quality'; case RadarrCatalogueSorting.studio: return 'studio'; @@ -28,6 +30,7 @@ extension RadarrCatalogueSortingExtension on RadarrCatalogueSorting { String get readable { switch(this) { case RadarrCatalogueSorting.alphabetical: return 'Alphabetical'; + case RadarrCatalogueSorting.dateAdded: return 'Date Added'; case RadarrCatalogueSorting.size: return 'Size'; case RadarrCatalogueSorting.quality: return 'Quality Profile'; case RadarrCatalogueSorting.studio: return 'Studio'; @@ -52,6 +55,7 @@ class _Sorter extends Sorter { ) { switch(type) { case RadarrCatalogueSorting.alphabetical: return _alphabetical(data, ascending); + case RadarrCatalogueSorting.dateAdded: return _dateAdded(data, ascending); case RadarrCatalogueSorting.size: return _size(data, ascending); case RadarrCatalogueSorting.quality: return _quality(data, ascending); case RadarrCatalogueSorting.studio: return _studio(data, ascending); @@ -69,6 +73,18 @@ class _Sorter extends Sorter { return _data; } + List _dateAdded(List data, bool ascending) { + List _data = _alphabetical(data, true); + List _hasNoDate = _data.where((item) => item.dateAddedObject == null).toList(); + List _hasDate = _data.where((item) => item.dateAddedObject != null).toList(); + _hasDate.sort((a,b) { + return ascending + ? a.dateAddedObject.compareTo(b.dateAddedObject) + : b.dateAddedObject.compareTo(a.dateAddedObject); + }); + return [..._hasDate, ..._hasNoDate]; + } + List _size(List data, bool ascending) { List _data = new List.from(data, growable: false); ascending diff --git a/lib/modules/radarr/widgets/details_search_tile.dart b/lib/modules/radarr/widgets/details_search_tile.dart index 092a9bc2..994ce733 100644 --- a/lib/modules/radarr/widgets/details_search_tile.dart +++ b/lib/modules/radarr/widgets/details_search_tile.dart @@ -137,7 +137,8 @@ class RadarrSearchResultTile extends StatelessWidget { fontWeight: FontWeight.bold, ), ), - TextSpan(text: '\t•\t${data.ageHours.lsTime_releaseAgeString() ?? 'Unknown'}\n'), + TextSpan(text: '\t•\t${data.indexer}\t•\t'), + TextSpan(text: '${data.ageHours.lsTime_releaseAgeString() ?? 'Unknown'}\n'), TextSpan(text: '${data.quality ?? 'Unknown'}\t•\t'), TextSpan(text: '${data.size.lsBytes_BytesToString() ?? 'Unknown'}'), ], diff --git a/lib/modules/sabnzbd/core/constants.dart b/lib/modules/sabnzbd/core/constants.dart index 10f4f328..48b2029d 100644 --- a/lib/modules/sabnzbd/core/constants.dart +++ b/lib/modules/sabnzbd/core/constants.dart @@ -1,3 +1,4 @@ +import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; class SABnzbdConstants { @@ -10,5 +11,6 @@ class SABnzbdConstants { 'desc': 'Manage Usenet Downloads', 'icon': CustomIcons.sabnzbd, 'route': '/sabnzbd', + 'color': Color(0xFFFECC2B), }; } diff --git a/lib/modules/search/core/constants.dart b/lib/modules/search/core/constants.dart index ea05a2e1..66b82ec2 100644 --- a/lib/modules/search/core/constants.dart +++ b/lib/modules/search/core/constants.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:lunasea/core/constants.dart'; class SearchConstants { SearchConstants._(); @@ -10,5 +11,6 @@ class SearchConstants { 'desc': 'Search Newznab Indexers', 'icon': Icons.search, 'route': '/search', + 'color': Color(Constants.ACCENT_COLOR), }; } diff --git a/lib/modules/search/core/database.dart b/lib/modules/search/core/database.dart index 4d1c3e33..c321c0d8 100644 --- a/lib/modules/search/core/database.dart +++ b/lib/modules/search/core/database.dart @@ -8,12 +8,14 @@ class SearchDatabase { enum SearchDatabaseValue { NAVIGATION_INDEX, + HIDE_XXX, } extension SearchDatabaseValueExtension on SearchDatabaseValue { String get key { switch(this) { case SearchDatabaseValue.NAVIGATION_INDEX: return 'SEARCH_NAVIGATION_INDEX'; + case SearchDatabaseValue.HIDE_XXX: return 'SEARCH_HIDE_XXX'; } throw Exception('key not found'); } @@ -22,7 +24,10 @@ extension SearchDatabaseValueExtension on SearchDatabaseValue { final _box = Database.lunaSeaBox; switch(this) { case SearchDatabaseValue.NAVIGATION_INDEX: return _box.get(this.key, defaultValue: 0); + case SearchDatabaseValue.HIDE_XXX: return _box.get(this.key, defaultValue: false); } throw Exception('data not found'); } + + void put(dynamic value) => Database.lunaSeaBox.put(this.key, value); } diff --git a/lib/modules/search/routes/categories.dart b/lib/modules/search/routes/categories.dart index b4b22d64..2987d6df 100644 --- a/lib/modules/search/routes/categories.dart +++ b/lib/modules/search/routes/categories.dart @@ -67,7 +67,9 @@ class _State extends State { Widget _list(List categories) => categories.length > 0 ? LSListViewBuilder( itemCount: categories.length, - itemBuilder: (context, index) => SearchCategoryTile(category: categories[index], index: index), + itemBuilder: (context, index) => SearchDatabaseValue.HIDE_XXX.data && categories[index].name.toLowerCase() == "xxx" + ? Container() + : SearchCategoryTile(category: categories[index], index: index), ) : LSGenericMessage( text: 'No Categories Found', diff --git a/lib/modules/settings/core/constants.dart b/lib/modules/settings/core/constants.dart index 6aa426ec..4dfad4c9 100644 --- a/lib/modules/settings/core/constants.dart +++ b/lib/modules/settings/core/constants.dart @@ -1,3 +1,4 @@ +import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; class SettingsConstants { @@ -10,5 +11,6 @@ class SettingsConstants { 'desc': 'Update Configuration', 'icon': CustomIcons.settings, 'route': '/settings', + 'color': Color(Constants.ACCENT_COLOR), }; } diff --git a/lib/modules/settings/core/dialogs.dart b/lib/modules/settings/core/dialogs.dart index 726f27aa..79e70437 100644 --- a/lib/modules/settings/core/dialogs.dart +++ b/lib/modules/settings/core/dialogs.dart @@ -612,6 +612,7 @@ class SettingsDialogs { void _setValues(bool flag, CalendarStartingSize startingSize) { _flag = flag; _startingSize = startingSize; + Provider.of(context, listen: false).showCalendarSchedule = _startingSize == CalendarStartingSize.SCHEDULE; Navigator.of(context).pop(); } diff --git a/lib/modules/settings/routes/modules/general_home.dart b/lib/modules/settings/routes/modules/general_home.dart index 406b8f8d..9e2d9272 100644 --- a/lib/modules/settings/routes/modules/general_home.dart +++ b/lib/modules/settings/routes/modules/general_home.dart @@ -24,7 +24,8 @@ class _State extends State { Widget get _body => LSListView( children: [ ..._customization, - ..._calendarModules, + ..._calendarCustomization, + ..._quickLinksCustomization, ], ); @@ -34,17 +35,25 @@ class _State extends State { subtitle: 'Make the home screen fit your needs', ), SettingsModulesHomeDefaultPageTile(), - SettingsModulesHomeCalendarStartingDateTile(), - SettingsModulesHomeCalendarStartingSizeTile(), ]; - List get _calendarModules => [ + List get _calendarCustomization => [ LSHeader( - text: 'Calendar Modules', - subtitle: 'Choose which modules are active in the calendar', + text: 'Calendar Customization', + subtitle: 'Make the calendar fit your needs', ), + SettingsModulesHomeCalendarStartingDateTile(), + SettingsModulesHomeCalendarStartingSizeTile(), if(ModuleFlags.LIDARR) SettingsModulesCalendarEnableLidarrTile(), if(ModuleFlags.RADARR) SettingsModulesCalendarEnableRadarrTile(), if(ModuleFlags.SONARR) SettingsModulesCalendarEnableSonarrTile(), ]; + + List get _quickLinksCustomization => [ + LSHeader( + text: 'Modules Customization', + subtitle: 'Make the modules fit your needs', + ), + SettingsModulesHomeBrandColours(), + ]; } diff --git a/lib/modules/settings/routes/modules/general_search.dart b/lib/modules/settings/routes/modules/general_search.dart index 3a45c4ff..4384de0b 100644 --- a/lib/modules/settings/routes/modules/general_search.dart +++ b/lib/modules/settings/routes/modules/general_search.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; +import 'package:lunasea/modules/search/core/database.dart'; import 'package:lunasea/modules/settings.dart'; class SettingsModulesSearch extends StatefulWidget { @@ -27,6 +28,7 @@ class _State extends State { Widget get _body => LSListView( children: [ ..._indexers, + ..._customization, ], ); @@ -44,6 +46,24 @@ class _State extends State { ), ]; + List get _customization => [ + LSHeader( + text: 'Customization', + subtitle: 'Customize search to fit your needs', + ), + ValueListenableBuilder( + valueListenable: Database.lunaSeaBox.listenable(keys: [SearchDatabaseValue.HIDE_XXX.key]), + builder: (context, box, widget) => LSCardTile( + title: LSTitle(text: 'Hide Adult Categories'), + subtitle: LSSubtitle(text: 'Hide categories that contain adult content'), + trailing: Switch( + value: SearchDatabaseValue.HIDE_XXX.data, + onChanged: (value) => SearchDatabaseValue.HIDE_XXX.put(value), + ), + ), + ), + ]; + List get _indexerList { List list = List.generate(Database.indexersBox.length, (index) { IndexerHiveObject indexer = Database.indexersBox.getAt(index); diff --git a/lib/modules/settings/widgets/modules.dart b/lib/modules/settings/widgets/modules.dart index 5c1dc82f..697d4bda 100644 --- a/lib/modules/settings/widgets/modules.dart +++ b/lib/modules/settings/widgets/modules.dart @@ -1,2 +1,2 @@ -export 'modules/calendar.dart'; +export 'modules/home.dart'; export 'modules/lunasea.dart'; diff --git a/lib/modules/settings/widgets/modules/calendar.dart b/lib/modules/settings/widgets/modules/home.dart similarity index 83% rename from lib/modules/settings/widgets/modules/calendar.dart rename to lib/modules/settings/widgets/modules/home.dart index f29e187f..7abb5566 100644 --- a/lib/modules/settings/widgets/modules/calendar.dart +++ b/lib/modules/settings/widgets/modules/home.dart @@ -3,4 +3,5 @@ export 'home/start_size_tile.dart'; export 'home/enable_lidarr.dart'; export 'home/enable_radarr.dart'; export 'home/enable_sonarr.dart'; +export 'home/module_brand_colours.dart'; export 'home/default_page.dart'; diff --git a/lib/modules/settings/widgets/modules/home/enable_lidarr.dart b/lib/modules/settings/widgets/modules/home/enable_lidarr.dart index 1dc46bac..52405fd2 100644 --- a/lib/modules/settings/widgets/modules/home/enable_lidarr.dart +++ b/lib/modules/settings/widgets/modules/home/enable_lidarr.dart @@ -7,11 +7,8 @@ class SettingsModulesCalendarEnableLidarrTile extends StatelessWidget { Widget build(BuildContext context) => ValueListenableBuilder( valueListenable: Database.lunaSeaBox.listenable(keys: [HomeDatabaseValue.CALENDAR_ENABLE_LIDARR.key]), builder: (context, box, widget) => LSCardTile( - title: LSTitle(text: 'Lidarr'), - subtitle: LSSubtitle(text: HomeDatabaseValue.CALENDAR_ENABLE_LIDARR.data - ? 'Showing Lidarr Entries' - : 'Hiding Lidarr Entries' - ), + title: LSTitle(text: 'Lidarr in Calendar'), + subtitle: LSSubtitle(text: 'Show Lidarr calendar entries'), trailing: Switch( value: HomeDatabaseValue.CALENDAR_ENABLE_LIDARR.data, onChanged: _changeState, diff --git a/lib/modules/settings/widgets/modules/home/enable_radarr.dart b/lib/modules/settings/widgets/modules/home/enable_radarr.dart index 3b43fcb7..dfc02df4 100644 --- a/lib/modules/settings/widgets/modules/home/enable_radarr.dart +++ b/lib/modules/settings/widgets/modules/home/enable_radarr.dart @@ -7,11 +7,8 @@ class SettingsModulesCalendarEnableRadarrTile extends StatelessWidget { Widget build(BuildContext context) => ValueListenableBuilder( valueListenable: Database.lunaSeaBox.listenable(keys: [HomeDatabaseValue.CALENDAR_ENABLE_RADARR.key]), builder: (context, box, widget) => LSCardTile( - title: LSTitle(text: 'Radarr'), - subtitle: LSSubtitle(text: HomeDatabaseValue.CALENDAR_ENABLE_RADARR.data - ? 'Showing Radarr Entries' - : 'Hiding Radarr Entries' - ), + title: LSTitle(text: 'Radarr in Calendar'), + subtitle: LSSubtitle(text: 'Show Radarr calendar entries'), trailing: Switch( value: HomeDatabaseValue.CALENDAR_ENABLE_RADARR.data, onChanged: _changeState, diff --git a/lib/modules/settings/widgets/modules/home/enable_sonarr.dart b/lib/modules/settings/widgets/modules/home/enable_sonarr.dart index 04c082ac..bf4034d8 100644 --- a/lib/modules/settings/widgets/modules/home/enable_sonarr.dart +++ b/lib/modules/settings/widgets/modules/home/enable_sonarr.dart @@ -7,11 +7,8 @@ class SettingsModulesCalendarEnableSonarrTile extends StatelessWidget { Widget build(BuildContext context) => ValueListenableBuilder( valueListenable: Database.lunaSeaBox.listenable(keys: [HomeDatabaseValue.CALENDAR_ENABLE_SONARR.key]), builder: (context, box, widget) => LSCardTile( - title: LSTitle(text: 'Sonarr'), - subtitle: LSSubtitle(text: HomeDatabaseValue.CALENDAR_ENABLE_SONARR.data - ? 'Showing Sonarr Entries' - : 'Hiding Sonarr Entries' - ), + title: LSTitle(text: 'Sonarr in Calendar'), + subtitle: LSSubtitle(text: 'Show Sonarr calendar entries'), trailing: Switch( value: HomeDatabaseValue.CALENDAR_ENABLE_SONARR.data, onChanged: _changeState, diff --git a/lib/modules/settings/widgets/modules/home/module_brand_colours.dart b/lib/modules/settings/widgets/modules/home/module_brand_colours.dart new file mode 100644 index 00000000..008dca1a --- /dev/null +++ b/lib/modules/settings/widgets/modules/home/module_brand_colours.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; +import 'package:lunasea/core.dart'; +import 'package:lunasea/modules/home.dart'; + +class SettingsModulesHomeBrandColours extends StatelessWidget { + @override + Widget build(BuildContext context) => ValueListenableBuilder( + valueListenable: Database.lunaSeaBox.listenable(keys: [HomeDatabaseValue.MODULES_BRAND_COLOURS.key]), + builder: (context, box, widget) => LSCardTile( + title: LSTitle(text: 'Use Brand Colours'), + subtitle: LSSubtitle(text: 'Use the brand colours for the icons'), + trailing: Switch( + value: HomeDatabaseValue.MODULES_BRAND_COLOURS.data, + onChanged: (value) => HomeDatabaseValue.MODULES_BRAND_COLOURS.put(value), + ), + ), + ); +} diff --git a/lib/modules/settings/widgets/modules/home/start_date_tile.dart b/lib/modules/settings/widgets/modules/home/start_date_tile.dart index b403f1a8..32e1c0f5 100644 --- a/lib/modules/settings/widgets/modules/home/start_date_tile.dart +++ b/lib/modules/settings/widgets/modules/home/start_date_tile.dart @@ -8,7 +8,7 @@ class SettingsModulesHomeCalendarStartingDateTile extends StatelessWidget { Widget build(BuildContext context) => ValueListenableBuilder( valueListenable: Database.lunaSeaBox.listenable(keys: [HomeDatabaseValue.CALENDAR_STARTING_DAY.key]), builder: (context, box, widget) => LSCardTile( - title: LSTitle(text: 'Calendar Starting Day'), + title: LSTitle(text: 'Starting Day'), subtitle: LSSubtitle(text: (HomeDatabaseValue.CALENDAR_STARTING_DAY.data as CalendarStartingDay).name), trailing: LSIconButton(icon: Icons.arrow_forward_ios), onTap: () async => _changeDate(context), diff --git a/lib/modules/settings/widgets/modules/home/start_size_tile.dart b/lib/modules/settings/widgets/modules/home/start_size_tile.dart index 34da5c66..d658f30f 100644 --- a/lib/modules/settings/widgets/modules/home/start_size_tile.dart +++ b/lib/modules/settings/widgets/modules/home/start_size_tile.dart @@ -8,7 +8,7 @@ class SettingsModulesHomeCalendarStartingSizeTile extends StatelessWidget { Widget build(BuildContext context) => ValueListenableBuilder( valueListenable: Database.lunaSeaBox.listenable(keys: [HomeDatabaseValue.CALENDAR_STARTING_SIZE.key]), builder: (context, box, widget) => LSCardTile( - title: LSTitle(text: 'Calendar Starting Size'), + title: LSTitle(text: 'Starting Size'), subtitle: LSSubtitle(text: (HomeDatabaseValue.CALENDAR_STARTING_SIZE.data as CalendarStartingSize).name), trailing: LSIconButton(icon: Icons.arrow_forward_ios), onTap: () async => _changeSize(context), diff --git a/lib/modules/sonarr/core/api/api.dart b/lib/modules/sonarr/core/api/api.dart index b4324024..c7a4255e 100644 --- a/lib/modules/sonarr/core/api/api.dart +++ b/lib/modules/sonarr/core/api/api.dart @@ -223,6 +223,7 @@ class SonarrAPI extends API { seriesID: body['id'] ?? -1, previousAiring: body['previousAiring'] ?? '', nextAiring: body['nextAiring'] ?? '', + added: body['added'] ?? '', network: body['network'] ?? 'Unknown Network', monitored: body['monitored'] ?? false, path: body['path'] ?? 'Unknown Path', @@ -265,6 +266,7 @@ class SonarrAPI extends API { seriesID: entry['id'] ?? -1, previousAiring: entry['previousAiring'] ?? '', nextAiring: entry['nextAiring'] ?? '', + added: entry['added'] ?? '', network: entry['network'] ?? 'Unknown Network', monitored: entry['monitored'] ?? false, path: entry['path'] ?? 'Unknown Path', diff --git a/lib/modules/sonarr/core/api/data/catalogue.dart b/lib/modules/sonarr/core/api/data/catalogue.dart index 46606e44..779c9dfc 100644 --- a/lib/modules/sonarr/core/api/data/catalogue.dart +++ b/lib/modules/sonarr/core/api/data/catalogue.dart @@ -10,6 +10,7 @@ class SonarrCatalogueData { String status; String previousAiring; String nextAiring; + String added; String network; String overview; String path; @@ -40,6 +41,7 @@ class SonarrCatalogueData { @required this.seriesID, @required this.previousAiring, @required this.nextAiring, + @required this.added, @required this.network, @required this.monitored, @required this.path, @@ -55,18 +57,23 @@ class SonarrCatalogueData { @required this.sizeOnDisk, }); - DateTime get nextAiringObject { - return DateTime.tryParse(nextAiring)?.toLocal(); - } + DateTime get nextAiringObject => DateTime.tryParse(nextAiring)?.toLocal(); - DateTime get previousAiringObject { - return DateTime.tryParse(previousAiring)?.toLocal(); - } + DateTime get previousAiringObject => DateTime.tryParse(previousAiring)?.toLocal(); + + DateTime get dateAddedObject => DateTime.tryParse(added)?.toLocal(); String get seasonCountString { return seasonCount == 1 ? '$seasonCount Season' : '$seasonCount Seasons'; } + String get dateAdded { + if(added != null) { + return DateFormat('MMMM dd, y').format(dateAddedObject); + } + return 'Unknown'; + } + String get nextEpisode { if(nextAiringObject != null) { return DateFormat('MMMM dd, y').format(nextAiringObject); @@ -117,6 +124,7 @@ class SonarrCatalogueData { case SonarrCatalogueSorting.quality: return profile; case SonarrCatalogueSorting.episodes: return '${episodeFileCount ?? 0}/${episodeCount ?? 0} ($percentageComplete%)'; case SonarrCatalogueSorting.nextAiring: return nextEpisode; + case SonarrCatalogueSorting.dateAdded: return dateAdded; case SonarrCatalogueSorting.network: case SonarrCatalogueSorting.size: case SonarrCatalogueSorting.alphabetical: return sizeOnDisk?.lsBytes_BytesToString() ?? '0.0 B'; diff --git a/lib/modules/sonarr/core/api/data/monitor_status.g.dart b/lib/modules/sonarr/core/api/data/monitor_status.g.dart index e63504f2..38b70357 100644 --- a/lib/modules/sonarr/core/api/data/monitor_status.g.dart +++ b/lib/modules/sonarr/core/api/data/monitor_status.g.dart @@ -8,7 +8,7 @@ part of 'monitor_status.dart'; class SonarrMonitorStatusAdapter extends TypeAdapter { @override - final typeId = 14; + final int typeId = 14; @override SonarrMonitorStatus read(BinaryReader reader) { @@ -58,4 +58,14 @@ class SonarrMonitorStatusAdapter extends TypeAdapter { break; } } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SonarrMonitorStatusAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/modules/sonarr/core/api/data/qualityprofile.g.dart b/lib/modules/sonarr/core/api/data/qualityprofile.g.dart index ef075ac4..673deffc 100644 --- a/lib/modules/sonarr/core/api/data/qualityprofile.g.dart +++ b/lib/modules/sonarr/core/api/data/qualityprofile.g.dart @@ -8,13 +8,13 @@ part of 'qualityprofile.dart'; class SonarrQualityProfileAdapter extends TypeAdapter { @override - final typeId = 2; + final int typeId = 2; @override SonarrQualityProfile read(BinaryReader reader) { - var numOfFields = reader.readByte(); - var fields = { - for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return SonarrQualityProfile( id: fields[0] as int, @@ -31,4 +31,14 @@ class SonarrQualityProfileAdapter extends TypeAdapter { ..writeByte(1) ..write(obj.name); } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SonarrQualityProfileAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/modules/sonarr/core/api/data/rootfolder.g.dart b/lib/modules/sonarr/core/api/data/rootfolder.g.dart index 60c56a03..55727728 100644 --- a/lib/modules/sonarr/core/api/data/rootfolder.g.dart +++ b/lib/modules/sonarr/core/api/data/rootfolder.g.dart @@ -8,13 +8,13 @@ part of 'rootfolder.dart'; class SonarrRootFolderAdapter extends TypeAdapter { @override - final typeId = 3; + final int typeId = 3; @override SonarrRootFolder read(BinaryReader reader) { - var numOfFields = reader.readByte(); - var fields = { - for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return SonarrRootFolder( id: fields[0] as int, @@ -34,4 +34,14 @@ class SonarrRootFolderAdapter extends TypeAdapter { ..writeByte(2) ..write(obj.freeSpace); } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SonarrRootFolderAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/modules/sonarr/core/api/data/seriestype.g.dart b/lib/modules/sonarr/core/api/data/seriestype.g.dart index 413a650f..a372ef86 100644 --- a/lib/modules/sonarr/core/api/data/seriestype.g.dart +++ b/lib/modules/sonarr/core/api/data/seriestype.g.dart @@ -8,13 +8,13 @@ part of 'seriestype.dart'; class SonarrSeriesTypeAdapter extends TypeAdapter { @override - final typeId = 4; + final int typeId = 4; @override SonarrSeriesType read(BinaryReader reader) { - var numOfFields = reader.readByte(); - var fields = { - for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return SonarrSeriesType( type: fields[0] as String, @@ -28,4 +28,14 @@ class SonarrSeriesTypeAdapter extends TypeAdapter { ..writeByte(0) ..write(obj.type); } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SonarrSeriesTypeAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; } diff --git a/lib/modules/sonarr/core/constants.dart b/lib/modules/sonarr/core/constants.dart index 35463c87..010c3bee 100644 --- a/lib/modules/sonarr/core/constants.dart +++ b/lib/modules/sonarr/core/constants.dart @@ -1,3 +1,4 @@ +import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; import 'package:lunasea/modules/sonarr.dart'; @@ -11,6 +12,7 @@ class SonarrConstants { 'desc': 'Manage Television Series', 'icon': CustomIcons.television, 'route': '/sonarr', + 'color': Color(0xFF3FC6F4), }; static const Map EVENT_TYPE_MESSAGES = { diff --git a/lib/modules/sonarr/core/sorting/catalogue.dart b/lib/modules/sonarr/core/sorting/catalogue.dart index a7e293ff..9f1f040e 100644 --- a/lib/modules/sonarr/core/sorting/catalogue.dart +++ b/lib/modules/sonarr/core/sorting/catalogue.dart @@ -3,6 +3,7 @@ import 'package:lunasea/modules/sonarr.dart'; enum SonarrCatalogueSorting { alphabetical, + dateAdded, episodes, network, nextAiring, @@ -18,6 +19,7 @@ extension SonarrCatalogueSortingExtension on SonarrCatalogueSorting { switch(this) { case SonarrCatalogueSorting.alphabetical: return 'abc'; case SonarrCatalogueSorting.episodes: return 'episodes'; + case SonarrCatalogueSorting.dateAdded: return 'date_added'; case SonarrCatalogueSorting.size: return 'size'; case SonarrCatalogueSorting.type: return 'type'; case SonarrCatalogueSorting.network: return 'network'; @@ -30,6 +32,7 @@ extension SonarrCatalogueSortingExtension on SonarrCatalogueSorting { String get readable { switch(this) { case SonarrCatalogueSorting.alphabetical: return 'Alphabetical'; + case SonarrCatalogueSorting.dateAdded: return 'Date Added'; case SonarrCatalogueSorting.episodes: return 'Episodes'; case SonarrCatalogueSorting.network: return 'Network'; case SonarrCatalogueSorting.size: return 'Size'; @@ -55,6 +58,7 @@ class _Sorter extends Sorter { ) { switch(type) { case SonarrCatalogueSorting.alphabetical: return _alphabetical(data, ascending); + case SonarrCatalogueSorting.dateAdded: return _dateAdded(data, ascending); case SonarrCatalogueSorting.size: return _size(data, ascending); case SonarrCatalogueSorting.type: return _type(data, ascending); case SonarrCatalogueSorting.network: return _network(data, ascending); @@ -73,6 +77,18 @@ class _Sorter extends Sorter { return _data; } + List _dateAdded(List data, bool ascending) { + List _data = _alphabetical(data, true); + List _hasNoDate = _data.where((item) => item.dateAddedObject == null).toList(); + List _hasDate = _data.where((item) => item.dateAddedObject != null).toList(); + _hasDate.sort((a,b) { + return ascending + ? a.dateAddedObject.compareTo(b.dateAddedObject) + : b.dateAddedObject.compareTo(a.dateAddedObject); + }); + return [..._hasDate, ..._hasNoDate]; + } + List _size(List data, bool ascending) { List _data = new List.from(data, growable: false); ascending diff --git a/lib/modules/sonarr/widgets/search_result_tile.dart b/lib/modules/sonarr/widgets/search_result_tile.dart index b4f435dd..041d20b8 100644 --- a/lib/modules/sonarr/widgets/search_result_tile.dart +++ b/lib/modules/sonarr/widgets/search_result_tile.dart @@ -130,7 +130,8 @@ class SonarrSearchResultTile extends StatelessWidget { fontWeight: FontWeight.bold, ), ), - TextSpan(text: '\t•\t${data.ageHours.lsTime_releaseAgeString() ?? 'Unknown'}\n'), + TextSpan(text: '\t•\t${data.indexer}\t•\t'), + TextSpan(text: '${data.ageHours.lsTime_releaseAgeString() ?? 'Unknown'}\n'), TextSpan(text: '${data.quality ?? 'Unknown'}\t•\t'), TextSpan(text: '${data.size.lsBytes_BytesToString() ?? 'Unknown'}'), ] diff --git a/pubspec.lock b/pubspec.lock index a176f614..9201ac8c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -9,12 +9,12 @@ packages: source: hosted version: "6.0.0" analyzer: - dependency: transitive + dependency: "direct overridden" description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.39.15" + version: "0.39.14" archive: dependency: transitive description: @@ -77,7 +77,7 @@ packages: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "1.10.1" build_runner_core: dependency: transitive description: @@ -238,7 +238,7 @@ packages: name: dio url: "https://pub.dartlang.org" source: hosted - version: "3.0.9" + version: "3.0.10" encrypt: dependency: "direct main" description: @@ -273,7 +273,7 @@ packages: name: file_picker url: "https://pub.dartlang.org" source: hosted - version: "1.13.0+1" + version: "1.13.3" file_picker_platform_interface: dependency: transitive description: @@ -301,7 +301,7 @@ packages: name: flare_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.6" flash: dependency: "direct main" description: @@ -402,7 +402,7 @@ packages: name: hive url: "https://pub.dartlang.org" source: hosted - version: "1.4.2" + version: "1.4.3" hive_flutter: dependency: "direct main" description: @@ -465,7 +465,7 @@ packages: name: in_app_purchase url: "https://pub.dartlang.org" source: hosted - version: "0.3.4+1" + version: "0.3.4+3" intl: dependency: "direct main" description: @@ -696,7 +696,7 @@ packages: name: provider url: "https://pub.dartlang.org" source: hosted - version: "4.3.1" + version: "4.3.2" pub_semver: dependency: transitive description: @@ -842,6 +842,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.2.3" + tautulli: + dependency: "direct main" + description: + name: tautulli + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0+2" term_glyph: dependency: transitive description: @@ -939,7 +946,7 @@ packages: name: wake_on_lan url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.1+1" watcher: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index a7b2fcd0..5e9f91eb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: lunasea description: Self Hosted Manager -version: 3.2.0+320003 +version: 3.3.0+330001 publish_to: 'none' environment: sdk: ">=2.7.0 <3.0.0" @@ -10,11 +10,11 @@ dependencies: connectivity: ^0.4.9 convert: ^2.1.1 cupertino_icons: ^0.1.3 - dio: ^3.0.9 + dio: ^3.0.10 encrypt: ^4.0.2 expandable: ^4.1.4 - file_picker: ^1.13.0+1 - flare_flutter: ^2.0.5 + file_picker: ^1.13.3 + flare_flutter: ^2.0.6 flash: ^1.3.1 flutter: sdk: flutter @@ -24,15 +24,15 @@ dependencies: f_logs: ^1.3.0-alpha-02 google_fonts: ^1.1.0 google_nav_bar: ^2.2.0 - hive: ^1.4.2 + hive: ^1.4.3 hive_flutter: ^0.3.1 - in_app_purchase: ^0.3.4+1 + in_app_purchase: ^0.3.4+3 intl: ^0.16.1 package_info: ^0.4.1 path_provider: ^1.6.11 percent_indicator: ^2.1.5 permission_handler: ^5.0.1+1 - provider: ^4.3.1 + provider: ^4.3.2 sentry: ^3.0.1 stack_trace: ^1.9.5 table_calendar: ^2.2.3 @@ -41,14 +41,18 @@ dependencies: uuid: ^2.2.0 xml_parser: ^0.1.2 # LunaTools Packages - wake_on_lan: ^1.1.1 + tautulli: ^1.0.0+2 + wake_on_lan: ^1.1.1+1 dev_dependencies: - build_runner: ^1.10.0 + build_runner: ^1.10.1 flutter_launcher_icons: ^0.7.5 flutter_native_splash: ^0.1.9 hive_generator: ^0.7.1 +dependency_overrides: + analyzer: 0.39.14 + flutter: uses-material-design: true assets: @@ -79,3 +83,8 @@ flutter_icons: flutter_native_splash: image: "assets/branding/splash.png" color: "#32323E" + +scripts: + adapters: flutter packages pub run build_runner build --delete-conflicting-outputs + icons: flutter pub run flutter_launcher_icons:main + splash: flutter pub pub run flutter_native_splash:create diff --git a/scripts/generate_adapters b/scripts/generate_adapters deleted file mode 100755 index 41064033..00000000 --- a/scripts/generate_adapters +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -cd .. -flutter packages pub run build_runner build --delete-conflicting-outputs diff --git a/scripts/generate_icons b/scripts/generate_icons deleted file mode 100755 index c4dab8bc..00000000 --- a/scripts/generate_icons +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -cd .. -flutter pub run flutter_launcher_icons:main diff --git a/scripts/generate_splash b/scripts/generate_splash deleted file mode 100755 index 55fabd5a..00000000 --- a/scripts/generate_splash +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -cd .. -flutter pub pub run flutter_native_splash:create