Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Webreaper committed Dec 7, 2022
2 parents 4de03b1 + d2132c3 commit e046172
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 139 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/damselfly-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,26 @@ jobs:
body: |
Docker: docker pull webreaper/damselfly:${{ steps.getversion.outputs.version }}
draft: false
prerelease: false
prerelease: false

- name: Upload Server Artifacts
if: github.ref == 'refs/heads/master'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: server/*.zip
asset_name: Server-Dist.zip
asset_content_type: application/zip

- name: Upload Desktop Artifacts
if: github.ref == 'refs/heads/master'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Damselfly.Web.Client/wwwroot/desktop/*.*
asset_name: Desktop-Dist.zip
asset_content_type: application/zip
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -431,3 +431,4 @@ ts-gen
Damselfly.Desktop/docker_env
Damselfly.Web.Client/wwwroot/version.js
Damselfly.Web.Client/wwwroot/desktop/Damselfly-4.0.1-mac.zip
.DS_Store
4 changes: 3 additions & 1 deletion Damselfly.Core.DbModels/Models/Entities/Folder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public class Folder
public virtual Folder? Parent { get; set; }

public DateTime? FolderScanDate { get; set; }
public ICollection<Folder> Children { get; set; }

[JsonIgnore] // This JsonIgnore prevents circular references when serializing the Image entity
public ICollection<Folder> Children { get; } = new List<Folder>();

[JsonIgnore] // This JsonIgnore prevents circular references when serializing the Image entity
public virtual List<Image> Images { get; } = new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ public ClientFolderService(RestClient client, NotificationsService notificationS
public async Task<ICollection<Folder>> GetFolders()
{
var folders = await httpClient.CustomGetFromJsonAsync<ICollection<Folder>>("/api/folders");

var folderMap = folders.ToDictionary(x => x.FolderId, x => x);

foreach( var folder in folders )
{
if( folder.ParentId != null && folderMap.TryGetValue( folder.ParentId.Value, out var parent ))
parent.Children.Add(folder);
}

return folders;
}
}
120 changes: 0 additions & 120 deletions Damselfly.Web.Client/Extensions/QueryStringExtensions.cs

This file was deleted.

20 changes: 6 additions & 14 deletions Damselfly.Web.Client/Pages/HomePage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@

@code
{
[QueryStringParameter]
[Parameter, SupplyParameterFromQuery]
public string S { get; set; }

[QueryStringParameter]
[Parameter, SupplyParameterFromQuery]
public int FolderId { get; set; }

[QueryStringParameter]
[Parameter, SupplyParameterFromQuery]
public int TagId { get; set; }

[QueryStringParameter]
[Parameter, SupplyParameterFromQuery]
public string Tag { get; set; }

[QueryStringParameter]
[Parameter, SupplyParameterFromQuery]
public int PersonId { get; set; }

[QueryStringParameter]
[Parameter, SupplyParameterFromQuery]
public string Date { get; set; }

private ThumbSize thumbSize { get; set; }
Expand Down Expand Up @@ -110,13 +110,6 @@
//this.UpdateQueryString(navigationManager);
}

public override Task SetParametersAsync(ParameterView parameters)
{
this.SetParametersFromQueryString(navigationManager);

return base.SetParametersAsync(parameters);
}

protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
Expand All @@ -130,7 +123,6 @@

void HandleLocationChanged(object sender, LocationChangedEventArgs e)
{
this.SetParametersFromQueryString(navigationManager);
StateHasChanged();

_ = ApplyQueryParams();
Expand Down
2 changes: 1 addition & 1 deletion Damselfly.Web.Client/wwwroot/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const CACHE_VERSION='4.0.0-20221129135013'
const CACHE_VERSION='4.0.1-20221205090133'
10 changes: 9 additions & 1 deletion Damselfly.Web.Server/Controllers/FolderController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,17 @@ public async Task<ICollection<Folder>> Get()
{
var folders = await _service.GetFolders();

foreach ( var folder in folders )
foreach (var folder in folders)
{
folder.Images.Clear();

// We clear the children here, and reconstitute them on the client,
// to avoid cyclic deserialization issues.

// TODO: Should probably convert this to use DTOs.
folder.Children.Clear();
}

return folders;
}
}
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.1
4.0.2

0 comments on commit e046172

Please sign in to comment.