Beispiel #1
0
        /// <summary>
        /// Completely rebuilds the database with new image data loaded from the given directory
        /// A progress notifier can be supplied as this function my take a long time to execute
        /// </summary>
        /// <param name="dir">Directory to load images from</param>
        /// <param name="notifyProgress">Function that is periodically called to signify progress don by this method</param>
        /// <returns></returns>
        public async Task UpdatePictureDataFromDirectory(string dir, Func <float, Task> notifyProgress = null)
        {
            Logger.Log(LogLevel.Information, "Requested rebuilding of Image Database with directory [%s]", new { dir });
            var images = (await LoadImages(dir, notifyProgress)).ToList();

            Logger.Log(LogLevel.Information, "Found %s valid image entries in directory [%s]", new { images.Count, dir });
            await _picDb.RebuildPictureTable(images);
        }