@@ -69,18 +69,33 @@ public function addEagerConstraints(array $albums): void
6969 $ album = $ albums [0 ];
7070 $ tags = $ album ->show_tags ;
7171
72- $ this ->photo_query_policy
73- ->applySearchabilityFilter (
74- $ this ->getRelationQuery (),
75- origin: null ,
76- include_nsfw: !Configs::getValueAsBool ('hide_nsfw_in_smart_albums ' )
77- )
78- ->where (function (Builder $ q ) use ($ tags ): void {
79- // Filter for requested tags
80- foreach ($ tags as $ tag ) {
81- $ q ->where ('tags ' , 'like ' , '% ' . trim ($ tag ) . '% ' );
82- }
83- });
72+ if (Configs::getValueAsBool ('TA_override_visibility ' )) {
73+ $ this ->photo_query_policy
74+ ->applySensitivityFilter (
75+ $ this ->getRelationQuery (),
76+ origin: null ,
77+ include_nsfw: !Configs::getValueAsBool ('hide_nsfw_in_smart_albums ' )
78+ )
79+ ->where (function (Builder $ q ) use ($ tags ): void {
80+ // Filter for requested tags
81+ foreach ($ tags as $ tag ) {
82+ $ q ->where ('tags ' , 'like ' , '% ' . trim ($ tag ) . '% ' );
83+ }
84+ });
85+ } else {
86+ $ this ->photo_query_policy
87+ ->applySearchabilityFilter (
88+ $ this ->getRelationQuery (),
89+ origin: null ,
90+ include_nsfw: !Configs::getValueAsBool ('hide_nsfw_in_smart_albums ' )
91+ )
92+ ->where (function (Builder $ q ) use ($ tags ): void {
93+ // Filter for requested tags
94+ foreach ($ tags as $ tag ) {
95+ $ q ->where ('tags ' , 'like ' , '% ' . trim ($ tag ) . '% ' );
96+ }
97+ });
98+ }
8499 }
85100
86101 /**
0 commit comments