public bool TryGetFanArt(FanArtConstants.FanArtMediaType mediaType, FanArtConstants.FanArtType fanArtType, string name, int maxWidth, int maxHeight, bool singleRandom, out IList <FanArtImage> result)
        {
            result = null;
            if (mediaType != FanArtConstants.FanArtMediaType.Album || fanArtType != FanArtConstants.FanArtType.Poster || string.IsNullOrEmpty(name))
            {
                return(false);
            }

            IMediaLibrary mediaLibrary = ServiceRegistration.Get <IMediaLibrary>(false);

            if (mediaLibrary == null)
            {
                return(false);
            }

            IFilter        filter = new RelationalFilter(AudioAspect.ATTR_ALBUM, RelationalOperator.EQ, name);
            MediaItemQuery query  = new MediaItemQuery(NECESSARY_MIAS, filter);
            var            items  = mediaLibrary.Search(query, false);

            result = new List <FanArtImage>();
            foreach (var mediaItem in items)
            {
                byte[] textureData;
                if (!MediaItemAspect.TryGetAttribute(mediaItem.Aspects, ThumbnailLargeAspect.ATTR_THUMBNAIL, out textureData))
                {
                    continue;
                }

                // Only one record required
                result.Add(new FanArtImage(name, textureData));
                return(true);
            }
            return(true);
        }
Beispiel #2
0
        protected void ImportRecording(string fileName)
        {
            ISystemResolver systemResolver = ServiceRegistration.Get <ISystemResolver>();
            IMediaLibrary   mediaLibrary   = ServiceRegistration.Get <IMediaLibrary>();

            List <Share> possibleShares = new List <Share>(); // Shares can point to different depth, we try to find the deepest one

            foreach (var share in mediaLibrary.GetShares(systemResolver.LocalSystemId).Values)
            {
                var dir = LocalFsResourceProviderBase.ToDosPath(share.BaseResourcePath.LastPathSegment.Path);
                if (dir != null && fileName.StartsWith(dir, StringComparison.InvariantCultureIgnoreCase))
                {
                    possibleShares.Add(share);
                }
            }
            if (possibleShares.Count == 0)
            {
                ServiceRegistration.Get <ILogger>().Warn("SlimTvService: Received notifaction of new recording but could not find a media source. Have you added recordings folder as media source? File: {0}", fileName);
                return;
            }

            Share           usedShare      = possibleShares.OrderByDescending(s => s.BaseResourcePath.LastPathSegment.Path.Length).First();
            IImporterWorker importerWorker = ServiceRegistration.Get <IImporterWorker>();

            importerWorker.ScheduleImport(LocalFsResourceProviderBase.ToResourcePath(fileName), usedShare.MediaCategories, false);
        }
        protected bool TryGetMediaItem(string name, out MediaItem mediaItem)
        {
            mediaItem = null;
            Guid mediaItemId;

            if (!Guid.TryParse(name, out mediaItemId) || mediaItemId == Guid.Empty)
            {
                return(false);
            }
            IMediaLibrary mediaLibrary = ServiceRegistration.Get <IMediaLibrary>(false);

            if (mediaLibrary == null)
            {
                return(false);
            }
            IFilter           filter = new MediaItemIdFilter(mediaItemId);
            IList <MediaItem> items  = mediaLibrary.Search(new MediaItemQuery(NECESSARY_MIAS, filter), false, null, true);

            if (items == null || items.Count == 0)
            {
                return(false);
            }
            mediaItem = items.First();
            return(true);
        }
Beispiel #4
0
 /// <summary>
 /// Deletes the specified <see cref="IMediaLibrary"/> in the CMS System.
 /// </summary>
 /// <param name="library">The <see cref="IMediaLibrary"/> to set.</param>
 private void RemoveMediaLibrary(IMediaLibrary library)
 {
     if (this.ShouldProcess(library.LibraryName, "delete"))
     {
         this.MediaLibraryService.DeleteMediaLibrary(library);
     }
 }
        public override void Initialise(string sortCriteria, uint?offset = null, uint?count = null)
        {
            Logger.Debug("MediaServer initialise share containers");

            base.Initialise(sortCriteria, offset, count);
            IDictionary <Guid, Share> shares = GetShares();

            IMediaLibrary  library = ServiceRegistration.Get <IMediaLibrary>();
            BasicContainer parent  = new BasicContainer(Id, Client);
            var            items   = (from share in shares
                                      select new
            {
                Item = library.LoadItem(share.Value.SystemId,
                                        share.Value.BaseResourcePath,
                                        NECESSARY_SHARE_MIA_TYPE_IDS,
                                        OPTIONAL_SHARE_MIA_TYPE_IDS),
                ShareName = share.Value.Name
            }).ToList();

            foreach (var item in items.OrderBy(s => s.ShareName))
            {
                try
                {
                    if (item.Item != null)
                    {
                        Add((BasicObject)MediaLibraryHelper.InstansiateMediaLibraryObject(item.Item, parent, item.ShareName));
                    }
                }
                catch (Exception ex)
                {
                    Logger.Error("Media item '{0}' could not be added", ex, item.Item);
                }
            }
        }
        public override void Initialise(string sortCriteria, uint?offset = null, uint?count = null)
        {
            base.Initialise(sortCriteria, offset, count);

            IMediaLibrary    library       = ServiceRegistration.Get <IMediaLibrary>();
            var              allowedShares = GetAllowedShares();
            List <MediaItem> shares        = new List <MediaItem>();

            foreach (var share in allowedShares)
            {
                if (share.MediaCategories.Any(x => x.Contains("Image")))
                {
                    MediaItem item = library.LoadItem(share.SystemId, share.BaseResourcePath, NECESSARY_SHARE_MIA_TYPE_IDS, OPTIONAL_SHARE_MIA_TYPE_IDS, UserId);
                    if (item != null && item.Aspects.ContainsKey(DirectoryAspect.ASPECT_ID))
                    {
                        shares.Add(item);
                    }
                }
            }

            foreach (MediaItem share in shares.OrderBy(s => MediaItemAspect.TryGetAspect(s.Aspects, MediaAspect.Metadata, out var aspect) ? aspect.GetAttributeValue <string>(MediaAspect.ATTR_SORT_TITLE) : ""))
            {
                IList <MediaItem> albums = library.Browse(share.MediaItemId, NECESSARY_SHARE_MIA_TYPE_IDS, OPTIONAL_SHARE_MIA_TYPE_IDS, UserId, false);
                foreach (MediaItem album in albums)
                {
                    if (album != null && album.Aspects.ContainsKey(DirectoryAspect.ASPECT_ID))
                    {
                        Add(new MediaLibraryBrowser(album, Client));
                    }
                }
            }
        }
Beispiel #7
0
        public void DetachClientAndRemoveShares(string clientSystemId)
        {
            ISQLDatabase database    = ServiceRegistration.Get <ISQLDatabase>();
            ITransaction transaction = database.BeginTransaction();

            try
            {
                using (IDbCommand command = ClientManager_SubSchema.DeleteAttachedClientCommand(transaction, clientSystemId))
                    command.ExecuteNonQuery();

                IMediaLibrary mediaLibrary = ServiceRegistration.Get <IMediaLibrary>();
                mediaLibrary.DeleteMediaItemOrPath(clientSystemId, null, true);
                mediaLibrary.RemoveSharesOfSystem(clientSystemId);

                transaction.Commit();
            }
            catch (Exception e)
            {
                ServiceRegistration.Get <ILogger>().Error("ClientManager: Error detaching client '{0}'", e, clientSystemId);
                transaction.Rollback();
                throw;
            }
            ServiceRegistration.Get <ILogger>().Info("ClientManager: Client with system ID '{0}' detached", clientSystemId);
            // Last action: Remove the client from the collection of attached clients and disconnect the client connection, if connected
            _attachedClients = ReadAttachedClientsFromDB();
            _controlPoint.RemoveAttachedClient(clientSystemId);
            ClientManagerMessaging.SendClientAttachmentChangeMessage(ClientManagerMessaging.MessageType.ClientDetached, clientSystemId);
        }
        /// <summary>
        /// Checks whether the <paramref name="action"/> has any aspects and if not
        /// tries to restore them from the media library.
        /// </summary>
        /// <param name="action">The action to check.</param>
        /// <returns>True if the aspects were present or successfully restored.</returns>
        protected async Task <bool> TryRestoreAspects(FanArtManagerAction action)
        {
            //Already has aspects, nothing to do
            if (action.Aspects != null)
            {
                return(true);
            }

            //No aspects, this resource was restored from disk, try and restore the aspects from the media library.
            //Throttle the number of concurrent queries To avoid a spike during startup.
            await _loadItemThrottle.WaitAsync(_cts.Token);

            try
            {
                IMediaLibrary  mediaLibrary = ServiceRegistration.Get <IMediaLibrary>();
                MediaItemQuery query        = new MediaItemQuery(null,
                                                                 mediaLibrary.GetManagedMediaItemAspectMetadata().Keys,
                                                                 new MediaItemIdFilter(action.MediaItemId));
                var items = mediaLibrary.Search(query, false, null, true);
                if (items != null && items.Count > 0)
                {
                    action.Aspects = items[0].Aspects;
                    return(true);
                }
                ServiceRegistration.Get <ILogger>().Warn("FanArtActionBlock: Unable to restore FanArtAction, media item with id {0} was not found in the media library", action.MediaItemId);
                return(false);
            }
            finally
            {
                _loadItemThrottle.Release();
            }
        }
Beispiel #9
0
        public Task RegisterLocallyKnownMediaItemAspectTypeAsync(MediaItemAspectMetadata miam)
        {
            IMediaLibrary mediaLibrary = ServiceRegistration.Get <IMediaLibrary>();

            mediaLibrary.AddMediaItemAspectStorage(miam);
            return(Task.CompletedTask);
        }
        public bool TryGetFanArt(string mediaType, string fanArtType, string name, int maxWidth, int maxHeight, bool singleRandom, out IList <FanArtImage> result)
        {
            result = null;
            Guid mediaItemId;

            var isImage = mediaType == FanArtMediaTypes.Image;

            if (!Guid.TryParse(name, out mediaItemId) ||
                mediaType != FanArtMediaTypes.Undefined && !isImage ||
                fanArtType != FanArtTypes.Thumbnail)
            {
                return(false);
            }

            IMediaLibrary mediaLibrary = ServiceRegistration.Get <IMediaLibrary>(false);

            if (mediaLibrary == null)
            {
                return(false);
            }

            // Try to load thumbnail from ML
            List <Guid> thumbGuids = new List <Guid> {
                ThumbnailLargeAspect.ASPECT_ID
            };

            // Check for Image's rotation info
            if (isImage)
            {
                thumbGuids.Add(ImageAspect.ASPECT_ID);
            }

            IFilter           filter = new MediaItemIdFilter(mediaItemId);
            IList <MediaItem> items  = mediaLibrary.Search(new MediaItemQuery(thumbGuids, filter), false, null, true);

            if (items == null || items.Count == 0)
            {
                return(false);
            }

            MediaItem mediaItem = items.First();

            byte[] textureData;
            if (!MediaItemAspect.TryGetAttribute(mediaItem.Aspects, ThumbnailLargeAspect.ATTR_THUMBNAIL, out textureData))
            {
                return(false);
            }

            if (isImage)
            {
                textureData = AutoRotateThumb(mediaItem, textureData);
            }

            // Only one record required
            result = new List <FanArtImage> {
                new FanArtImage(name, textureData)
            };
            return(true);
        }
 public void VerifyCreate(IMediaLibrary expectedLibrary)
 {
     this.libraryMock.LibraryDisplayName.Should().Be(expectedLibrary.LibraryDisplayName);
     this.libraryMock.LibraryName.Should().Be(expectedLibrary.LibraryName);
     this.libraryMock.LibrarySiteID.Should().Be(expectedLibrary.LibrarySiteID);
     this.libraryMock.LibraryDescription.Should().Be(expectedLibrary.LibraryDescription);
     this.libraryMock.LibraryFolder.Should().Be(expectedLibrary.LibraryFolder);
 }
 public AddMovieViewModel(IMediaLibrary library, IEventAggregator eventAggregator)
 {
     Add = new DelegateCommand(() => AddMovie(library, eventAggregator));
     Delete = new DelegateCommand(() => DeleteMovie(library, eventAggregator));
     DeleteDialog = new DelegateCommand(DeleteDialogBox);
     CancelDelete = new DelegateCommand(CancelDeleteDialog);
     DeleteDialogOpen = false;
 }
Beispiel #13
0
        /// <inheritdoc/>
        protected override void ActOnObject(IMediaLibrary library)
        {
            if (this.MediaLibrary != null)
            {
                library = this.MediaLibrary.ActLike <IMediaLibrary>();
            }

            this.RemoveBusinessLayer.Remove(library);
        }
        /// <inheritdoc/>
        protected override void ActOnObject(IMediaLibrary library)
        {
            if (this.MediaLibrary != null)
            {
                library = this.MediaLibrary.ActLike <IMediaLibrary>();
            }

            this.SetOptionBusinessLayer.SetMediaLibrarySecurityOption(library, this.SecurityProperty, this.SecurityAccess);
        }
Beispiel #15
0
        public static MediaItem GetMediaItem(this IMediaLibrary mediaLibrary, Guid mediaItemId, IEnumerable <Guid> necessaryMIATypes, IEnumerable <Guid> optionalMIATypes)
        {
            var items = mediaLibrary.LoadCustomPlaylist(new List <Guid>()
            {
                mediaItemId
            }, necessaryMIATypes, optionalMIATypes);

            return(items.Count > 0 ? items[0] : null);
        }
        public void SetMediaLibrarySecurityOption(IMediaLibrary library, SecurityPropertyEnum option, SecurityAccessEnum securityAccess)
        {
            MediaLibraryMock mock = (MediaLibraryMock)library;

            // Get security property name from enum
            string propName = Enum.GetName(typeof(SecurityPropertyEnum), option);

            // Set security property value using reflection
            mock.GetType().GetProperty(propName).SetValue(library, securityAccess);
        }
Beispiel #17
0
        /// <inheritdoc/>
        public void DeleteMediaLibrary(IMediaLibrary library)
        {
            // Gets the media library
            var deleteLibrary = GetMediaLibrary(library);

            if (deleteLibrary != null)
            {
                // Deletes the media library
                MediaLibraryInfoProvider.DeleteMediaLibraryInfo(deleteLibrary);
            }
        }
        /// <summary>
        /// Adds a movie and raises an event
        /// </summary>
        /// <param name="library"></param>
        /// <param name="eventAggregator"></param>
        private void AddMovie(IMediaLibrary library, IEventAggregator eventAggregator)
        {
            var movie = new Movie
            {
                Title       = this.Title,
                ReleaseDate = DateTime.Now
            };

            library.Add(movie);

            eventAggregator.Raise <IMovieAdded>(evt => evt.Movie = movie);
        }
Beispiel #19
0
        public HomogenousMap GetItems(string sortCriteria)
        {
            List <Guid> necessaryMias = new List <Guid>(_necessaryMiaTypeIds);

            if (necessaryMias.Contains(MediaAspect.ASPECT_ID))
            {
                necessaryMias.Remove(MediaAspect.ASPECT_ID);                                          //Group MIA cannot be present
            }
            IMediaLibrary library = ServiceRegistration.Get <IMediaLibrary>();

            return(library.GetValueGroups(MediaAspect.ATTR_RECORDINGTIME, null, ProjectionFunction.DateToYear, necessaryMias, null, true, false));
        }
        private void AddMovie(IMediaLibrary library, IEventAggregator eventAggregator)
        {
            var movie = new Movie
                            {
                                Title = this.Title,
                                ReleaseDate = DateTime.Now
                            };

            library.Add(movie);

            eventAggregator.Raise<IMovieAdded>(evt => evt.Movie = movie);
        }
        public HomogenousMap GetItems(string sortCriteria)
        {
            List <Guid> necessaryMias = new List <Guid>(_necessaryMIAs);

            if (necessaryMias.Contains(GenreAspect.ASPECT_ID))
            {
                necessaryMias.Remove(GenreAspect.ASPECT_ID);                                          //Group MIA cannot be present
            }
            IMediaLibrary library = ServiceRegistration.Get <IMediaLibrary>();

            return(library.GetValueGroups(GenreAspect.ATTR_GENRE, null, ProjectionFunction.None, necessaryMias, AppendUserFilter(null, necessaryMias), true, false));
        }
Beispiel #22
0
        /// <summary>
        /// Checks whether the <paramref name="actions"/> has any aspects and if not
        /// tries to load them from the media library.
        /// </summary>
        /// <param name="actions">The action to check.</param>
        /// <returns>True if the aspects were present or successfully loaded.</returns>
        protected async Task LoadAspects(FanArtManagerAction[] actions)
        {
            var mediaItemIds = actions.Where(a => a.Type == ActionType.Collect && (a.Aspects == null || a.Aspects.Count == 0))
                               .Select(a => a.MediaItemId).Distinct();

            var queryFilter = new MediaItemIdFilter(mediaItemIds);

            if (queryFilter.MediaItemIds.Count == 0)
            {
                return;
            }

            IMediaLibrary mediaLibrary = ServiceRegistration.Get <IMediaLibrary>();

            MediaItemQuery query = new MediaItemQuery(null,
                                                      mediaLibrary.GetManagedMediaItemAspectMetadata().Keys,
                                                      queryFilter);

            // Throttle the number of concurrent queries To avoid spikes when loading aspects.
            await _loadItemThrottle.WaitAsync(_cts.Token);

            try
            {
                var items = mediaLibrary.Search(query, false, null, true);
                if (items != null && items.Count > 0)
                {
                    foreach (var item in items)
                    {
                        foreach (var action in actions)
                        {
                            if (action.MediaItemId == item.MediaItemId)
                            {
                                action.Aspects = item.Aspects;
                                break;
                            }
                        }
                    }
                }
                else
                {
                    ServiceRegistration.Get <ILogger>().Warn("FanArtActionBlock: Unable to load aspects, no matching media items were found in the media library");
                }
            }
            catch (Exception ex)
            {
                ServiceRegistration.Get <ILogger>().Error("FanArtActionBlock: Error loading aspects from the media library", ex);
            }
            finally
            {
                _loadItemThrottle.Release();
            }
        }
        private IList <MediaItem> GetItems(string sortCriteria)
        {
            IMediaLibrary  library = ServiceRegistration.Get <IMediaLibrary>();
            IFilter        filter  = new FilteredRelationshipFilter(_role, _linkedRole, AppendUserFilter(null, _necessaryMIAs));
            MediaItemQuery query   = new MediaItemQuery(NECESSARY_PERSON_MIA_TYPE_IDS, filter)
            {
                SortInformation = new List <ISortInformation> {
                    new AttributeSortInformation(PersonAspect.ATTR_PERSON_NAME, SortDirection.Ascending)
                },
            };

            return(library.Search(query, true, UserId, false));
        }
        protected bool GetSharesForPath(ResourcePath resourcePath, string localSystemId, out List <Share> possibleShares)
        {
            IMediaLibrary mediaLibrary = ServiceRegistration.Get <IMediaLibrary>();

            possibleShares = new List <Share>();
            foreach (var share in mediaLibrary.GetShares(localSystemId).Values)
            {
                if (resourcePath.ToString().StartsWith(share.BaseResourcePath.ToString(), StringComparison.InvariantCultureIgnoreCase))
                {
                    possibleShares.Add(share);
                }
            }
            return(possibleShares.Count > 0);
        }
        public IMediaLibrary CreateMediaLibrary(IMediaLibrary library)
        {
            this.libraryMock = library;

            var testServer = new Mock <IMediaLibrary>();

            testServer.SetupGet(x => x.LibraryDisplayName).Returns(library.LibraryDisplayName);
            testServer.SetupGet(x => x.LibraryName).Returns(library.LibraryName);
            testServer.SetupGet(x => x.LibrarySiteID).Returns(library.LibrarySiteID);
            testServer.SetupGet(x => x.LibraryDescription).Returns(library.LibraryDescription);
            testServer.SetupGet(x => x.LibraryFolder).Returns(library.LibraryFolder);

            return(testServer.Object);
        }
        protected SpecialPlaylistBase(IMediaLibrary library, PlaylistType type, string name)
        {
            if (library == null)
                throw new ArgumentNullException("library");
            if (type == PlaylistType.None)
                throw new ArgumentException("type");
            if (string.IsNullOrEmpty(name))
                name = type.ToString();

            m_library = library;
            m_type = type;
            m_id = library.Id + (byte)type;
            m_name = name;
        }
        protected bool GetSharesForPath(string fileName, string localSystemId, out List <Share> possibleShares)
        {
            IMediaLibrary mediaLibrary = ServiceRegistration.Get <IMediaLibrary>();

            possibleShares = new List <Share>();
            foreach (var share in mediaLibrary.GetShares(localSystemId).Values)
            {
                var dir = LocalFsResourceProviderBase.ToDosPath(share.BaseResourcePath.LastPathSegment.Path);
                if (dir != null && fileName.StartsWith(dir, StringComparison.InvariantCultureIgnoreCase))
                {
                    possibleShares.Add(share);
                }
            }
            return(possibleShares.Count > 0);
        }
Beispiel #28
0
        /// <inheritdoc/>
        public IMediaFile GetMediaFile(IMediaLibrary library, string folder, string fileName)
        {
            MediaFileInfo mediaFile = null;

            // Gets the media library
            var existingLibrary = GetMediaLibrary(library);

            if (existingLibrary != null)
            {
                // Gets the media file
                mediaFile = MediaFileInfoProvider.GetMediaFileInfo(existingLibrary.LibraryID, $"{folder}/{fileName}");
            }

            return(mediaFile.ActLike <IMediaFile>());
        }
        private IDictionary <Guid, Share> GetShares()
        {
            var allowedShares = GetAllowedShares();
            IDictionary <Guid, Share> shares = new Dictionary <Guid, Share>();

            IMediaLibrary library = ServiceRegistration.Get <IMediaLibrary>();

            foreach (var share in GetAllowedShares())
            {
                if (CategoryFilter == null || CategoryFilter.Count == 0 || share.MediaCategories.Any(x => CategoryFilter.Contains(x)))
                {
                    shares.Add(share.ShareId, share);
                }
            }
            return(shares);
        }
Beispiel #30
0
        public ICollection <string> GetMediaCategories(ResourcePath path)
        {
            ISystemResolver systemResolver = ServiceRegistration.Get <ISystemResolver>();
            IMediaLibrary   mediaLibrary   = ServiceRegistration.Get <IMediaLibrary>();

            ICollection <Share> shares = mediaLibrary.GetShares(systemResolver.LocalSystemId).Values;
            Share bestShare            = SharesHelper.BestContainingPath(shares, path);

            List <string> categories = new List <string>();

            if (bestShare != null)
            {
                categories.AddRange(bestShare.MediaCategories);
            }
            return(categories);
        }
Beispiel #31
0
        /// <inheritdoc/>
        public void SetMediaLibrarySecurityOption(IMediaLibrary library, SecurityPropertyEnum option, SecurityAccessEnum securityAccess)
        {
            // Gets the media library
            var existingLibrary = GetMediaLibrary(library);

            if (existingLibrary != null)
            {
                // Get security property name from enum
                string propName = Enum.GetName(typeof(SecurityPropertyEnum), option);

                // Set security property value using reflection
                existingLibrary.GetType().GetProperty(propName).SetValue(existingLibrary, securityAccess);

                // Saves the updated media library to the database
                MediaLibraryInfoProvider.SetMediaLibraryInfo(existingLibrary);
            }
        }
        protected ICollection <Share> GetAllowedShares()
        {
            IMediaLibrary       library = ServiceRegistration.Get <IMediaLibrary>();
            ICollection <Share> shares  = library.GetShares(null)?.Values;

            IUserProfileDataManagement userProfileDataManagement = ServiceRegistration.Get <IUserProfileDataManagement>();
            var res = userProfileDataManagement.GetProfileAsync(UserId).Result;

            if (!res.Success || !res.Result.RestrictShares)
            {
                return(shares);
            }

            var allowedShareIds = res.Result.GetAllowedShares();

            return(shares.Where(s => allowedShareIds.Contains(s.ShareId)).ToList());
        }
Beispiel #33
0
        /// <inheritdoc/>
        public IMediaLibrary CreateMediaLibrary(IMediaLibrary library)
        {
            // Creates a new media library object
            MediaLibraryInfo newLibrary = new MediaLibraryInfo
            {
                // Sets the library properties
                LibraryDisplayName = library.LibraryDisplayName,
                LibraryName        = library.LibraryName,
                LibraryDescription = library.LibraryDescription,
                LibraryFolder      = library.LibraryFolder,
                LibrarySiteID      = library.LibrarySiteID,
            };

            // Saves the new media library to the database
            MediaLibraryInfoProvider.SetMediaLibraryInfo(newLibrary);

            return(newLibrary.ActLike <IMediaLibrary>());
        }
 /// <summary>
 /// Initializes the controller
 /// </summary>
 /// <param name="library">Library to use</param>
 public MoviesController(IMediaLibrary library)
 {
     _library = library;
 }
 public AddMovieViewModel(IMediaLibrary library, IEventAggregator eventAggregator)
 {
     this.Add = new DelegateCommand(() => AddMovie(library, eventAggregator));
 }
 private void DeleteMovie(IMediaLibrary library, IEventAggregator eventAggregator)
 {
     eventAggregator.Raise<ISelectedMovieDeleted>(e => {});
     DeleteDialogOpen = false;
     OnPropertyChanged("DeleteDialogOpen");
 }
 public MusicPlaylist(IMediaLibrary library, string name)
     : base(library, PlaylistType.Music, name)
 {
 }
 public MoviesPlaylist(IMediaLibrary library, string name)
     : base(library, PlaylistType.Movies, name)
 {
 }
Beispiel #39
0
 internal MediaSource(IMediaLibrary backend)
 {
     library = backend;
     library.mediasource = this;
 }
Beispiel #40
0
 /// <summary>
 /// Initializes the controller
 /// </summary>
 /// <param name="library">Library to use</param>
 /// <param name="factory">Factory to create movies</param>
 public MoviesController(IMediaLibrary library, IMovieFactory factory)
 {
     _library = library;
     _factory = factory;
 }