File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ using System . Reflection ;
2+ using jcdcdev . Umbraco . Core . Extensions ;
3+ using Umbraco . Cms . Core . Manifest ;
4+ using Umbraco . Cms . Infrastructure . Manifest ;
5+
6+ namespace Umbraco . Community . FileSystemProviders . B2 . Composing ;
7+
8+ public class PackageManifestReader : IPackageManifestReader
9+ {
10+ public Task < IEnumerable < PackageManifest > > ReadPackageManifestsAsync ( )
11+ {
12+ var packageManifest = new PackageManifest
13+ {
14+ Name = Constants . PackageName ,
15+ Version = Assembly . GetAssembly ( typeof ( PackageManifestReader ) ) ? . GetName ( ) . Version ? . ToSemVer ( ) ? . ToString ( ) ?? "0.1.0" ,
16+ AllowPublicAccess = false ,
17+ AllowTelemetry = true ,
18+ Extensions = [ ]
19+ } ;
20+
21+ return Task . FromResult < IEnumerable < PackageManifest > > ( [ packageManifest ] ) ;
22+ }
23+ }
Original file line number Diff line number Diff line change 1616using Umbraco . Cms . Core . Configuration . Models ;
1717using Umbraco . Cms . Core . DependencyInjection ;
1818using Umbraco . Cms . Infrastructure . DependencyInjection ;
19+ using Umbraco . Cms . Infrastructure . Manifest ;
1920using Umbraco . Cms . Web . Common . ApplicationBuilder ;
2021using Umbraco . Community . FileSystemProviders . B2 . HealthChecks ;
2122using Umbraco . Community . FileSystemProviders . B2 . Models ;
@@ -88,6 +89,8 @@ public static void AddB2MediaFileSystem(this IUmbracoBuilder builder)
8889 {
8990 PrePipeline = app => app . UseB2MediaFileSystem ( )
9091 } ) ) ;
92+
93+ builder . Services . AddSingleton < IPackageManifestReader , PackageManifestReader > ( ) ;
9194 }
9295
9396 private static AmazonS3Client CreateS3Client ( IServiceProvider x )
You can’t perform that action at this time.
0 commit comments