public SaveFaceDataAsync(IMediaStore mediaStore)
 {
     _mediaStore = mediaStore;
 }
        public static async Task OnMediaAddedAsync(this IEnumerable <IMediaEventHandler> handlers, IMediaStore store,
                                                   MediaEntry entry, CancellationToken cancellationToken = default)
        {
            var pending = TaskPool.Get();

            try
            {
                foreach (var handler in handlers)
                {
                    var task = handler.OnMediaAddedAsync(store, entry, cancellationToken);
                    if (!task.IsReal())
                    {
                        continue;
                    }

                    if (task.IsCompleted || task.IsCanceled || task.IsFaulted)
                    {
                        continue;
                    }

                    pending.Add(task);
                }

                if (pending.Count > 0)
                {
                    await Task.WhenAll(pending);
                }
            }
            finally
            {
                TaskPool.Return(pending);
            }
        }
 public FolderTreeService(IMediaStore mediaStore)
 {
     _mediaStore = mediaStore;
 }
Beispiel #4
0
 public MediaSearchService(IMediaStore mediaStore, IAlbumService albumService)
 {
     _mediaStore   = mediaStore;
     _albumService = albumService;
 }
Beispiel #5
0
 public FaceQueries(IMediaStore mediaStore, IFaceService faceService)
 {
     _mediaStore  = mediaStore;
     _faceService = faceService;
 }
Beispiel #6
0
 public SearchFacetService(IMediaStore mediaStore)
 {
     _mediaStore = mediaStore;
 }
 // ReSharper disable once SuggestBaseTypeForParameter (controllers are scoped)
 public MediaController(IMediaStore store, IOptionsSnapshot <WebServerOptions> options)
 {
     _store = store;
     _store.Init(Path.Combine(Constants.DefaultRootPath, $"{options.Value.PublicKeyString}_media.egg"));
 }
Beispiel #8
0
 public MediaOperationsService(IBus bus, IMediaStore mediaStore)
 {
     _bus        = bus;
     _mediaStore = mediaStore;
 }
 public AgeOperationsService(
     IMediaStore mediaStore)
 {
     _mediaStore = mediaStore;
 }
 public abstract Task OnMediaAddedAsync(IMediaStore store, MediaEntry entry,
                                        CancellationToken cancellationToken = default);
 public TraceFunctions(TraceService traceService, IMediaStore mediaStore, IImageService imageService)
 {
     _imageService = imageService;
     _traceService = traceService;
     _mediaStore   = mediaStore;
 }
Beispiel #12
0
 public GetBackgroundsQueryHandler(IUnsplashClient client, IMediaStore mediaStore)
 {
     _client     = client;
     _mediaStore = mediaStore;
 }