Skip to content

Commit e99f9b4

Browse files
authored
Merge pull request #63 from mensadilabs/dev
release
2 parents ca049a9 + 91cfa0d commit e99f9b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2892
-1008
lines changed

CHANGELOG.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
1+
# VERSION|1.1.0
2+
3+
NEW_FEATURE| Sign In With API key
4+
- All of the SSO users can now use API keys to sign in. Not sure what will break if the API does not have needed scopes. Eventually maybe I'll list them out but for now, take a guess based on the available features.
5+
6+
IMPROVEMENT| Cleanups
7+
- Bug fixes and performance improvements.
8+
- Album view now shows "shared by you" for the albums shared by you.
9+
10+
# VERSION|1.0.14
11+
12+
IMPROVEMENT| Slideshow optimizations
13+
- Rewrite SlideshowView for loading assets dynamically
14+
- Fix shared albums are duplicated
15+
- Fix slideshow does not work for shared-in albums
16+
- Bug fixes and performance improvements
17+
18+
# VERSION|1.0.12
19+
20+
BUGFIX| Fix more bugs
21+
- Make slideshow truly random, just like life. Outsourced this to the server. - #43
22+
- Fix inactivity timer - Browse fast or the automatic slideshow will catch up to you - #43
23+
- Remove date of birth from people tab - WAF+10 - #44
24+
125
# VERSION|1.0.11
226

3-
BUFFIX| Fix bugs
27+
BUGFIX| Fix bugs
428
- Top shef portraits no longer do unexpected headstands or cartwheels. I Hope.
529
- Hopefully it also won't crash. But you may see reduced image quality in top shelf.
630
- Better error handling.

Immich Gallery.xcodeproj/project.pbxproj

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@
5858
/* End PBXFileReference section */
5959

6060
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
61+
2F0443162E639D0C00BFB354 /* Exceptions for "Immich Gallery" folder in "TopShelfExtension" target */ = {
62+
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
63+
membershipExceptions = (
64+
Models/UserModels.swift,
65+
Protocols/UserStorage.swift,
66+
Storage/HybridUserStorage.swift,
67+
Storage/KeychainTokenStorage.swift,
68+
Storage/UserDefaultsStorage.swift,
69+
);
70+
target = 2F2862FC2E4971C90032B966 /* TopShelfExtension */;
71+
};
6172
2F28630C2E4971C90032B966 /* Exceptions for "TopShelfExtension" folder in "TopShelfExtension" target */ = {
6273
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
6374
membershipExceptions = (
@@ -86,6 +97,7 @@
8697
isa = PBXFileSystemSynchronizedRootGroup;
8798
exceptions = (
8899
2F766F112E3AEC6400AEF3B2 /* Exceptions for "Immich Gallery" folder in "Immich Gallery" target */,
100+
2F0443162E639D0C00BFB354 /* Exceptions for "Immich Gallery" folder in "TopShelfExtension" target */,
89101
);
90102
path = "Immich Gallery";
91103
sourceTree = "<group>";
@@ -287,7 +299,7 @@
287299
attributes = {
288300
BuildIndependentTargetsInParallel = 1;
289301
LastSwiftUpdateCheck = 1620;
290-
LastUpgradeCheck = 1620;
302+
LastUpgradeCheck = 1640;
291303
TargetAttributes = {
292304
2F23BA6C2E1234C8005C563C = {
293305
CreatedOnToolsVersion = 16.2;
@@ -443,6 +455,7 @@
443455
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
444456
COPY_PHASE_STRIP = NO;
445457
DEBUG_INFORMATION_FORMAT = dwarf;
458+
DEVELOPMENT_TEAM = 2F58933V55;
446459
ENABLE_STRICT_OBJC_MSGSEND = YES;
447460
ENABLE_TESTABILITY = YES;
448461
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -506,6 +519,7 @@
506519
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
507520
COPY_PHASE_STRIP = NO;
508521
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
522+
DEVELOPMENT_TEAM = 2F58933V55;
509523
ENABLE_NS_ASSERTIONS = NO;
510524
ENABLE_STRICT_OBJC_MSGSEND = YES;
511525
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -537,7 +551,6 @@
537551
CODE_SIGN_STYLE = Automatic;
538552
CURRENT_PROJECT_VERSION = 1;
539553
DEVELOPMENT_ASSET_PATHS = "\"Immich Gallery/Preview Content\"";
540-
DEVELOPMENT_TEAM = 2F58933V55;
541554
ENABLE_PREVIEWS = YES;
542555
GENERATE_INFOPLIST_FILE = YES;
543556
INFOPLIST_FILE = "Immich-Gallery-Info.plist";
@@ -547,7 +560,7 @@
547560
"$(inherited)",
548561
"@executable_path/Frameworks",
549562
);
550-
MARKETING_VERSION = 1.0.11;
563+
MARKETING_VERSION = 1.1.2;
551564
PRODUCT_BUNDLE_IDENTIFIER = "com.sanketh.dev.Immich-Gallery";
552565
PRODUCT_NAME = "$(TARGET_NAME)";
553566
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -566,7 +579,6 @@
566579
CODE_SIGN_STYLE = Automatic;
567580
CURRENT_PROJECT_VERSION = 1;
568581
DEVELOPMENT_ASSET_PATHS = "\"Immich Gallery/Preview Content\"";
569-
DEVELOPMENT_TEAM = 2F58933V55;
570582
ENABLE_PREVIEWS = YES;
571583
GENERATE_INFOPLIST_FILE = YES;
572584
INFOPLIST_FILE = "Immich-Gallery-Info.plist";
@@ -576,7 +588,7 @@
576588
"$(inherited)",
577589
"@executable_path/Frameworks",
578590
);
579-
MARKETING_VERSION = 1.0.11;
591+
MARKETING_VERSION = 1.1.2;
580592
PRODUCT_BUNDLE_IDENTIFIER = "com.sanketh.dev.Immich-Gallery";
581593
PRODUCT_NAME = "$(TARGET_NAME)";
582594
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -591,7 +603,6 @@
591603
BUNDLE_LOADER = "$(TEST_HOST)";
592604
CODE_SIGN_STYLE = Automatic;
593605
CURRENT_PROJECT_VERSION = 1;
594-
DEVELOPMENT_TEAM = 2F58933V55;
595606
GENERATE_INFOPLIST_FILE = YES;
596607
MARKETING_VERSION = 1.0;
597608
PRODUCT_BUNDLE_IDENTIFIER = "com.mensadi.Immich-GalleryTests";
@@ -610,7 +621,6 @@
610621
BUNDLE_LOADER = "$(TEST_HOST)";
611622
CODE_SIGN_STYLE = Automatic;
612623
CURRENT_PROJECT_VERSION = 1;
613-
DEVELOPMENT_TEAM = 2F58933V55;
614624
GENERATE_INFOPLIST_FILE = YES;
615625
MARKETING_VERSION = 1.0;
616626
PRODUCT_BUNDLE_IDENTIFIER = "com.mensadi.Immich-GalleryTests";
@@ -628,7 +638,6 @@
628638
buildSettings = {
629639
CODE_SIGN_STYLE = Automatic;
630640
CURRENT_PROJECT_VERSION = 1;
631-
DEVELOPMENT_TEAM = 2F58933V55;
632641
GENERATE_INFOPLIST_FILE = YES;
633642
MARKETING_VERSION = 1.0;
634643
PRODUCT_BUNDLE_IDENTIFIER = "com.mensadi.Immich-GalleryUITests";
@@ -645,7 +654,6 @@
645654
buildSettings = {
646655
CODE_SIGN_STYLE = Automatic;
647656
CURRENT_PROJECT_VERSION = 1;
648-
DEVELOPMENT_TEAM = 2F58933V55;
649657
GENERATE_INFOPLIST_FILE = YES;
650658
MARKETING_VERSION = 1.0;
651659
PRODUCT_BUNDLE_IDENTIFIER = "com.mensadi.Immich-GalleryUITests";
@@ -663,7 +671,6 @@
663671
CODE_SIGN_ENTITLEMENTS = TopShelfExtension/TopShelfExtension.entitlements;
664672
CODE_SIGN_STYLE = Automatic;
665673
CURRENT_PROJECT_VERSION = 1;
666-
DEVELOPMENT_TEAM = 2F58933V55;
667674
GENERATE_INFOPLIST_FILE = YES;
668675
INFOPLIST_FILE = TopShelfExtension/Info.plist;
669676
INFOPLIST_KEY_CFBundleDisplayName = TopShelfExtension;
@@ -673,7 +680,7 @@
673680
"@executable_path/Frameworks",
674681
"@executable_path/../../Frameworks",
675682
);
676-
MARKETING_VERSION = 0.2;
683+
MARKETING_VERSION = 1.1.2;
677684
PRODUCT_BUNDLE_IDENTIFIER = "com.sanketh.dev.Immich-Gallery.TopShelfExtension";
678685
PRODUCT_NAME = "$(TARGET_NAME)";
679686
SKIP_INSTALL = YES;
@@ -689,7 +696,6 @@
689696
CODE_SIGN_ENTITLEMENTS = TopShelfExtension/TopShelfExtension.entitlements;
690697
CODE_SIGN_STYLE = Automatic;
691698
CURRENT_PROJECT_VERSION = 1;
692-
DEVELOPMENT_TEAM = 2F58933V55;
693699
GENERATE_INFOPLIST_FILE = YES;
694700
INFOPLIST_FILE = TopShelfExtension/Info.plist;
695701
INFOPLIST_KEY_CFBundleDisplayName = TopShelfExtension;
@@ -699,7 +705,7 @@
699705
"@executable_path/Frameworks",
700706
"@executable_path/../../Frameworks",
701707
);
702-
MARKETING_VERSION = 0.2;
708+
MARKETING_VERSION = 1.1.2;
703709
PRODUCT_BUNDLE_IDENTIFIER = "com.sanketh.dev.Immich-Gallery.TopShelfExtension";
704710
PRODUCT_NAME = "$(TARGET_NAME)";
705711
SKIP_INSTALL = YES;

Immich Gallery.xcodeproj/xcshareddata/xcschemes/Immich Gallery.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1620"
3+
LastUpgradeVersion = "1640"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

Immich Gallery/ContentView.swift

Lines changed: 56 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ struct ContentView: View {
4747
@AppStorage(UserDefaultsKeys.autoSlideshowTimeout) private var autoSlideshowTimeout: Int = 0
4848
@State private var inactivityTimer: Timer? = nil
4949
@State private var lastInteractionDate = Date()
50-
@StateObject private var networkService = NetworkService()
50+
@StateObject private var userManager = UserManager()
51+
@StateObject private var networkService: NetworkService
5152
@StateObject private var authService: AuthenticationService
5253
@StateObject private var assetService: AssetService
5354
@StateObject private var albumService: AlbumService
@@ -64,9 +65,11 @@ struct ContentView: View {
6465
@State private var deepLinkAssetId: String?
6566

6667
init() {
67-
let networkService = NetworkService()
68+
let userManager = UserManager()
69+
let networkService = NetworkService(userManager: userManager)
70+
_userManager = StateObject(wrappedValue: userManager)
6871
_networkService = StateObject(wrappedValue: networkService)
69-
_authService = StateObject(wrappedValue: AuthenticationService(networkService: networkService))
72+
_authService = StateObject(wrappedValue: AuthenticationService(networkService: networkService, userManager: userManager))
7073
_assetService = StateObject(wrappedValue: AssetService(networkService: networkService))
7174
_albumService = StateObject(wrappedValue: AlbumService(networkService: networkService))
7275
_peopleService = StateObject(wrappedValue: PeopleService(networkService: networkService))
@@ -75,24 +78,34 @@ struct ContentView: View {
7578
}
7679

7780
var body: some View {
78-
NavigationView {
81+
NavigationView {
7982
ZStack {
8083
if !authService.isAuthenticated {
8184
// Show sign-in view
82-
SignInView(authService: authService, mode: .signIn)
85+
SignInView(authService: authService, userManager: userManager, mode: .signIn)
8386
.errorBoundary(context: "Authentication")
8487
} else {
8588
// Main app interface
8689
TabView(selection: $selectedTab) {
87-
AssetGridView(assetService: assetService, authService: authService, albumId: nil, personId: nil, tagId: nil, isAllPhotos: true, onAssetsLoaded: nil, deepLinkAssetId: deepLinkAssetId)
88-
.errorBoundary(context: "Photos Tab")
89-
.tabItem {
90-
Image(systemName: TabName.photos.iconName)
91-
Text(TabName.photos.title)
92-
}
93-
.tag(TabName.photos.rawValue)
90+
AssetGridView(
91+
assetService: assetService,
92+
authService: authService,
93+
assetProvider: AssetProviderFactory.createProvider(
94+
isAllPhotos: true,
95+
assetService: assetService
96+
),
97+
albumId: nil, personId: nil, tagId: nil, isAllPhotos: true,
98+
onAssetsLoaded: nil,
99+
deepLinkAssetId: deepLinkAssetId
100+
)
101+
.errorBoundary(context: "Photos Tab")
102+
.tabItem {
103+
Image(systemName: TabName.photos.iconName)
104+
Text(TabName.photos.title)
105+
}
106+
.tag(TabName.photos.rawValue)
94107

95-
AlbumListView(albumService: albumService, authService: authService, assetService: assetService)
108+
AlbumListView(albumService: albumService, authService: authService, assetService: assetService, userManager: userManager)
96109
.errorBoundary(context: "Albums Tab")
97110
.tabItem {
98111
Image(systemName: TabName.albums.iconName)
@@ -126,7 +139,7 @@ struct ContentView: View {
126139
}
127140
.tag(TabName.search.rawValue)
128141

129-
SettingsView(authService: authService)
142+
SettingsView(authService: authService, userManager: userManager)
130143
.errorBoundary(context: "Settings Tab")
131144
.tabItem {
132145
Image(systemName: TabName.settings.iconName)
@@ -176,35 +189,54 @@ struct ContentView: View {
176189
.simultaneousGesture(
177190
TapGesture().onEnded { resetInactivityTimer() }
178191
)
179-
.sheet(isPresented: $showWhatsNew) {
180-
WhatsNewView(onDismiss: {
181-
showWhatsNew = false
182-
lastSeenVersion = getCurrentAppVersion()
183-
})
184-
}
192+
.onReceive(NotificationCenter.default.publisher(for: NSNotification.Name("stopAutoSlideshowTimer"))) { _ in
193+
print("ContentView: Stopping auto-slideshow timer")
194+
inactivityTimer?.invalidate()
195+
inactivityTimer = nil
196+
}
197+
.onReceive(NotificationCenter.default.publisher(for: NSNotification.Name("restartAutoSlideshowTimer"))) { _ in
198+
print("ContentView: Restarting auto-slideshow timer")
199+
resetInactivityTimer()
200+
}
201+
.sheet(isPresented: $showWhatsNew) {
202+
WhatsNewView(onDismiss: {
203+
showWhatsNew = false
204+
lastSeenVersion = getCurrentAppVersion()
205+
})
206+
}
185207
}
186208

187209
// MARK: - Inactivity Timer Logic
188210
private func startInactivityTimer() {
189211
inactivityTimer?.invalidate()
190212
inactivityTimer = nil
191213
if autoSlideshowTimeout > 0 {
214+
print("ContentView: Starting inactivity timer with timeout: \(autoSlideshowTimeout) minutes")
192215
inactivityTimer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { _ in
193216
let elapsed = Date().timeIntervalSince(lastInteractionDate)
194217
if elapsed > Double(autoSlideshowTimeout * 60) {
218+
print("ContentView: Auto-slideshow timeout reached! Elapsed: \(elapsed) seconds")
195219
inactivityTimer?.invalidate()
196220
inactivityTimer = nil
197-
// Post notification to start auto slideshow
198-
NotificationCenter.default.post(name: NSNotification.Name(NotificationNames.startAutoSlideshow), object: nil)
221+
// Switch to Photos tab and start auto slideshow
222+
selectedTab = TabName.photos.rawValue
223+
// Wait 5 seconds for tab switch to complete, then start slideshow
224+
DispatchQueue.main.asyncAfter(deadline: .now() + 5.0) {
225+
NotificationCenter.default.post(name: NSNotification.Name(NotificationNames.startAutoSlideshow), object: nil)
226+
}
199227
}
200228
}
229+
} else {
230+
print("ContentView: Auto-slideshow disabled (timeout = 0)")
201231
}
202232
}
203-
233+
204234
private func resetInactivityTimer() {
235+
print("ContentView: Resetting inactivity timer")
205236
lastInteractionDate = Date()
237+
startInactivityTimer() // Restart the timer
206238
}
207-
239+
208240
private func setDefaultTab() {
209241
switch defaultStartupTab {
210242
case "albums":

Immich Gallery/Immich Gallery.entitlements

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
<array>
77
<string>group.com.sanketh.dev.Immich-Gallery</string>
88
</array>
9+
<key>keychain-access-groups</key>
10+
<array>
11+
<string>$(AppIdentifierPrefix)com.sanketh.dev.Immich-Gallery</string>
12+
</array>
913
</dict>
1014
</plist>

0 commit comments

Comments
 (0)