コード例 #1
0
        public async Task SetDiscs(IEnumerable <AddedDiscInfo> discs, CancellationToken cancellationToken)
        {
            ClearDiscItems();

            var discsList      = discs.ToList();
            var libraryArtists = await artistService.GetAllArtists(cancellationToken);

            var availableGenres = await genreService.GetAllGenres(cancellationToken);

            // For genre guessing we use all discs, including deleted.
            var allDiscs = await discService.GetAllDiscs(cancellationToken);

            foreach (var addedDiscInfo in discsList)
            {
                var parentFolder = await folderProvider.GetFolder(addedDiscInfo.DestinationFolderPath, cancellationToken);

                var folderExists = parentFolder != null;

                var existingDisc = parentFolder?.Discs.SingleOrDefault(d => d.TreeTitle == addedDiscInfo.TreeTitle);

                var availableArtists = BuildAvailableArtistsList(addedDiscInfo, libraryArtists);

                DiscViewItem discViewItem = existingDisc != null ?
                                            new ExistingDiscViewItem(existingDisc, addedDiscInfo, availableArtists, availableGenres) :
                                            new NewDiscViewItem(addedDiscInfo, folderExists, availableArtists, availableGenres, GuessArtistGenre(allDiscs, addedDiscInfo.Artist));

                discViewItem.PropertyChanged += DiscItem_PropertyChanged;
                Discs.Add(discViewItem);
            }
        }
コード例 #2
0
        public ActionResult GetAllArtist()
        {
            var model = _artistsService.GetAllArtists();

            return(PartialView(model));
        }
コード例 #3
0
        public IActionResult Get()
        {
            var artists = artistsService.GetAllArtists();

            return(Ok(artists));
        }
コード例 #4
0
        public IActionResult Index()
        {
            var artists = artistsService.GetAllArtists();

            return(View(artists));
        }