Skip to content

Commit

Permalink
downloadDB schema fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HemantKArya committed Apr 8, 2024
1 parent 640c351 commit e84b118
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 86 deletions.
17 changes: 5 additions & 12 deletions lib/screens/screen/offline_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,11 @@ class OfflineScreen extends StatelessWidget {
style: Default_Theme.primaryTextStyle.merge(const TextStyle(
fontSize: 34, color: Default_Theme.primaryColor1))),
const Spacer(),
// InkWell(
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => const DownloadsView()));
// },
// child: const Icon(
// FontAwesome.download_solid,
// size: 25,
// ),
// ),
// IconButton(
// onPressed: () {
// context.read<OfflineCubit>().getSongs();
// },
// icon: const Icon(MingCute.refresh_1_line)),
],
),
);
Expand Down
24 changes: 15 additions & 9 deletions lib/screens/widgets/song_card_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,24 @@ class SongCardWidget extends StatelessWidget {
color: Default_Theme.primaryColor1,
),
onPressed: () {
if (context
.read<BloomeePlayerCubit>()
.bloomeePlayer
.currentMedia
.id !=
song.id) {
try {
if (context
.read<BloomeePlayerCubit>()
.bloomeePlayer
.currentMedia
.id !=
song.id) {
BloomeeDBService.removeDownloadDB(song);
SnackbarService.showMessage(
"Removed ${song.title}");
} else {
SnackbarService.showMessage(
"Cannot delete currently playing song");
}
} catch (e) {
BloomeeDBService.removeDownloadDB(song);
SnackbarService.showMessage(
"Removed ${song.title}");
} else {
SnackbarService.showMessage(
"Cannot delete currently playing song");
}
},
),
Expand Down
2 changes: 0 additions & 2 deletions lib/services/db/GlobalDB.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,12 @@ class DownloadDB {
String fileName;
String filePath;
DateTime? lastDownloaded;
bool isDownloaded;
String mediaId;
DownloadDB({
this.id,
required this.fileName,
required this.filePath,
required this.lastDownloaded,
required this.isDownloaded,
required this.mediaId,
});
}
69 changes: 7 additions & 62 deletions lib/services/db/GlobalDB.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lib/services/db/bloomee_db_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,6 @@ class BloomeeDBService {
fileName: fileName,
filePath: filePath,
lastDownloaded: lastDownloaded,
isDownloaded: true,
mediaId: mediaItem.id,
);
Isar isarDB = await db;
Expand Down

0 comments on commit e84b118

Please sign in to comment.