Esempio n. 1
0
        private async Task UpdateItem(UpdateItem request)
        {
            var item = _libraryManager.GetItemById(request.ItemId);

            var newLockData = request.LockData ?? false;
            var isLockedChanged = item.IsLocked != newLockData;

            UpdateItem(request, item);

            if (isLockedChanged && item.IsLocked)
            {
                item.IsUnidentified = false;
            }

            await item.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);

            if (isLockedChanged && item.IsFolder)
            {
                var folder = (Folder)item;

                foreach (var child in folder.RecursiveChildren.ToList())
                {
                    child.IsLocked = newLockData;
                    await child.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
                }
            }
        }
Esempio n. 2
0
        private Task UpdateItem(UpdateItem request)
        {
            var item = DtoBuilder.GetItemByClientId(request.ItemId, _userManager, _libraryManager);

            UpdateItem(request, item);

            return _libraryManager.UpdateItem(item, ItemUpdateType.MetadataEdit, CancellationToken.None);
        }
        public void Post(UpdateItem request)
        {
            var task = UpdateItem(request);

            Task.WaitAll(task);
        }
Esempio n. 4
0
        private async Task UpdateItem(UpdateItem request)
        {
            var item = _dtoService.GetItemByDtoId(request.ItemId);

            var newEnableInternetProviders = request.EnableInternetProviders ?? true;
            var dontFetchMetaChanged = item.DontFetchMeta != !newEnableInternetProviders;

            UpdateItem(request, item);

            await _libraryManager.UpdateItem(item, ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);

            if (dontFetchMetaChanged && item.IsFolder)
            {
                var folder = (Folder)item;

                foreach (var child in folder.RecursiveChildren.ToList())
                {
                    child.DontFetchMeta = !newEnableInternetProviders;
                    await _libraryManager.UpdateItem(child, ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
                }
            }
        }
        private Task UpdateItem(UpdateItem request)
        {
            var item = _dtoService.GetItemByDtoId(request.ItemId);

            UpdateItem(request, item);

            return _libraryManager.UpdateItem(item, ItemUpdateType.MetadataEdit, CancellationToken.None);
        }
Esempio n. 6
0
        private async Task UpdateItem(UpdateItem request)
        {
            var item = _dtoService.GetItemByDtoId(request.ItemId);

            var newLockData = request.LockData ?? false;
            var dontFetchMetaChanged = item.IsLocked != newLockData;

            UpdateItem(request, item);

            await item.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);

            if (dontFetchMetaChanged && item.IsFolder)
            {
                var folder = (Folder)item;

                foreach (var child in folder.RecursiveChildren.ToList())
                {
                    child.DontFetchMeta = newLockData;
                    await child.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
                }
            }
        }
Esempio n. 7
0
        public void Post(UpdateItem request)
        {
            var task = UpdateItem(request);

            Task.WaitAll(task);
        }