void ClearDatabase() { musicDatabase.DeleteAll(); musicDatabase.DeleteAll(); musicDatabase.DeleteAll(); trackCollectionRepository.DeleteAll(); tracklistItemRepository.DeleteAll(); musicDatabase.Initialize(); musicDatabase.Initialize(); musicDatabase.Initialize(); trackCollectionRepository.Initialize(); tracklistItemRepository.Initialize(); Artists.Clear(); Albums.Clear(); Tracks.Clear(); TrackCollections.Clear(); videoDatabase.DeleteAll(); Videos.Clear(); CameraRoll.Clear(); Shows.Clear(); }
public async Task Initialize() { Artists.Clear(); Albums.Clear(); Tracks.Clear(); TrackCollections.Clear(); Videos.Clear(); CameraRoll.Clear(); Shows.Clear(); if (_alreadyIndexedOnce) { return; } _alreadyIndexedOnce = true; // Doing full indexing from scratch if 0 tracks are found if (IsMusicDatabaseEmpty() && IsVideoDatabaseEmpty()) { ClearDatabase(); } else // Restore the database { LoadVideosFromDatabase(); await LoadShowsFromDatabase(); LoadCameraRollFromDatabase(); } await PerformMediaLibraryIndexing(); }
public void LoadCameraRollFromDatabase() { CameraRoll.Clear(); var camVideos = LoadVideos(x => x.IsCameraRoll); var newVideos = camVideos.OrderBy(x => x.Name); foreach (var item in newVideos) { CameraRoll.Add(item); } }