Пример #1
0
        /// <summary>
        /// Create an new item in the database
        /// </summary>
        /// <param name="statusItem">contains the status</param>
        /// <param name="subPath">relative path</param>
        /// <returns>database item</returns>
        private async Task <FileIndexItem> NewItem(FileIndexItem statusItem, string subPath)
        {
            // Add a new Item
            var dbItem = await _newItem.NewFileItem(statusItem);

            // When not OK do not Add (fileHash issues)
            if (dbItem.Status != FileIndexItem.ExifStatus.Ok)
            {
                return(dbItem);
            }

            await _query.AddItemAsync(dbItem);

            await _query.AddParentItemsAsync(subPath);

            AddDeleteStatus(dbItem);
            return(dbItem);
        }