public async Task RegisterLocallyKnownMediaItemAspectTypeAsync(MediaItemAspectMetadata miaType)
        {
            if (_locallyKnownMediaItemAspectTypes.ContainsKey(miaType.AspectId))
            {
                return;
            }
            _locallyKnownMediaItemAspectTypes.Add(miaType.AspectId, miaType);
            IServerConnectionManager serverConnectionManager = ServiceRegistration.Get <IServerConnectionManager>();
            IContentDirectory        cd = serverConnectionManager?.ContentDirectory;

            if (cd != null)
            {
                await cd.AddMediaItemAspectStorageAsync(miaType);
            }
        }
Example #2
0
        public Task RegisterLocallyKnownMediaItemAspectTypeAsync(MediaItemAspectMetadata miaType)
        {
            if (_locallyKnownMediaItemAspectTypes.ContainsKey(miaType.AspectId))
            {
                return(Task.CompletedTask);
            }
            _locallyKnownMediaItemAspectTypes.Add(miaType.AspectId, miaType);
            IServerConnectionManager serverConnectionManager = ServiceRegistration.Get <IServerConnectionManager>();
            IContentDirectory        cd = serverConnectionManager == null ? null :
                                          serverConnectionManager.ContentDirectory;

            if (cd != null)
            {
                cd.AddMediaItemAspectStorageAsync(miaType).Wait();
            }
            return(Task.CompletedTask);
        }