public LibraryOptions()
 {
     EnablePhotos            = true;
     EnableRealtimeMonitor   = true;
     PathInfos               = new MediaPathInfo[] { };
     EnableInternetProviders = true;
 }
Пример #2
0
 public LibraryOptions()
 {
     EnablePhotos = true;
     EnableRealtimeMonitor = true;
     PathInfos = new MediaPathInfo[] { };
     EnableInternetProviders = true;
 }
Пример #3
0
 public LibraryOptions()
 {
     EnablePhotos                  = true;
     EnableRealtimeMonitor         = true;
     PathInfos                     = new MediaPathInfo[] { };
     EnableInternetProviders       = true;
     EnableAutomaticSeriesGrouping = true;
     SeasonZeroDisplayName         = "Specials";
 }
Пример #4
0
        /// <summary>
        /// Posts the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        public void Post(AddMediaPath request)
        {
            if (string.IsNullOrWhiteSpace(request.Name))
            {
                throw new ArgumentNullException(nameof(request));
            }

            _libraryMonitor.Stop();

            try
            {
                var mediaPath = request.PathInfo;

                if (mediaPath == null)
                {
                    mediaPath = new MediaPathInfo
                    {
                        Path = request.Path
                    };
                }
                _libraryManager.AddMediaPath(request.Name, mediaPath);
            }
            finally
            {
                Task.Run(() =>
                {
                    // No need to start if scanning the library because it will handle it
                    if (request.RefreshLibrary)
                    {
                        _libraryManager.ValidateMediaLibrary(new SimpleProgress <double>(), CancellationToken.None);
                    }
                    else
                    {
                        // Need to add a delay here or directory watchers may still pick up the changes
                        var task = Task.Delay(1000);
                        // Have to block here to allow exceptions to bubble
                        Task.WaitAll(task);

                        _libraryMonitor.Start();
                    }
                });
            }
        }
Пример #5
0
 public void AddMediaPath(long virtualFolderId, MediaPathInfo path)
 {
     throw new NotImplementedException();
 }