Skip to content

Commit

Permalink
can add job
Browse files Browse the repository at this point in the history
  • Loading branch information
Rivers authored and Rivers committed Sep 7, 2024
1 parent 9a8a06c commit c254fd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/screens/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
}

Future<void> _processJob(Job job, int index) async {
print('Processing job: ${job.targetPlaylist!.name}, index: $index');
print('Processing job: ${job.targetPlaylist.name}, index: $index');

setState(() {
isProcessing = true;
Expand All @@ -141,7 +141,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
_showResultSnackBar(results[0]);
} else {
_showResultSnackBar({
'name': job.targetPlaylist!.name,
'name': job.targetPlaylist.name,
'status': 'Error',
'result': 'No results returned from backend service',
});
Expand All @@ -155,7 +155,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
});

_showResultSnackBar({
'name': job.targetPlaylist!.name,
'name': job.targetPlaylist.name,
'status': 'Error',
'result': 'Error: ${e.toString()}',
});
Expand Down Expand Up @@ -263,7 +263,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
_addNewJob(newJob);
} else {
if (jobProvider.jobs
.any((job) => job.targetPlaylist!.id == selectedPlaylist.id)) {
.any((job) => job.targetPlaylist.id == selectedPlaylist.id)) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Playlist already selected for another job.'),
Expand Down Expand Up @@ -379,7 +379,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
},
),
SizedBox(height: widgetPadding),
if (job.isNull) _buildRecipeCard(job, jobEntry.key),
if (!job.isNull) _buildRecipeCard(job, jobEntry.key),
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/bottom_sheets/banned_genres_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class _BannedGenresBottomSheetState extends State<BannedGenresBottomSheet> {
final jobProvider = Provider.of<JobProvider>(context, listen: false);
final job = jobProvider.jobs[widget.jobIndex];
final spotifyService = getIt<SpotifyService>();
final targetPlaylistId = job.targetPlaylist!.id;
final targetPlaylistId = job.targetPlaylist.id;

if (targetPlaylistId == null) {
setState(() {
Expand Down

0 comments on commit c254fd2

Please sign in to comment.