コード例 #1
0
 private void setupLibraryList(string libraryList)
 {
     if (!string.IsNullOrWhiteSpace(libraryList))
     {
         var          libraries         = libraryList.Split(',').Select((lib) => { lib = lib.Trim(); return(lib.StartsWith("/") ? lib : "/" + lib); }).ToArray();
         ILibraryList libraryListObject = AdgFactory.NewLibraryList(myDatabase.Connection);
         libraryListObject.CurrentUserLibs = libraries;
     }
 }
コード例 #2
0
        protected void LoadProviders()
        {
            lock (concurrentCompositionLock)
            {
                var loader = new IndexedPluginLoader <int>("Id");
                loader.AddFromTreeMatch(@"PlugIns\MPExtended.PlugIns.MAS.*", @"Plugins\Media");
                loader.AddExport <IPluginData>(new PluginData());
                loader.AddRequiredMetadata("Id");
                loader.AddRequiredMetadata("Name");

                MovieLibraries      = new LibraryList <IMovieLibrary>(loader.GetIndexedPlugins <IMovieLibrary>(), ProviderType.Movie);
                MusicLibraries      = new LibraryList <IMusicLibrary>(loader.GetIndexedPlugins <IMusicLibrary>(), ProviderType.Music);
                TVShowLibraries     = new LibraryList <ITVShowLibrary>(loader.GetIndexedPlugins <ITVShowLibrary>(), ProviderType.TVShow);
                PictureLibraries    = new LibraryList <IPictureLibrary>(loader.GetIndexedPlugins <IPictureLibrary>(), ProviderType.Picture);
                FileSystemLibraries = new LibraryList <IFileSystemLibrary>(loader.GetIndexedPlugins <IFileSystemLibrary>(), ProviderType.Filesystem);
                PlaylistLibraries   = new LibraryList <IPlaylistLibrary>(loader.GetIndexedPlugins <IPlaylistLibrary>(), ProviderType.Playlist);
            }
        }
コード例 #3
0
        private void Initialize()
        {
            if (!Compose())
            {
                return;
            }

            try
            {
                MovieLibraries      = new LazyLibraryList <IMovieLibrary>(CreateList(MovieLibrariesLoaded), ProviderType.Movie);
                MusicLibraries      = new LazyLibraryList <IMusicLibrary>(CreateList(MusicLibrariesLoaded), ProviderType.Music);
                TVShowLibraries     = new LazyLibraryList <ITVShowLibrary>(CreateList(TVShowLibrariesLoaded), ProviderType.TVShow);
                PictureLibraries    = new LazyLibraryList <IPictureLibrary>(CreateList(PictureLibrariesLoaded), ProviderType.Picture);
                FileSystemLibraries = new LazyLibraryList <IFileSystemLibrary>(CreateList(FileSystemLibrariesLoaded), ProviderType.Filesystem);
                PlaylistLibraries   = new LazyLibraryList <IPlaylistLibrary>(CreateList(PlaylistLibrariesLoaded), ProviderType.Playlist);
            }
            catch (Exception ex)
            {
                Log.Error("Failed to load MAS backends", ex);
            }
        }
コード例 #4
0
        internal ProviderHandler()
        {
            if (!Compose())
            {
                return;
            }

            try
            {
                MovieLibraries      = new LazyLibraryList <IMovieLibrary>(FilterDisabled(MovieLibrariesLoaded).ToDictionary(x => (int)x.Metadata["Id"], x => x), ProviderType.Movie);
                MusicLibraries      = new LazyLibraryList <IMusicLibrary>(FilterDisabled(MusicLibrariesLoaded).ToDictionary(x => (int)x.Metadata["Id"], x => x), ProviderType.Music);
                TVShowLibraries     = new LazyLibraryList <ITVShowLibrary>(FilterDisabled(TVShowLibrariesLoaded).ToDictionary(x => (int)x.Metadata["Id"], x => x), ProviderType.TVShow);
                PictureLibraries    = new LazyLibraryList <IPictureLibrary>(FilterDisabled(PictureLibrariesLoaded).ToDictionary(x => (int)x.Metadata["Id"], x => x), ProviderType.Picture);
                FileSystemLibraries = new LazyLibraryList <IFileSystemLibrary>(FilterDisabled(FileSystemLibrariesLoaded).ToDictionary(x => (int)x.Metadata["Id"], x => x), ProviderType.Filesystem);
            }
            catch (Exception ex)
            {
                Log.Error("Failed to load MAS backends", ex);
            }

            Instance = this;
        }