Esempio n. 1
0
        /// <summary>
        /// Read all the managed collections and then tell any registered listeners
        /// </summary>
        private static async void ReadManagedCollections()
        {
            await Songs.GetDataAsync();

            await Albums.GetDataAsync();

            await Sources.GetDataAsync();

            await Artists.GetDataAsync();

            await ArtistAlbums.GetDataAsync();

            await Libraries.GetDataAsync();

            await Playback.GetDataAsync();

            await Playlists.GetDataAsync();

            await Autoplays.GetDataAsync();

            await Tags.GetDataAsync();

            await TaggedAlbums.GetDataAsync();

            await GenrePopulations.GetDataAsync();

            // Carry out some one-off data linking
            await PopulateArtistsAsync();

            await FilterManagementController.FormGenreTagsAsync();

            DataAvailable = true;
            new StorageDataAvailableMessage().Send();
        }
Esempio n. 2
0
        /// <summary>
        /// Delete a single TaggedAlbum from the tag
        /// </summary>
        /// <param name="album"></param>
        public void DeleteTaggedAlbum(TaggedAlbum album)
        {
            if (PersistTag == true)
            {
                DBTest.TaggedAlbums.DeleteTaggedAlbum(album);
            }

            TaggedAlbums.Remove(album);
            AlbumToTagLookup.Remove(album.AlbumId);
        }
Esempio n. 3
0
        /// <summary>
        /// Move a set of selected items down and update the tag indexes
        /// </summary>
        /// <param name="items"></param>
        public void MoveItemsDown(IEnumerable <TaggedAlbum> items)
        {
            // There must be at least one TaggedAlbum entry beyond those that are selected. That entry needs to be moved to above the start of the selection
            TaggedAlbum itemToMove = TaggedAlbums[items.Last().TagIndex + 1];

            TaggedAlbums.RemoveAt(items.Last().TagIndex + 1);
            TaggedAlbums.Insert(items.First().TagIndex, itemToMove);

            // Now the tag index numbers in the TaggedAlbum entries must be updated to match their index in the collection
            AdjustTagIndexes();
        }
Esempio n. 4
0
        /// <summary>
        /// Add a TaggedAlbum to the Tag
        /// </summary>
        /// <param name="album"></param>
        public void AddTaggedAlbum(TaggedAlbum album)
        {
            album.TagIndex = TaggedAlbums.Count;
            album.TagId    = Id;

            if (PersistTag == true)
            {
                DBTest.TaggedAlbums.AddTaggedAlbum(album);
            }

            TaggedAlbums.Add(album);
            AlbumToTagLookup[album.AlbumId] = album;
        }