2020-03-24 22:17:03 +01:00
|
|
|
import '../models/album_model.dart';
|
2020-03-30 22:25:57 +02:00
|
|
|
import '../models/song_model.dart';
|
2020-03-24 22:17:03 +01:00
|
|
|
|
|
|
|
abstract class MusicDataSource {
|
|
|
|
Future<List<AlbumModel>> getAlbums();
|
|
|
|
Future<bool> albumExists(AlbumModel albumModel);
|
2020-06-28 10:40:53 +02:00
|
|
|
|
|
|
|
/// Insert album into the database. Return the ID of the inserted album.
|
|
|
|
Future<int> insertAlbum(AlbumModel albumModel);
|
2020-03-30 22:25:57 +02:00
|
|
|
|
|
|
|
Future<List<SongModel>> getSongs();
|
2020-04-16 08:04:34 +02:00
|
|
|
Future<List<SongModel>> getSongsFromAlbum(AlbumModel album);
|
2020-04-03 13:55:15 +02:00
|
|
|
Future<bool> songExists(SongModel songModel);
|
|
|
|
Future<void> insertSong(SongModel songModel);
|
2020-06-28 10:40:53 +02:00
|
|
|
|
|
|
|
Future<void> resetAlbumsPresentFlag();
|
|
|
|
|
|
|
|
/// Get an AlbumModel with the matching title and artist. Returns null if there is none.
|
|
|
|
Future<AlbumModel> getAlbumByTitleArtist(String title, String artist);
|
|
|
|
Future<void> flagAlbumPresent(AlbumModel albumModel);
|
|
|
|
Future<void> removeNonpresentAlbums();
|
|
|
|
|
|
|
|
Future<void> resetSongsPresentFlag();
|
|
|
|
Future<SongModel> getSongByPath(String path);
|
|
|
|
Future<SongModel> getSongByTitleAlbumArtist(
|
|
|
|
String title, String album, String artist);
|
|
|
|
Future<void> flagSongPresent(SongModel songModel);
|
|
|
|
Future<void> removeNonpresentSongs();
|
2020-03-24 22:17:03 +01:00
|
|
|
}
|