-
Notifications
You must be signed in to change notification settings - Fork 35
Conversation
There's also problem with cache. Any galleries that were put to cache as external link will still be external links. Should it be cleared? |
Build fails due to #311 |
Support for reddit galleries * github.com:Tunous/Dawn: Support thumbs for gallery posts Support multi-variant preview in gallery links Don't left static image in lq gif urls Support image/jpg case Support mp4 for gifs Full might be absent in media_metadata Unlink title/description from ImgurLink Captions support GIFs support Preview with multiple variations for MediaLink Add support for media_metadata for ImageWithMultipleVariants Generalize ImageWithMultipleVariants Move ImageWithMultipleVariants to utils RedditGalleryLink Rename to MediaAlbumLink Generalize media albums Superclass for album links UrlParser branch Update synthetic Switch jraw dependency Signed-off-by: Harsh Shandilya <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also problem with cache. Any galleries that were put to cache as external link will still be external links. Should it be cleared?
Yeah I think it's ok to clear it somehow.
app/src/main/java/me/saket/dank/ui/submission/adapter/SubmissionContentLinkUiConstructor.java
Outdated
Show resolved
Hide resolved
78f5455
to
01f8a01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the cache clearing code I'm not entirely sure how it's supposed to work. Right now it appears like it would clear room database and not the media cache which seems reverse to what I would expect.
It's intended. Room database stores old serialized version of Submission without any gallery-related fields. This is the problem, not media cache.
So the main purpose of this section is clearing database when no migration happened, but it's known that db contains stale/poisoned cache
I've included routines for clearing media cache too in case that will be needed in future
I don't think it's worth over-complicating it since it's used once during initialization. I used class instead of object just as a convenient way of passing context, but on second thought, given that there is only 2 functions it can be passed as argument without any pain |
Oh, that explains a lot. |
This way it should be more intuitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for the changes. Looks good to me now 👍
This is a pretty large PR since it involved unlinking media albums from imgur.
Regarding new jraw dependency, I think its fork too should be moved in githib org as I proposed in #311.
Changes to jraw: AbsurdlySuspicious/JRAW@master...AbsurdlySuspicious:gallery
Links for testing: