Skip to content

Commit

Permalink
Random fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anandnet committed Oct 5, 2024
1 parent abca3b7 commit 14f82f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ui/screens/Library/library_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class LibrarySongsController extends GetxController {
.whereType<MediaItem>()
.toList());
isSongFetched.value = true;

//Remove deleted songs and expired songUrl from database
startHouseKeeping();
}
Expand Down Expand Up @@ -98,6 +98,7 @@ class LibrarySongsController extends GetxController {
tempListContainer.clear();
}

/// remove song from library list and from storage only, not from database
Future<void> removeSong(MediaItem item, bool isDownloaded,
{String? url}) async {
if (tempListContainer.isNotEmpty) {
Expand Down
1 change: 1 addition & 0 deletions lib/utils/house_keeping.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Future<void> removeDeletedOfflineSongsFromDb() async {
final songKey = downloadedSongs[i]['videoId'];
final songUrl = downloadedSongs[i]['url'];
if (await File(songUrl).exists() == false) {
await songDownloadsBox.delete(songKey);
await librarySongsController.removeSong(
MediaItemBuilder.fromJson(downloadedSongs[i]), true);
final thumbNailPath = "$supportDir/thumbnails/$songKey.png";
Expand Down

0 comments on commit 14f82f4

Please sign in to comment.