@@ -116,7 +116,6 @@ public static ModifiableProject FromHandlerConfig(NomadKuboEventStreamHandlerCon
116116 {
117117 Id = handlerConfig . RoamingKey . Id ,
118118 EventStreamHandlerId = handlerConfig . RoamingKey . Id ,
119- Inner = handlerConfig . RoamingValue ,
120119 InnerProject = readOnlyProject ,
121120 InnerEntity = modifiableEntity ,
122121 InnerAccentColor = modifiableAccentColor ,
@@ -158,7 +157,7 @@ public static ModifiableProject FromHandlerConfig(NomadKuboEventStreamHandlerCon
158157 /// <summary>
159158 /// The roaming project data that this handler modifies.
160159 /// </summary>
161- public required Project Inner { get ; init ; }
160+ public Project Inner => InnerProject . Inner ;
162161
163162 /// <inheritdoc/>
164163 public required IModifiableProjectCollection < IReadOnlyProject > Dependencies { get ; init ; }
@@ -175,7 +174,7 @@ public static ModifiableProject FromHandlerConfig(NomadKuboEventStreamHandlerCon
175174 public string Category => InnerProject . Category ;
176175
177176 /// <inheritdoc/>
178- public string Name => InnerProject . Category ;
177+ public string Name => InnerProject . Name ;
179178
180179 /// <inheritdoc/>
181180 public string Description => InnerProject . Description ;
@@ -201,10 +200,10 @@ public static ModifiableProject FromHandlerConfig(NomadKuboEventStreamHandlerCon
201200 /// <inheritdoc/>
202201 public string [ ] Features => InnerProject . Features ;
203202
204- /// <inheritdoc/>
203+ /// <inheritdoc cref="WindowsAppCommunity.Sdk.IReadOnlyProject.CategoryUpdated" />
205204 public event EventHandler < string > ? CategoryUpdated ;
206205
207- /// <inheritdoc/>
206+ /// <inheritdoc cref="WindowsAppCommunity.Sdk.IReadOnlyProject.PublisherUpdated" />
208207 public event EventHandler < IReadOnlyPublisher > ? PublisherUpdated ;
209208
210209 /// <inheritdoc/>
@@ -252,7 +251,7 @@ public static ModifiableProject FromHandlerConfig(NomadKuboEventStreamHandlerCon
252251 /// <inheritdoc/>
253252 public IAsyncEnumerable < IFile > GetImageFilesAsync ( CancellationToken cancellationToken ) => InnerEntity . GetImageFilesAsync ( cancellationToken ) ;
254253
255- /// <inheritdoc/>
254+ /// <inheritdoc cref="IReadOnlyProject{TDependencyCollection}.GetPublisherAsync" />
256255 public Task < IReadOnlyPublisher ? > GetPublisherAsync ( CancellationToken cancellationToken ) => InnerProject . GetPublisherAsync ( cancellationToken ) ;
257256
258257 /// <inheritdoc/>
@@ -267,15 +266,23 @@ public async Task UpdatePublisherAsync(IReadOnlyPublisher publisher, Cancellatio
267266 var updateEvent = new ValueUpdateEvent ( null , ( DagCid ) valueCid , false ) ;
268267
269268 var appendedEntry = await AppendNewEntryAsync ( targetId : EventStreamHandlerId , eventId : nameof ( UpdatePublisherAsync ) , updateEvent , DateTime . UtcNow , cancellationToken ) ;
270- await ApplyPublisherUpdateEntryUpdateAsync ( appendedEntry , updateEvent , publisher . Id , cancellationToken ) ;
269+ await ApplyPublisherUpdateEntryUpdateAsync ( appendedEntry , updateEvent , publisher . Id , publisher , cancellationToken ) ;
271270
272271 EventStreamPosition = appendedEntry ;
273272 }
274273
275274 /// <inheritdoc/>
276- public Task UpdateCategoryAsync ( string category , CancellationToken cancellationToken )
275+ public async Task UpdateCategoryAsync ( string category , CancellationToken cancellationToken )
277276 {
278- throw new NotImplementedException ( ) ;
277+ cancellationToken . ThrowIfCancellationRequested ( ) ;
278+
279+ var valueCid = await Client . Dag . PutAsync ( category , pin : KuboOptions . ShouldPin , cancel : cancellationToken ) ;
280+ var updateEvent = new ValueUpdateEvent ( null , ( DagCid ) valueCid , false ) ;
281+
282+ var appendedEntry = await AppendNewEntryAsync ( targetId : EventStreamHandlerId , eventId : nameof ( UpdateCategoryAsync ) , updateEvent , DateTime . UtcNow , cancellationToken ) ;
283+ await ApplyCategoryEntryUpdateAsync ( appendedEntry , updateEvent , category , cancellationToken ) ;
284+
285+ EventStreamPosition = appendedEntry ;
279286 }
280287
281288 /// <inheritdoc/>
@@ -415,7 +422,6 @@ public override async Task ApplyEntryUpdateAsync(EventStreamEntry<DagCid> stream
415422 ;
416423 }
417424
418- /// <inheritdoc />
419425 internal Task ApplyFeatureAddEntryUpdateAsync ( EventStreamEntry < DagCid > streamEntry , ValueUpdateEvent updateEvent , string addedFeature , CancellationToken cancellationToken )
420426 {
421427 cancellationToken . ThrowIfCancellationRequested ( ) ;
@@ -425,8 +431,7 @@ internal Task ApplyFeatureAddEntryUpdateAsync(EventStreamEntry<DagCid> streamEnt
425431 FeaturesAdded ? . Invoke ( this , [ addedFeature ] ) ;
426432 return Task . CompletedTask ;
427433 }
428-
429- /// <inheritdoc />
434+
430435 internal Task ApplyFeatureRemoveEntryUpdateAsync ( EventStreamEntry < DagCid > streamEntry , ValueUpdateEvent updateEvent , string removedFeature , CancellationToken cancellationToken )
431436 {
432437 cancellationToken . ThrowIfCancellationRequested ( ) ;
@@ -437,7 +442,6 @@ internal Task ApplyFeatureRemoveEntryUpdateAsync(EventStreamEntry<DagCid> stream
437442 return Task . CompletedTask ;
438443 }
439444
440- /// <inheritdoc />
441445 internal async Task ApplyPublisherUpdateEntryUpdateAsync ( EventStreamEntry < DagCid > streamEntry , ValueUpdateEvent updateEvent , string publisherId , CancellationToken cancellationToken )
442446 {
443447 cancellationToken . ThrowIfCancellationRequested ( ) ;
@@ -447,7 +451,6 @@ internal async Task ApplyPublisherUpdateEntryUpdateAsync(EventStreamEntry<DagCid
447451 await ApplyPublisherUpdateEntryUpdateAsync ( streamEntry , updateEvent , publisherId , publisher , cancellationToken ) ;
448452 }
449453
450- /// <inheritdoc />
451454 internal Task ApplyPublisherUpdateEntryUpdateAsync ( EventStreamEntry < DagCid > streamEntry , ValueUpdateEvent updateEvent , string publisherId , IReadOnlyPublisher updatedPublisher , CancellationToken cancellationToken )
452455 {
453456 cancellationToken . ThrowIfCancellationRequested ( ) ;
0 commit comments