Skip to content

Commit b02cb78

Browse files
authored
Merge branch 'varun-raj:main' into main
2 parents 368de48 + 9488f8d commit b02cb78

33 files changed

+442
-54
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ jobs:
4343
password: ${{ secrets.GITHUB_TOKEN }}
4444
- name: Build and push Docker image
4545
run: |
46-
docker build --build-arg VERSION=${{ needs.release.outputs.new-release-version }} \
46+
docker build --build-arg BUILD_VERSION=${{ needs.release.outputs.new-release-version }} VERSION=${{ needs.release.outputs.new-release-version }} \
4747
-t ghcr.io/${{ github.repository }}:${{ needs.release.outputs.new-release-version }} \
4848
-t ghcr.io/${{ github.repository }}:latest .

bun.lockb

4.75 KB
Binary file not shown.

docker-compose.build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ services:
1010
- "3000:3000"
1111
env_file:
1212
- .env
13+
environment:
14+
- BUILD_VERSION=${BUILD_VERSION}

next.config.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
/** @type {import('next').NextConfig} */
2+
3+
import { readFileSync } from 'fs';
4+
5+
const { version } = JSON.parse(readFileSync('./package.json', 'utf-8'));
6+
7+
console.log(`Version: ${version}`);
8+
29
const nextConfig = {
310
reactStrictMode: false,
411
output: 'standalone',
512
images: {
613
unoptimized: true,
7-
}
14+
},
15+
env: {
16+
VERSION: process.env.BUILD_VERSION || version,
17+
},
818
};
919

1020
export default nextConfig;

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "immich-power-tools",
3-
"version": "0.5.0",
3+
"version": "0.6.1",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",
@@ -31,6 +31,7 @@
3131
"@types/cookie": "^0.6.0",
3232
"@types/qs": "^6.9.15",
3333
"axios": "^1.7.4",
34+
"chrono-node": "^1.4.9",
3435
"class-variance-authority": "^0.7.0",
3536
"clsx": "^2.1.1",
3637
"cmdk": "1.0.0",
@@ -46,6 +47,7 @@
4647
"react-day-picker": "9.0.8",
4748
"react-dom": "^18",
4849
"react-grid-gallery": "^1.0.1",
50+
"react-query": "^3.39.3",
4951
"recharts": "^2.12.7",
5052
"sass": "^1.77.8",
5153
"tailwind-merge": "^2.5.2",

src/components/albums/potential-albums/PotentialAlbumsAssets.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ import Lightbox, { SlideImage, SlideTypes } from "yet-another-react-lightbox";
88
import Captions from "yet-another-react-lightbox/plugins/captions";
99
import { CalendarArrowDown, CalendarArrowUp, Hourglass } from "lucide-react";
1010
import Video from "yet-another-react-lightbox/plugins/video";
11+
import { useConfig } from "@/contexts/ConfigContext";
12+
import LazyImage from "@/components/ui/lazy-image";
1113

1214
export default function PotentialAlbumsAssets() {
15+
const { exImmichUrl } = useConfig();
1316
const { startDate, selectedIds, assets, updateContext } =
1417
usePotentialAlbumContext();
1518

@@ -37,12 +40,22 @@ export default function PotentialAlbumsAssets() {
3740
width: p.exifImageWidth as number,
3841
height: p.exifImageHeight as number,
3942
isSelected: selectedIds.includes(p.id),
43+
tags: [
44+
{
45+
title: "Immich Link",
46+
value: (
47+
<a href={exImmichUrl + "/photos/" + p.id} target="_blank">
48+
Open in Immich
49+
</a>
50+
),
51+
},
52+
],
4053
}));
4154
}, [assets, selectedIds]);
4255

4356
const slides = useMemo(
4457
() =>
45-
images.map(({ original, width, height, type, videoURL }) => ({
58+
images.map(({ original, width, height, type, videoURL}) => ({
4659
src: original,
4760
width,
4861
height,
@@ -111,6 +124,14 @@ export default function PotentialAlbumsAssets() {
111124
onClick={handleClick}
112125
enableImageSelection={true}
113126
onSelect={handleSelect}
127+
thumbnailImageComponent={LazyImage}
128+
tagStyle={{
129+
color: "white",
130+
fontSize: "12px",
131+
backgroundColor: "rgba(0, 0, 0)",
132+
padding: "2px",
133+
borderRadius: "5px",
134+
}}
114135
/>
115136
</div>
116137
</>

src/components/albums/potential-albums/PotentialAlbumsDates.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import {
55
import React, { use, useEffect, useState } from "react";
66
import PotentialDateItem from "./PotentialDateItem";
77
import { usePotentialAlbumContext } from "@/contexts/PotentialAlbumContext";
8+
import { useRouter } from "next/router";
89

910
export default function PotentialAlbumsDates() {
11+
const router = useRouter();
1012
const { updateContext } = usePotentialAlbumContext();
1113
const [dateRecords, setDateRecords] = React.useState<
1214
IPotentialAlbumsDatesResponse[]
@@ -25,6 +27,11 @@ export default function PotentialAlbumsDates() {
2527

2628
const handleSelect = (date: string) => {
2729
updateContext({ startDate: date });
30+
router.push({
31+
pathname: router.pathname,
32+
query: { startDate: date },
33+
})
34+
2835
};
2936

3037
useEffect(() => {

src/components/assets/missing-location/MissingLocationAssets.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { listMissingLocationAssets } from "@/handlers/api/asset.handler";
1818
import { formatDate, parseDate } from "@/helpers/date.helper";
1919
import { addDays } from "date-fns";
2020
import { useConfig } from "@/contexts/ConfigContext";
21+
import LazyImage from "@/components/ui/lazy-image";
2122

2223
export default function MissingLocationAssets() {
2324
const { exImmichUrl } = useConfig();
@@ -125,6 +126,7 @@ export default function MissingLocationAssets() {
125126
onClick={handleClick}
126127
enableImageSelection={true}
127128
onSelect={handleSelect}
129+
thumbnailImageComponent={LazyImage}
128130
tagStyle={{
129131
color: "white",
130132
fontSize: "12px",

src/components/assets/missing-location/MissingLocationDates.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ import { usePotentialAlbumContext } from "@/contexts/PotentialAlbumContext";
33
import { IMissingLocationDatesResponse, listMissingLocationDates } from "@/handlers/api/asset.handler";
44
import MissingLocationDateItem from "./MissingLocationDateItem";
55
import { useMissingLocationContext } from "@/contexts/MissingLocationContext";
6+
import { useRouter } from "next/router";
67

78
export default function MissingLocationDates() {
89
const { updateContext } = useMissingLocationContext();
10+
const router = useRouter();
911
const [dateRecords, setDateRecords] = React.useState<
1012
IMissingLocationDatesResponse[]
1113
>([]);
12-
1314
const [loading, setLoading] = useState(false);
1415

1516
const [errorMessage, setErrorMessage] = useState<string | null>(null);
@@ -23,6 +24,10 @@ export default function MissingLocationDates() {
2324

2425
const handleSelect = (date: string) => {
2526
updateContext({ startDate: date });
27+
router.push({
28+
pathname: router.pathname,
29+
query: { startDate: date },
30+
});
2631
};
2732

2833
useEffect(() => {

src/components/layouts/RootLayout.tsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ import { ArrowRight, TriangleAlert } from "lucide-react";
1010
import Link from "next/link";
1111
import { LoginForm } from "../auth/LoginForm";
1212
import { useConfig } from "@/contexts/ConfigContext";
13+
import { queryClient } from "@/config/rQuery";
14+
import { QueryClientProvider } from "react-query";
1315

1416
type RootLayoutProps = {
1517
children: ReactNode;
1618
};
1719

20+
1821
export default function RootLayout({ children }: RootLayoutProps) {
1922
const { immichURL, exImmichUrl } = useConfig();
2023
const [user, setUser] = useState<IUser | null>(null);
@@ -34,9 +37,7 @@ export default function RootLayout({ children }: RootLayoutProps) {
3437
.finally(() => setLoading(false));
3538
};
3639

37-
const handleLoginCompletion = (user: IUser) => {
38-
setUser(user);
39-
}
40+
const handleLoginCompletion = (user: IUser) => setUser(user);
4041

4142
useEffect(() => {
4243
fetchData();
@@ -86,15 +87,17 @@ export default function RootLayout({ children }: RootLayoutProps) {
8687
if (!user) return <LoginForm onLogin={handleLoginCompletion} />;
8788

8889
return (
89-
<UserContext.Provider value={{
90-
...user,
91-
updateContext: setUser,
92-
}}>
93-
<div className="grid max-h-screen min-h-screen w-full md:grid-cols-[200px_1fr] lg:grid-cols-[240px_1fr]">
94-
<Sidebar />
95-
<div className="flex flex-col">{children}</div>
96-
<Toaster />
97-
</div>
98-
</UserContext.Provider>
90+
<QueryClientProvider client={queryClient}>
91+
<UserContext.Provider value={{
92+
...user,
93+
updateContext: setUser,
94+
}}>
95+
<div className="grid max-h-screen min-h-screen w-full md:grid-cols-[200px_1fr] lg:grid-cols-[240px_1fr]">
96+
<Sidebar />
97+
<div className="flex flex-col">{children}</div>
98+
<Toaster />
99+
</div>
100+
</UserContext.Provider>
101+
</QueryClientProvider>
99102
);
100103
}

0 commit comments

Comments
 (0)