Example #1
0
        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();
        }
Example #2
0
        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();
        }
Example #3
0
        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);
            }
        }