Skip to content

Commit 979c3f7

Browse files
authored
Merge pull request #740 from damongolding/task/release
v0.38.0
2 parents a24d624 + fb25bda commit 979c3f7

6 files changed

Lines changed: 37 additions & 106 deletions

File tree

flake.nix

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -8,96 +8,8 @@
88
flake-utils.lib.eachDefaultSystem (system:
99
let
1010
pkgs = nixpkgs.legacyPackages.${system};
11-
version = "0.37.0"; # hard coded for now
12-
13-
# Step 1: install frontend deps
14-
node_modules = pkgs.stdenv.mkDerivation {
15-
pname = "immich-kiosk-node_modules";
16-
inherit version;
17-
nativeBuildInputs = [ pkgs.bun ];
18-
phases = [ "buildPhase" "installPhase" ];
19-
20-
impureEnvVars = pkgs.lib.fetchers.proxyImpureEnvVars ++
21-
[ "GIT_PROXY_COMMAND" "SOCKS_SERVER" ];
22-
23-
buildPhase = ''
24-
cp ${./frontend/package.json} package.json
25-
cp ${./frontend/bun.lock} bun.lock
26-
bun install --no-progress --frozen-lockfile
27-
'';
28-
29-
installPhase = ''
30-
mkdir -p $out
31-
cp -R ./node_modules $out
32-
'';
33-
34-
outputHash = "sha256-FNNWp3JtF4fGkWRRA0TolI97qBptmsOUNjbLuAmsZf0=";
35-
outputHashAlgo = "sha256";
36-
outputHashMode = "recursive";
37-
};
38-
39-
# Step 2: build frontend assets
40-
frontend = pkgs.stdenv.mkDerivation {
41-
pname = "immich-kiosk-frontend";
42-
inherit version;
43-
src = ./frontend;
44-
nativeBuildInputs = [ pkgs.bun pkgs.nodejs ];
45-
46-
configurePhase = ''
47-
cp -R ${node_modules}/node_modules .
48-
'';
49-
50-
buildPhase = ''
51-
bun run css
52-
bun run js
53-
bun run url-builder
54-
'';
55-
56-
installPhase = ''
57-
mkdir -p $out
58-
cp -r ./public/assets $out
59-
'';
60-
};
61-
6211
in
6312
{
64-
packages = {
65-
default = self.packages.${system}.immich-kiosk;
66-
67-
immich-kiosk = pkgs.buildGoModule {
68-
pname = "immich-kiosk";
69-
inherit version;
70-
src = ./.;
71-
vendorHash = "sha256-O1cH0EGHdOgpo+zhdlYFKVK4cOHg8ZKpsJezdKBv+K0=";
72-
73-
nativeBuildInputs = with pkgs; [ go-task ];
74-
75-
preBuild = ''
76-
77-
# Satisfy go:embed frontend/public
78-
mkdir -p frontend/public
79-
cp -r ${frontend}/assets frontend/public/assets
80-
81-
# Generate templ templates
82-
go tool templ generate
83-
'';
84-
85-
ldflags = [
86-
"-s" "-w"
87-
"-X main.version=${version}"
88-
];
89-
90-
subPackages = [ "." ];
91-
92-
meta = with pkgs.lib; {
93-
description = "Highly configurable slideshows for displaying Immich assets on browsers and devices.";
94-
homepage = "https://github.com/damongolding/immich-kiosk";
95-
license = licenses.agpl3Only;
96-
mainProgram = "immich-kiosk";
97-
};
98-
};
99-
};
100-
10113
devShells.default = pkgs.mkShell {
10214
buildInputs = with pkgs; [
10315
go

frontend/bun.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
}
2727
},
2828
"devDependencies": {
29-
"@biomejs/biome": "^2.4.12",
29+
"@biomejs/biome": "^2.4.13",
3030
"autoprefixer": "^10.5.0",
31-
"choices.js": "^11.2.2",
31+
"choices.js": "^11.2.3",
3232
"date-fns": "^4.1.0",
3333
"dompurify": "^3.4.1",
3434
"esbuild": "^0.28.0",
3535
"htmx.org": "^2.0.10",
36-
"postcss": "^8.5.10",
36+
"postcss": "^8.5.12",
3737
"postcss-cli": "^11.0.1",
3838
"postcss-nested": "^7.0.2",
3939
"typescript": "^5.9.3"

internal/config/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ type Config struct {
345345
FilterDate string `json:"filterDate" yaml:"filter_date" mapstructure:"filter_date" query:"filter_date" form:"filter_date" default:""`
346346
// FilterNewest filter certain asset bucket assets by the newest X assets
347347
FilterNewest int `json:"filterNewest" yaml:"filter_newest" mapstructure:"filter_newest" query:"filter_newest" form:"filter_newest" default:"0"`
348+
// FilterExcludeFaces filter certain asset bucket assets by the presence of faces
349+
FilterExcludeFaces bool `json:"filterExcludeFaces" yaml:"filter_exclude_faces" mapstructure:"filter_exclude_faces" query:"filter_exclude_faces" form:"filter_exclude_faces" default:"false"`
348350

349351
// ShowClearCacheButton display a button to clear cache
350352
ShowClearCacheButton bool `json:"showClearCacheButton" yaml:"show_clear_cache_button" mapstructure:"show_clear_cache_button" query:"show_clear_cache_button" form:"show_clear_cache_button" default:"false"`

internal/immich/immich_helpers.go

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,9 @@ func (a *Asset) containsTag(tagValue string) bool {
650650
// - bool: true if asset meets all criteria, false otherwise
651651
func (a *Asset) isValidAsset(requestID, deviceID string, allowedTypes []AssetType, wantedRatio ImageOrientation) bool {
652652
return a.hasValidBasicProperties(allowedTypes, wantedRatio) &&
653-
a.hasValidDateFilter() &&
653+
a.hasValidFilterDate() &&
654654
a.hasValidPartners() &&
655+
a.hasValidFilterExcludeFaces(requestID, deviceID) &&
655656
a.hasValidAlbums(requestID, deviceID) &&
656657
a.hasValidPeople(requestID, deviceID) &&
657658
a.hasValidTags(requestID, deviceID)
@@ -707,12 +708,12 @@ func (a *Asset) isAnimatedGif() bool {
707708
return totalSeconds > 0
708709
}
709710

710-
// hasValidDateFilter validates if the asset's date matches the configured date filter criteria.
711+
// hasValidFilterDate validates if the asset's date matches the configured date filter criteria.
711712
// Assets from DateRange buckets bypass the date filter check.
712713
//
713714
// Returns:
714715
// - bool: true if date is valid or no filter set, false if outside filter range
715-
func (a *Asset) hasValidDateFilter() bool {
716+
func (a *Asset) hasValidFilterDate() bool {
716717
if a.requestConfig.FilterDate == "" || a.Bucket == kiosk.SourceDateRange {
717718
return true
718719
}
@@ -726,6 +727,22 @@ func (a *Asset) hasValidDateFilter() bool {
726727
return utils.IsTimeBetween(a.LocalDateTime.Local(), dateStart, dateEnd)
727728
}
728729

730+
// hasValidFilterExcludeFaces validates if the asset has no faces assigned.
731+
//
732+
// Returns:
733+
// - bool: true if no faces are assigned or no filter set, false otherwise
734+
func (a *Asset) hasValidFilterExcludeFaces(requestID, deviceID string) bool {
735+
if !a.requestConfig.FilterExcludeFaces {
736+
return true
737+
}
738+
739+
if len(a.People) == 0 {
740+
a.CheckForFaces(requestID, deviceID)
741+
}
742+
743+
return len(a.People) == 0 && len(a.UnassignedFaces) == 0
744+
}
745+
729746
// hasValidAlbums checks if the asset belongs to any excluded albums.
730747
// If album data is missing, it fetches it first.
731748
//

taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: "3"
22
env:
3-
VERSION: 0.37.0-beta.1
3+
VERSION: 0.38.0
44

55
silent: true
66

0 commit comments

Comments
 (0)