From 8cb8b7d8fb9242121e06aee837be6df8512858f7 Mon Sep 17 00:00:00 2001 From: ildyria Date: Sat, 30 May 2026 10:30:23 +0200 Subject: [PATCH 1/2] Add option to have timeline only at root level --- .../Resources/GalleryConfigs/RootConfig.php | 2 +- ...00001_add_timeline_albums_root_enabled.php | 39 +++++++++++++++++++ lang/ar/all_settings.php | 2 +- lang/cz/all_settings.php | 2 +- lang/el/all_settings.php | 2 +- lang/en/all_settings.php | 2 +- lang/es/all_settings.php | 2 +- lang/fa/all_settings.php | 2 +- lang/hu/all_settings.php | 2 +- lang/it/all_settings.php | 2 +- lang/ja/all_settings.php | 2 +- lang/nl/all_settings.php | 2 +- lang/no/all_settings.php | 2 +- lang/pl/all_settings.php | 2 +- lang/pt/all_settings.php | 2 +- lang/ru/all_settings.php | 2 +- lang/sk/all_settings.php | 2 +- lang/sv/all_settings.php | 2 +- lang/tr/all_settings.php | 2 +- lang/vi/all_settings.php | 2 +- lang/zh_CN/all_settings.php | 2 +- lang/zh_TW/all_settings.php | 2 +- 22 files changed, 60 insertions(+), 21 deletions(-) create mode 100644 database/migrations/2026_05_30_000001_add_timeline_albums_root_enabled.php diff --git a/app/Http/Resources/GalleryConfigs/RootConfig.php b/app/Http/Resources/GalleryConfigs/RootConfig.php index fbebaaf2079..eb0b7296c6a 100644 --- a/app/Http/Resources/GalleryConfigs/RootConfig.php +++ b/app/Http/Resources/GalleryConfigs/RootConfig.php @@ -43,7 +43,7 @@ public function __construct() { $is_logged_in = Auth::check(); - $timeline_albums_enabled = request()->configs()->getValueAsBool('timeline_albums_enabled'); + $timeline_albums_enabled = request()->configs()->getValueAsBool('timeline_albums_root_enabled'); $timeline_albums_public = request()->configs()->getValueAsBool('timeline_albums_public'); $this->is_album_timeline_enabled = $timeline_albums_enabled && ($is_logged_in || $timeline_albums_public); $this->timeline_album_granularity = request()->configs()->getValueAsEnum('timeline_albums_granularity', TimelineAlbumGranularity::class); diff --git a/database/migrations/2026_05_30_000001_add_timeline_albums_root_enabled.php b/database/migrations/2026_05_30_000001_add_timeline_albums_root_enabled.php new file mode 100644 index 00000000000..076111d0f4f --- /dev/null +++ b/database/migrations/2026_05_30_000001_add_timeline_albums_root_enabled.php @@ -0,0 +1,39 @@ +where('key', 'timeline_albums_enabled')->select('value')->get(); + DB::table('configs')->insert([ + 'key' => 'timeline_albums_root_enabled', + 'value' => $val->isEmpty() ? '0' : $val[0]->value, + 'cat' => self::CAT, + 'type_range' => self::BOOL, + 'description' => 'Enable timeline for albums at root', + 'details' => '', + 'is_secret' => false, + 'is_expert' => false, + 'level' => 0, + 'order' => 11, + ]); + DB::table('configs')->where('key', 'timeline_albums_enabled')->update(['details' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.']); + } + + public function down(): void + { + DB::table('configs')->where('key', 'timeline_albums_root_enabled')->delete(); + DB::table('configs')->where('key', 'timeline_albums_enabled')->update(['details' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.']); + } +}; diff --git a/lang/ar/all_settings.php b/lang/ar/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/ar/all_settings.php +++ b/lang/ar/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/cz/all_settings.php b/lang/cz/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/cz/all_settings.php +++ b/lang/cz/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/el/all_settings.php b/lang/el/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/el/all_settings.php +++ b/lang/el/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/en/all_settings.php b/lang/en/all_settings.php index 67d2d44f661..ecd6aad7e74 100644 --- a/lang/en/all_settings.php +++ b/lang/en/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/es/all_settings.php b/lang/es/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/es/all_settings.php +++ b/lang/es/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/fa/all_settings.php b/lang/fa/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/fa/all_settings.php +++ b/lang/fa/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/hu/all_settings.php b/lang/hu/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/hu/all_settings.php +++ b/lang/hu/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/it/all_settings.php b/lang/it/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/it/all_settings.php +++ b/lang/it/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/ja/all_settings.php b/lang/ja/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/ja/all_settings.php +++ b/lang/ja/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/nl/all_settings.php b/lang/nl/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/nl/all_settings.php +++ b/lang/nl/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/no/all_settings.php b/lang/no/all_settings.php index 09fc31ce84f..41338041556 100644 --- a/lang/no/all_settings.php +++ b/lang/no/all_settings.php @@ -505,7 +505,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/pl/all_settings.php b/lang/pl/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/pl/all_settings.php +++ b/lang/pl/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/pt/all_settings.php b/lang/pt/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/pt/all_settings.php +++ b/lang/pt/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/ru/all_settings.php b/lang/ru/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/ru/all_settings.php +++ b/lang/ru/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/sk/all_settings.php b/lang/sk/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/sk/all_settings.php +++ b/lang/sk/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/sv/all_settings.php b/lang/sv/all_settings.php index 3e7050f097f..cc4ab69467f 100644 --- a/lang/sv/all_settings.php +++ b/lang/sv/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/tr/all_settings.php b/lang/tr/all_settings.php index b2159fe2612..03730a6e6b9 100644 --- a/lang/tr/all_settings.php +++ b/lang/tr/all_settings.php @@ -506,7 +506,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/vi/all_settings.php b/lang/vi/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/vi/all_settings.php +++ b/lang/vi/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/zh_CN/all_settings.php b/lang/zh_CN/all_settings.php index 3e7050f097f..cc4ab69467f 100644 --- a/lang/zh_CN/all_settings.php +++ b/lang/zh_CN/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', diff --git a/lang/zh_TW/all_settings.php b/lang/zh_TW/all_settings.php index 56a20964092..30949fc9388 100644 --- a/lang/zh_TW/all_settings.php +++ b/lang/zh_TW/all_settings.php @@ -507,7 +507,7 @@ 'timeline_photos_order' => 'This determines whether the captured date or the upload date will be used to order the photos.', 'timeline_photos_layout' => '', 'timeline_photos_pagination_limit' => '', - 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums (and root). This can also be disabled/enabled per album.', + 'timeline_albums_enabled' => 'Globally enable albums timelines in each albums. This can also be disabled/enabled per album.', 'timeline_albums_public' => '', 'timeline_albums_granularity' => '', 'timeline_left_border_enabled' => '', From b400d7c58d5e8283d1b45f78c8ffec8ee7a53f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Viguier?= Date: Sat, 30 May 2026 10:39:58 +0200 Subject: [PATCH 2/2] Update database/migrations/2026_05_30_000001_add_timeline_albums_root_enabled.php Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../2026_05_30_000001_add_timeline_albums_root_enabled.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/database/migrations/2026_05_30_000001_add_timeline_albums_root_enabled.php b/database/migrations/2026_05_30_000001_add_timeline_albums_root_enabled.php index 076111d0f4f..aefcfb3d0c2 100644 --- a/database/migrations/2026_05_30_000001_add_timeline_albums_root_enabled.php +++ b/database/migrations/2026_05_30_000001_add_timeline_albums_root_enabled.php @@ -15,10 +15,11 @@ public function up(): void { - $val = DB::table('configs')->where('key', 'timeline_albums_enabled')->select('value')->get(); + $val = DB::table('configs')->where('key', 'timeline_albums_enabled')->value('value'); + $normalized_val = in_array($val, ['0', '1'], true) ? $val : '0'; DB::table('configs')->insert([ 'key' => 'timeline_albums_root_enabled', - 'value' => $val->isEmpty() ? '0' : $val[0]->value, + 'value' => $normalized_val, 'cat' => self::CAT, 'type_range' => self::BOOL, 'description' => 'Enable timeline for albums at root',