immich icon indicating copy to clipboard operation
immich copied to clipboard

Feature: Read-only property for External Libraries

Open rokiden opened this issue 10 months ago • 7 comments

Closes #5449. Original thread .

This PR adds "Read Only" property for External library.

In database it stored as column "libraries.isReadOnly". This property set at library creation time and can't be modified. Asset.isReadOnly inherits library's value at creation time. At frontend it was added as toggle to "Select library owner" dialog. Mobile app doesn't require changes.

Asset modification and deletion require to check only isReadOnly property, isExternal becomes only informational.

Tested:

  • delete to trash
  • empty trash
  • modification
  • rescan of library

TODO:

  • automated tests
  • indication of ReadOnly property in web/mobile
  • ? cmdline tool to migrate library to RW mode and back

Screenshot_20240403_144638_Firefox.png

rokiden avatar Apr 21 '24 15:04 rokiden

Thanks, that's what I need most about this feature, otherwise I wouldn't even know how to do my job!

ThreeAurora avatar Apr 22 '24 12:04 ThreeAurora

Thanks! I discussed this PR with the other maintainers and we're happy with it overall, but adding that additional server-side check would be a blocker. Then I think the only other change needed would be some updates to the tests

TODO: indication of ReadOnly property in web/mobile

I believe we already have some indications such as delete being disabled for readonly assets

? cmdline tool to migrate library to RW mode and back

Probably better to make the readonly property modifiable in the UI rather than a cmdline tool, but that's probably better as a separate PR. I think this is fine for now

benmccann avatar Apr 26 '24 22:04 benmccann

Thanks for keeping an eye on this feature, we're excited to see it coming soon!

ThreeAurora avatar Apr 27 '24 04:04 ThreeAurora

#8943 seems more complete

jrasm91 avatar Apr 27 '24 12:04 jrasm91

@jrasm91 in what way does it seem more complete?

benmccann avatar Apr 27 '24 12:04 benmccann

Both look to be doing essentially the same thing. The other PR was created first, has some tests, and allows the property to be updated after the library is created.

jrasm91 avatar Apr 27 '24 14:04 jrasm91

@benmccann I've added server-side checks to update and updateAll. Also added library's isReadOnly indication using alternative icon for read-write libs: Screenshot from 2024-04-28 16-57-36

rokiden avatar Apr 28 '24 12:04 rokiden

Hey, thanks for working on this and sorry for the confusion/back and forth around this topic. Internally we have had a lot of discussions about the direction we want to take external libraries. Long story short, we decided to go ahead with the implementation laid out in #9235.

jrasm91 avatar May 03 '24 01:05 jrasm91

This is good news, for me it’s much better that the team took it upon themselves. Thanks! I was glad to help.

rokiden avatar May 03 '24 02:05 rokiden