Esempio n. 1
0
        public void ClearLibrary([FromQuery] Guid?collectionId, [FromQuery] bool areYouSure)
        {
            var cancellationToken = new CancellationTokenSource();

            if (areYouSure)
            {
                MediaLibrary.ClearLibraryAsync(Guid.Empty, collectionId, cancellationToken.Token);
            }
        }
Esempio n. 2
0
        public void ScanLibrary([FromQuery] Guid?collectionId, [FromQuery] bool clearLibrary = false)
        {
            var cancellationToken = new CancellationTokenSource();

            if (clearLibrary)
            {
                MediaLibrary.ClearLibraryAsync(Guid.Empty, collectionId, cancellationToken.Token).ConfigureAwait(false);
            }

            MediaLibrary.ScanLibrary(Guid.Empty, collectionId, clearLibrary, cancellationToken.Token);
        }