Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): read-write external assets #9235

Merged
merged 4 commits into from
May 3, 2024
Merged

Conversation

jrasm91
Copy link
Contributor

@jrasm91 jrasm91 commented May 3, 2024

Breaking change: external libraries and associated assets are no longer read only and can now be deleted.

After a bunch of back and forth within the developer team, this is the final implementation we landed on:

  • Make external assets read/writeable, including able to be deleted.
  • Trashing an external asset works like normal and all associated files will be deleted, unless they are mounted as RO
  • drops the isReadOnly column
  • deprecates the isExternal and isReadOnly asset response properties
  • unrelated, but adds a generated sql for adjusting a user's quota (saw that it was missing)

Supersedes: #9188, #8992, #8943
Closes: #5449
Reference: #8438

Copy link

cloudflare-pages bot commented May 3, 2024

Deploying immich with  Cloudflare Pages  Cloudflare Pages

Latest commit: 05ee1bf
Status: ✅  Deploy successful!
Preview URL: https://f8557e62.immich.pages.dev
Branch Preview URL: https://feat-rw-external-assets.immich.pages.dev

View logs

@@ -106,9 +106,6 @@ export class AssetEntity {
@Column({ type: 'boolean', default: false })
isExternal!: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed you removed this from the open API definition. Do we still need it here? If you end up making your change to have null libraryId indicate an upload library then this becomes redundant because you can just check if there's a library id present or not

@ThreeAurora
Copy link

Thank you so much for all the work you've done on the external libraries, it's the feature I need most at the moment and it's finally here!

@@ -113,6 +113,7 @@ export const DummyValue = {
PAGINATION: { take: 10, skip: 0 },
EMAIL: 'user@immich.app',
STRING: 'abcdefghi',
NUMBER: 50,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
NUMBER: 50,
NUMBER: 42,

Missed opportunity ;)

@@ -170,7 +170,7 @@ export class StorageTemplateService {
}

async moveAsset(asset: AssetEntity, metadata: MoveAssetMetadata) {
if (asset.isReadOnly || asset.isExternal || StorageCore.isAndroidMotionPath(asset.originalPath)) {
if (asset.isExternal || StorageCore.isAndroidMotionPath(asset.originalPath)) {
// External assets are not affected by storage template
// TODO: shouldn't this only apply to external assets?
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TODO: shouldn't this only apply to external assets?

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, yeah need to write something explaining why android motion path ones are skipped as well

@jrasm91 jrasm91 merged commit 5b87abb into main May 3, 2024
22 of 23 checks passed
@jrasm91 jrasm91 deleted the feat/rw-external-assets branch May 3, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change external-library Issues related to external libraries 🗄️server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants