Skip to content

Avoiding selecting images from private albums + remove filter#8

Open
7tonin wants to merge 6 commits intoPiwigo:masterfrom
7tonin:master
Open

Avoiding selecting images from private albums + remove filter#8
7tonin wants to merge 6 commits intoPiwigo:masterfrom
7tonin:master

Conversation

@7tonin
Copy link
Contributor

@7tonin 7tonin commented Feb 23, 2021

No description provided.

Looks like using BatchManager styling needs update (since piwigo 11?)
@mistic100
Copy link
Contributor

I think this will prevent selection from any virtual album, which is not correct.

It will also filter out orphan pictures.

@7tonin
Copy link
Contributor Author

7tonin commented Feb 23, 2021

Ok, I can imagine what you are talking about.
If instead, I make it a filter to choose. Will that be acceptable ?
In my mind, I want to make pictures inherit their privacy from the file system folder they belong to. I understand this is not relevant for every Piwigo use.

@mistic100
Copy link
Contributor

mistic100 commented Feb 23, 2021

I don't understand why you are talking about filesystem folder. As far as I remember the privacy setting of an album has nothing to do with the filesystem. Both virtual and physical albums can be made public or private.

So if you want to have pictures only selected from public albums, do that, but do not filter on the "dir" column.

That being said, yes it should be configurable, because people would want to make private smart albums hydrated from private albums.

@mistic100
Copy link
Contributor

Or, like I do : public smart albums from private albums.

Also you join to CATEGORY_IMAGES will break if an image is associated to more than one album (making duplicates in the output).

@7tonin
Copy link
Contributor Author

7tonin commented Feb 24, 2021

I talk about "file system folders" because my gallery is following "FTP+Sync" scheme; further more, my folder tree is crafted to separate private pictures (in subfolders) from public pictures (in chronologic folders).
I must have talked about "Phyical albums" according to the glossary.
Hence, I want some of my SmartAlbums not to pick any photo from a private physical album. So photos are only "from public physical albums".

I was slighty wondering about my JOIN with CATEGORY_IMAGES risk of duplicates, because of SQL table primary index. But the count may have been affected. I realize now, this JOIN is not needed, indeed JOIN ON IMAGES_TABLE.storage_category_id is good enough. something to know, this makes uploaded pictures not reachable. That's ok for me.

@7tonin
Copy link
Contributor Author

7tonin commented Feb 24, 2021

After 6c05bf2, I may add a javascript check to count public_physical filters, but PHP check is already enough to make it reliable. Waiting for approval to code further.

@7tonin
Copy link
Contributor Author

7tonin commented Feb 24, 2021

As I don't understand what does "Exclude SmartAlbums from permissions management", I don't know if it collides with my proposal. I may study this further...

@mistic100
Copy link
Contributor

Why limiting to physical albums ? (ok it is your use case but you are not alone)

@mistic100
Copy link
Contributor

As I don't understand what does "Exclude SmartAlbums from permissions management", I don't know if it collides with my proposal. I may study this further...

By default, Piwigo decides a picture is public if it belongs to at least one public album. By checking this option it removes Smart Albums from the list when this check is done.

For exemple if my picture belongs to one private album and one public Smart album, it will be public if the option is unchecked, and private if the option is checked.

This is important for search results wich list pictures directly.

(this is from memory, might need to recheck the code)

This is a quick patch.
Another would be to keep it on the "right" while overwriting .showInfo display:flex;
coming from */admin/themes/default/theme.css?v11.3.0
@7tonin
Copy link
Contributor Author

7tonin commented Feb 24, 2021

My use case is a start point, yes. If this is your concern, I could add variants inside with a select to choose between public physical album, or public album, or public virtual album. In order to make it more tunable, and maybe useful to others. I don't think my overview of different piwigo use cases, to be so good.

Thanks to you, I now understand the "Exclude SmartAlbums from permissions management" gives an answer to my problem (the tip box is hidden in piwigo 11, until now). Indeed, checking this option excludes pictures which were not supposed to be seen by a user. The content of the smart album is tuned according user's permissions. The pictures count may change, that's not a big problem. But this #3 is more uncomfortable.

The "Exclude SmartAlbums from permissions management" checked behaviour is dynamic, because depending on user.
My filter proposal, and its potential variants, are static.

The "Exclude SmartAlbums from permissions management" checked behaviour is closer to tags page one.

Copy link
Contributor Author

@7tonin 7tonin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can review tools help us to improve this plugin ?

Comment on lines +220 to +221
'sif_lnk' => ($conf['SmartAlbums']['smart_is_forbidden'])?'Smart is forbidden':'Smart is allowed',
'sif' => ($conf['SmartAlbums']['smart_is_forbidden'])?'visitor permissions prepend. Pictures from private albums will be rejected for ungranted visitors. Hence, <strong>using this filter is not required</strong>.':'static permissions. Pictures from private albums may be associated to this virtual smart album. <strong>Using this filter will prevent this to happen</strong>.',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to provide information to SmartAlbums building page. Wish it helps, but feel it somehow heavy. Need improvements.

Comment on lines +230 to +231
'sif_lnk' => ($conf['SmartAlbums']['smart_is_forbidden'])?'Smart is forbidden':'Smart is allowed',
'sif' => ($conf['SmartAlbums']['smart_is_forbidden'])?'visitor permissions prepend. Pictures from private albums will be rejected for ungranted visitors. Hence, <strong>using this filter is not required</strong>.':'static permissions. Pictures from private albums may be associated to this virtual smart album. <strong>Using this filter will prevent this to happen</strong>.',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy paste

{$options.public_physical.name}
</span>

<span><b>{'Info'|translate}</b> <a href="admin.php?page=plugin-SmartAlbums-config" title="{'Edit'|translate} {'Exclude SmartAlbums from permissions management'|translate}">{$options.permission.sif_lnk}</a> : {$options.permission.sif}</span>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the help displayed

<br><i>{'The permission'|translate}</i>
</span>

<span><b>{'Info'|translate}</b> <a href="admin.php?page=plugin-SmartAlbums-config" title="{'Edit'|translate} {'Exclude SmartAlbums from permissions management'|translate}">{$options.permission.sif_lnk}</a> : {$options.permission.sif}</span>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and the copy paste display

@7tonin
Copy link
Contributor Author

7tonin commented Mar 7, 2021

Feel now, "reviewing" sif information, is a bit too much. I would be fine, if as a start, we keep focused on the new filter and its 3 options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants