Common subscriptions implementation #19
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
dependencies
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbryinc#19
Loading…
Reference in a new issue
No description provided.
Delete branch "subscriptions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -29,6 +29,7 @@
},
"dependencies": {
"lbry-redux": "lbryio/lbry-redux#84b7d396934d57a37802aadbef71db91230a9404",
"bluebird": "^3.5.1",
What does Bluebird provide that native promises and
async
/await
don't?It looks like much of Bluebird was not developed with
async
/await
in mind.I do not see Bluebird utilized in this PR
@ -3,1 +4,4 @@
export const GENERATE_AUTH_TOKEN_SUCCESS = 'GENERATE_AUTH_TOKEN_SUCCESS';
// Claims
export const FETCH_FEATURED_CONTENT_STARTED = 'FETCH_FEATURED_CONTENT_STARTED';
We have so many of these repeated, we should consider using generators for
_STARTED
/_COMPLETED
/_FAILED
@ -0,0 +48,4 @@
// We also only care about top_subscribed and featured
// top_bid could just be porn or a channel with no content
const topSubscribedSuggestions = swapKeyAndValue(suggested[SUGGESTED_TOP_SUBSCRIBED]);
I need to take a closer look at why
swapKeyAndValue
is required in this context for sorting, I will revisit this PRThe app currently uses it's own
doFetchClaimsByChannel
to set the latest piece of content for a channel. We use that to know if we should download new content for a user.https://github.com/lbryio/lbry-desktop/blob/master/src/renderer/redux/actions/content.js#L289-L331
Maybe we should create a new function in
lbryinc
that usesdoFetchClaimsByChannel
fromlbry-redux
with a callback, then sets the subscription? I'm not sure of the best way to do it.Also, does android even need to do this? I know you are more pressed on storage than the desktop app is.
@ -29,6 +29,7 @@
},
"dependencies": {
"lbry-redux": "lbryio/lbry-redux#84b7d396934d57a37802aadbef71db91230a9404",
"bluebird": "^3.5.1",
It's used in
src/redux/actions/subscriptions.js
.@ -3,1 +4,4 @@
export const GENERATE_AUTH_TOKEN_SUCCESS = 'GENERATE_AUTH_TOKEN_SUCCESS';
// Claims
export const FETCH_FEATURED_CONTENT_STARTED = 'FETCH_FEATURED_CONTENT_STARTED';
These were taken directly from the
lbry-desktop
repo. I suppose we could address these changes in a future PR.@ -0,0 +48,4 @@
// We also only care about top_subscribed and featured
// top_bid could just be porn or a channel with no content
const topSubscribedSuggestions = swapKeyAndValue(suggested[SUGGESTED_TOP_SUBSCRIBED]);
@seanyesmunt Any insight on this one? It's from the
lbry-desktop
repo, so I assume there's a reason this is being used.@ -0,0 +48,4 @@
// We also only care about top_subscribed and featured
// top_bid could just be porn or a channel with no content
const topSubscribedSuggestions = swapKeyAndValue(suggested[SUGGESTED_TOP_SUBSCRIBED]);
The comment is pretty much all there is to it. Swapping the value and key so
uri
was the key made it a lot simpler (but still confusing) because I could just check if the subscription existed withWithout swapping I wasn't sure how to do that without a bunch of loops every time I needed to check.
@ -0,0 +48,4 @@
// We also only care about top_subscribed and featured
// top_bid could just be porn or a channel with no content
const topSubscribedSuggestions = swapKeyAndValue(suggested[SUGGESTED_TOP_SUBSCRIBED]);
Very much open to new ideas/reworking this if you know a simpler way.
Just realized there are a couple things commented out. I will update the app/fix these lines so that they are only performed based on params passed in.