mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
don't pass all ids as params
instead, only pass ids to delete and chunk those by the param limit
This commit is contained in:
@@ -214,7 +214,7 @@ class DownloadService extends _$DownloadService {
|
||||
Future<void> deleteAll(int sourceId) async {
|
||||
final db = ref.read(databaseProvider);
|
||||
|
||||
final albumIds = await db.albumIdsWithDownloaded(sourceId).get();
|
||||
final albumIds = await db.albumIdsWithDownloadStatus(sourceId).get();
|
||||
for (var id in albumIds) {
|
||||
await deleteAlbum(await (db.albumById(sourceId, id)).getSingle());
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ part of 'download_service.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$downloadServiceHash() => r'92e963b5c070f4d1edb0cd81899b16393c2b9a70';
|
||||
String _$downloadServiceHash() => r'c72c49f980e307f3013467e76b6564d14a34a736';
|
||||
|
||||
/// See also [DownloadService].
|
||||
@ProviderFor(DownloadService)
|
||||
|
||||
@@ -31,7 +31,7 @@ class SyncService extends _$SyncService {
|
||||
final source = ref.read(musicSourceProvider);
|
||||
final db = ref.read(databaseProvider);
|
||||
|
||||
final ids = <String>[];
|
||||
final ids = <String>{};
|
||||
await for (var artists in source.allArtists()) {
|
||||
ids.addAll(artists.map((e) => e.id.value));
|
||||
await db.saveArtists(artists);
|
||||
@@ -44,7 +44,7 @@ class SyncService extends _$SyncService {
|
||||
final source = ref.read(musicSourceProvider);
|
||||
final db = ref.read(databaseProvider);
|
||||
|
||||
final ids = <String>[];
|
||||
final ids = <String>{};
|
||||
await for (var albums in source.allAlbums()) {
|
||||
ids.addAll(albums.map((e) => e.id.value));
|
||||
await db.saveAlbums(albums);
|
||||
@@ -57,7 +57,7 @@ class SyncService extends _$SyncService {
|
||||
final source = ref.read(musicSourceProvider);
|
||||
final db = ref.read(databaseProvider);
|
||||
|
||||
final ids = <String>[];
|
||||
final ids = <String>{};
|
||||
await for (var playlists in source.allPlaylists()) {
|
||||
ids.addAll(playlists.map((e) => e.playist.id.value));
|
||||
await db.savePlaylists(playlists);
|
||||
@@ -70,7 +70,7 @@ class SyncService extends _$SyncService {
|
||||
final source = ref.read(musicSourceProvider);
|
||||
final db = ref.read(databaseProvider);
|
||||
|
||||
final ids = <String>[];
|
||||
final ids = <String>{};
|
||||
await for (var songs in source.allSongs()) {
|
||||
ids.addAll(songs.map((e) => e.id.value));
|
||||
await db.saveSongs(songs);
|
||||
|
||||
@@ -6,7 +6,7 @@ part of 'sync_service.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$syncServiceHash() => r'2b8da374c3143bc56f17115440d57bc70468a17e';
|
||||
String _$syncServiceHash() => r'58ebee4e6f055b64ee6789ae43d63c0e15c679e0';
|
||||
|
||||
/// See also [SyncService].
|
||||
@ProviderFor(SyncService)
|
||||
|
||||
Reference in New Issue
Block a user