public override bool Process(MediaItem mediaItem, out ContentDirectoryMessaging.MediaItemChangeType changeType)
        {
            changeType = ContentDirectoryMessaging.MediaItemChangeType.None;
            IContentDirectory cd = ServiceRegistration.Get <IServerConnectionManager>().ContentDirectory;

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

            var rl = mediaItem.GetResourceLocator();

            Guid parentDirectoryId;

            if (!MediaItemAspect.TryGetAttribute(mediaItem.Aspects, ProviderResourceAspect.ATTR_PARENT_DIRECTORY_ID, out parentDirectoryId))
            {
                return(false);
            }

            MediaItemAspect.SetAttribute(mediaItem.Aspects, MediaAspect.ATTR_PLAYCOUNT, GetNewPlayCount());

            cd.AddOrUpdateMediaItem(parentDirectoryId, rl.NativeSystemId, rl.NativeResourcePath, mediaItem.Aspects.Values);

            changeType = ContentDirectoryMessaging.MediaItemChangeType.Updated;
            return(true);
        }
 public Guid UpdateMediaItem(Guid parentDirectoryId, ResourcePath path, IEnumerable <MediaItemAspect> updatedAspects)
 {
     try
     {
         return(_contentDirectory.AddOrUpdateMediaItem(parentDirectoryId, _localSystemId, path, updatedAspects));
     }
     catch (Exception)
     {
         throw new DisconnectedException();
     }
 }