Skip to content

Commit

Permalink
Fix some merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
halgari committed Oct 3, 2024
1 parent 7c70cbd commit 50042f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public partial class NexusModsModPageMetadata : IModelDefinition
/// </summary>
public static readonly UriAttribute FullSizedPictureUri = new(Namespace, nameof(FullSizedPictureUri)) { IsOptional = true };

public static readonly ReferenceAttribute<PersistedResource> ThumbnailResource = new(Namespace, nameof(ThumbnailResource)) { IsOptional = true };
public static readonly ReferenceAttribute<PersistedDbResource> ThumbnailResource = new(Namespace, nameof(ThumbnailResource)) { IsOptional = true };

/// <summary>
/// Uri for the thumbnail of the full sized picture.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,19 @@ public NexusModsLibrary(IServiceProvider serviceProvider)

var db = _connection.Db;
var collectionInfo = info.Data!.CollectionRevision.Collection;
var collectionTileImage = DownloadImage(collectionInfo.TileImage?.ThumbnailUrl, token);
var collectionBackgroundImage = DownloadImage(collectionInfo.HeaderImage?.Url, token);

// Remap the collection info
var collectionResolver = GraphQLResolver.Create(db, tx, CollectionMetadata.Slug, slug);
collectionResolver.Add(CollectionMetadata.Name, collectionInfo.Name);
collectionResolver.Add(CollectionMetadata.Summary, collectionInfo.Summary);
collectionResolver.Add(CollectionMetadata.Endorsements, (ulong)collectionInfo.Endorsements);
collectionResolver.Add(CollectionMetadata.TileImage, await collectionTileImage);
collectionResolver.Add(CollectionMetadata.BackgroundImage, await collectionBackgroundImage);

if (Uri.TryCreate(collectionInfo.TileImage?.ThumbnailUrl, UriKind.Absolute, out var tileImageUri))
collectionResolver.Add(CollectionMetadata.TileImageUri, tileImageUri);

if (Uri.TryCreate(collectionInfo.HeaderImage?.Url, UriKind.Absolute, out var backgroundImageUri))
collectionResolver.Add(CollectionMetadata.BackgroundImageUri, backgroundImageUri);


var user = await collectionInfo.User.Resolve(db, tx, _httpClient, token);
collectionResolver.Add(CollectionMetadata.Author, user);
Expand Down

0 comments on commit 50042f6

Please sign in to comment.