예제 #1
0
        public void AddFromDiscover(string parentDirectory = null)
        {
            SelectedTabIndex  = 3;
            DiscoverAvailable = true;

            var search = new NewMediaViewModel(_engine, _exceptionHandler, DialogService);

            search.AddFromDiscover(parentDirectory);

            Searches = new[] { search };
            SubscribeSearches();
            SelectedSearches = Searches;
        }
예제 #2
0
        public async Task AddFromSearch(string searchQuery, string parentDirectory = null)
        {
            SelectedTabIndex = 2;
            SearchAvailable  = true;

            var search = new NewMediaViewModel(_engine, _exceptionHandler, DialogService);
            var t      = search.AddFromSearch(searchQuery, parentDirectory);

            SelectedSearches = Searches = new[] { search };

            await t;

            SubscribeSearches();
        }
예제 #3
0
        public async Task AddFromImdbId(string imdbId, string directory = null)
        {
            SelectedTabIndex = 4;

            var search = new NewMediaViewModel(_engine, _exceptionHandler, DialogService);
            var t      = search.AddFromImdbId(imdbId, directory);

            Searches = new[] { search };
            SubscribeSearches();
            SelectedSearches = Searches;
            EditList         = new[] { search.Search.SelectedResult };

            await t;
        }
예제 #4
0
        // ReSharper disable once ParameterTypeCanBeEnumerable.Local
        private async Task AddDirectories(string[] directories)
        {
            Searches = null;

            var directoryInfoes   = directories.Select(d => new DirectoryInfo(d)).Where(di => di.Exists).ToList();
            var filterDirectories = directoryInfoes.Select(di => di.FullName).ToList();

            var medias = await _engine.GetMediaList(filterDirectories);

            var mediaList = medias.ToList();

            Searches = directoryInfoes
                       .Select(di => {
                var search = new NewMediaViewModel(_engine, _exceptionHandler, DialogService);
                search.AddFromDirectory(di, mediaList.FirstOrDefault(m => string.Equals(m.Directory, di.FullName, StringComparison.OrdinalIgnoreCase)));
                return(search);
            })
                       .ToList();
            SubscribeSearches();
        }
예제 #5
0
        public void AddFromDiscover(string parentDirectory = null) {
            SelectedTabIndex = 3;
            DiscoverAvailable = true;

            var search = new NewMediaViewModel(_engine, _exceptionHandler, DialogService);
            search.AddFromDiscover(parentDirectory);

            Searches = new[] { search };
            SubscribeSearches();
            SelectedSearches = Searches;
        }
예제 #6
0
        public async Task AddFromSearch(string searchQuery, string parentDirectory = null) {
            SelectedTabIndex = 2;
            SearchAvailable = true;

            var search = new NewMediaViewModel(_engine, _exceptionHandler, DialogService);
            var t = search.AddFromSearch(searchQuery, parentDirectory);
            SelectedSearches = Searches = new[] { search };

            await t;
            SubscribeSearches();
        }
예제 #7
0
        // ReSharper disable once ParameterTypeCanBeEnumerable.Local
        private async Task AddDirectories(string[] directories) {
            Searches = null;

            var directoryInfoes = directories.Select(d => new DirectoryInfo(d)).Where(di => di.Exists).ToList();
            var filterDirectories = directoryInfoes.Select(di => di.FullName).ToList();

            var medias = await _engine.GetMediaList(filterDirectories);
            var mediaList = medias.ToList();

            Searches = directoryInfoes
                .Select(di => {
                    var search = new NewMediaViewModel(_engine, _exceptionHandler, DialogService);
                    search.AddFromDirectory(di, mediaList.FirstOrDefault(m => string.Equals(m.Directory, di.FullName, StringComparison.OrdinalIgnoreCase)));
                    return search;
                })
                .ToList();
            SubscribeSearches();
        }
예제 #8
0
        public async Task AddFromImdbId(string imdbId, string directory = null) {
            SelectedTabIndex = 4;

            var search = new NewMediaViewModel(_engine, _exceptionHandler, DialogService);
            var t = search.AddFromImdbId(imdbId, directory);

            Searches = new[] { search };
            SubscribeSearches();
            SelectedSearches = Searches;
            EditList = new[] { search.Search.SelectedResult };

            await t;
        }