Пример #1
0
        /// <summary>
        /// Update item to database
        /// </summary>
        /// <param name="dbItem">item to update</param>
        /// <param name="size">byte size</param>
        /// <param name="subPath">relative path</param>
        /// <returns>same item</returns>
        private async Task <FileIndexItem> UpdateItem(FileIndexItem dbItem, long size, string subPath)
        {
            if (_appSettings.ApplicationType == AppSettings.StarskyAppType.WebController)
            {
                _logger.LogDebug($"[SyncSingleFile] Trigger Update Item {subPath}");
            }

            var updateItem = await _newItem.PrepareUpdateFileItem(dbItem, size);

            await _query.UpdateItemAsync(updateItem);

            await _query.AddParentItemsAsync(subPath);

            AddDeleteStatus(dbItem);
            return(updateItem);
        }