Commit Graph

18 Commits

Author SHA1 Message Date
Diogo Peralta Cordeiro 3f61537140
[ENTITY] Split Attachment in various new entities
Remove Attachment Scope
Fixed some minor bugs

Scope will be implemented later in v3. It doesn't make sense to have
the scope handling being per attachment. Different actors can post
the same attachment with different scopes. The attachment controller
will assume the highest level of scope applied to the attachment and
the rest will be handled at the note level.

Motivation:
* Remove title from attachment, as it's part of the relation between attachment and note.
* Remove actor from attachment, many actors may publish the same attachment.
* Remove is_local from attachment,  as it's part of the relation between attachment and note.
* Remove remote_url from attachment, different urls can return the same attachment.

Addition:
* Attachment now has a lives attribute,  it's a reference counter with a nicer name
* GSActorToAttachment
* GSActorToRemoteURL
* RemoteURL
* RemoteURLToNote
* RemoteURLToAttachment
* AttachmentToNote now has a title attribute
2021-09-14 13:13:24 +01:00
Hugo Sales 39006fb6b5
[DB][Attachments] Use count function rathar than fetch and count, rename to refCount, rather than countDepencies 2021-09-14 13:13:24 +01:00
Diogo Peralta Cordeiro 21362d1e4d
[ATTACHMENTS] Add dependencies counter 2021-09-14 13:13:21 +01:00
Diogo Peralta Cordeiro 3334aca7b9
[Avatar] Move entity from core to component 2021-09-14 13:13:20 +01:00
Diogo Peralta Cordeiro 481e953cde
[Media] File quota should be triggered by the Core 2021-09-14 13:13:03 +01:00
Hugo Sales d31c3b1784
[AUTOGENERATED] Update autogenerated code 2021-09-14 13:13:01 +01:00
Hugo Sales 3fab198c04
[ENTITY] Add uniqueness constraint to Attachment::file_hash 2021-09-14 13:12:58 +01:00
Diogo Peralta Cordeiro 4fcccb1d1c
[CORE][ImageEncoder] Add width and height back in attachment entity and allow for differently sized thumbs
The strategy adopted involves predicting the thumb size as we did in v2 before having vips resize
2021-09-14 13:12:56 +01:00
Hugo Sales 7509913fcf
[ENTITY] Add field size to attachments, used for quota calculations 2021-09-14 13:12:54 +01:00
Hugo Sales e9b2b18093
[Avatar] Implement avatar deletion 2021-09-14 13:12:53 +01:00
Hugo Sales 30107de079
[Embed] Fix plugin. Only attempt to show an image, if we have one 2021-09-14 13:12:52 +01:00
Hugo Sales a7ef2babe6
[AUTOGENERATED] Update autogenerated code 2021-09-14 13:12:52 +01:00
Hugo Sales 9a7f1358c2
[ENTITY] Add utils to Attachment and AttachmentThumbnail to get the corresponding URL and html representation parameters 2021-09-14 13:12:51 +01:00
Diogo Peralta Cordeiro 0eaccc32fe
[ATTACHMENTS] Further refactoring
Some key points:
- Components and Plugins shouldn't extend Module directly
- Avatars should be fetched via GSActor ID, not by nickname as that isn't unique
- Avatar now is a separate Component
- Common file utilities are now to be placed in Core\GSFile, this will
  handle storage and trigger validation
- Some bug fixes
2021-09-14 13:11:51 +01:00
Hugo Sales 716ca063d5
[ImageThumbnail] Finish image thumbnailing functionality 2021-09-14 13:11:51 +01:00
Hugo Sales 5579f4fa5d
[MEDIA] Rename File to Attachment 2021-09-14 13:11:50 +01:00
Hugo Sales c44443b52c
[AUTOGENERATED] Update autogenerated code 2021-09-14 13:11:50 +01:00
Diogo Peralta Cordeiro e7ed325ac6
[MEDIA] Refactor File as Attachment 2021-09-14 13:11:49 +01:00