Range request support for desktop #176
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
Invalid
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/lbry-redux#176
Loading…
Reference in a new issue
No description provided.
Delete branch "range-request"
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?
Changes
fileInfo
after successfulget
to populate withstreaming_url
purchasedStreamingUrls
from redux, this can now just be accessed fromfileInfo
Notes
@akinwale I still think it makes sense to combine
file
andfile_info
reducers. I think it could be valuable to keep purchase history separate, so we can persist that without persisting a user's entirefile_list
(maybe?). Maybefile
should be renamed topurchase
? Or something similar. Not a big deal now though.@akinwale Do we even need to keep track of
streamingUrls
if we can just access it infileInfo
?@ -43,0 +48,4 @@
const fileExt = extName ? `.${extName}` : null;
const testString = fileName || fileExt;
// Get mediaType from file extension
I guess there have been some changes to this in the desktop codebase and we never moved over. Just copy pasting this in so we can switch to it.
Android doesn't use the second argument for this function so changing it should be fine.
@ -43,0 +48,4 @@
const fileExt = extName ? `.${extName}` : null;
const testString = fileName || fileExt;
// Get mediaType from file extension
I also mentioned to you that the SDK now returns a stream type:
The mapping is here - I think it should be able to work with some small adjustments (glaringly missing are fbx/gcode, but not sure if anyone uses those):
41b866c1ee/lbry/lbry/schema/mime_types.py
@shockr can you review/merge before 11am meeting tomorrow?
Just a couple of issues to clarify. Everything else looks good.
@ -5,57 +5,70 @@ import { doToast } from 'redux/actions/notifications';
import { selectBalance } from 'redux/selectors/wallet';
import { makeSelectFileInfoForUri, selectDownloadingByOutpoint } from 'redux/selectors/file_info';
import { makeSelectStreamingUrlForUri } from 'redux/selectors/file';
import { makeSelectClaimForUri } from 'redux/selectors/claims';
Since
doPurchaseUri
also dispatches the same action, how do we differentiate between the two? I recall using a different action here because it's possible for a purchase to fail due to insufficient credits, the wallet being locked or some other condition, soget
doesn't actually get called in those scenarios.Can a file be considered downloaded where just
blobs_completed > 0
? I believe it's also possible for streamed files to meet the conditionblobs_completed > 0
, but I'll have to test this to be sure.The way we have been using this selector in the past is
is any part of it downloaded
. Possibly we should add another calledselectFileInfosCompletelyDownloaded
? Or something similar.@ -5,57 +5,70 @@ import { doToast } from 'redux/actions/notifications';
import { selectBalance } from 'redux/selectors/wallet';
import { makeSelectFileInfoForUri, selectDownloadingByOutpoint } from 'redux/selectors/file_info';
import { makeSelectStreamingUrlForUri } from 'redux/selectors/file';
import { makeSelectClaimForUri } from 'redux/selectors/claims';
Ah that's a good point. I just searched for
LOADING_FILE_
and didn't find anything so I figured it wasn't needed. That does make sense to have two though. I'll add it back. MaybeGET_FILE_XXX
to signal that it's specifically forget
calls?@ -5,57 +5,70 @@ import { doToast } from 'redux/actions/notifications';
import { selectBalance } from 'redux/selectors/wallet';
import { makeSelectFileInfoForUri, selectDownloadingByOutpoint } from 'redux/selectors/file_info';
import { makeSelectStreamingUrlForUri } from 'redux/selectors/file';
import { makeSelectClaimForUri } from 'redux/selectors/claims';
GET_FILE_XXX
sounds perfect.That makes sense so it's fine as is. For completely downloaded, the condition would have to be something like
fileInfo.completed || fileInfo.written_bytes >= fileInfo.total_bytes
.