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

Refactor file_manager, stream_info_manager #1020

Closed
kaykurokawa opened this issue Dec 5, 2017 · 1 comment
Closed

Refactor file_manager, stream_info_manager #1020

kaykurokawa opened this issue Dec 5, 2017 · 1 comment
Assignees
Labels
area: files help wanted level: 2 Some knowledge of the existing code is recommended type: refactor Minimal user-visible changes, but significant internal work

Comments

@kaykurokawa
Copy link
Contributor

a)
The file objects managed by file_manager ( EncryptedFileManager ) is hard to understand because it has some layers of unnecessary inheritance
( ManagedEncryptedFileDownloader -> EncryptedFileSaver -> EncryptedFiledDownloader -> CryptStreamDownloader )

b)
Currently, the tasks that stream_info_manager (DBEncryptedFileMetadataManager) and file_manager (EncryptedFileManager) is supposed to perform is poorly organized. stream_info_manager should be responsible for downloading streams. file_manager should be responsible for constructing files out of these streams. Currently file_manager both manages streams and the construction of files. stream_info_manager merely acts as a database to store stream information.

The primary goal should be to have e a clear distinction between streams and files. As you can have streams without files.

@kaykurokawa kaykurokawa added the type: improvement Existing (or partially existing) functionality needs to be changed label Dec 5, 2017
@lyoshenka lyoshenka added needs level help wanted type: refactor Minimal user-visible changes, but significant internal work level: 2 Some knowledge of the existing code is recommended area: files and removed needs labels type: improvement Existing (or partially existing) functionality needs to be changed labels Jan 9, 2018
@lyoshenka lyoshenka added this to the Feb 9 (protocol) milestone Jan 29, 2018
@jackrobison
Copy link
Member

jackrobison commented Feb 13, 2018

The primary goal should be to have a clear distinction between streams and files. As you can have streams without files.

#1025 refactors the stream and file creation process as well as storage in the database to do this. It does not significantly change the confusing inheritance of the lbry file classes, however it does remove redundancy of many associated functions (which are now in lbrynet.core.StreamDescriptor). The lbry file classes should be further refactored later and shouldn't require more database changes, this pr is big enough already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: files help wanted level: 2 Some knowledge of the existing code is recommended type: refactor Minimal user-visible changes, but significant internal work
Projects
None yet
Development

No branches or pull requests

3 participants