Skip to content

Use a .dat folder to resume links and RC2 API (#476, #484)#485

Merged
joehand merged 1 commit intodat-ecosystem:masterfrom
joehand:dat-folder
Jun 17, 2016
Merged

Use a .dat folder to resume links and RC2 API (#476, #484)#485
joehand merged 1 commit intodat-ecosystem:masterfrom
joehand:dat-folder

Conversation

@joehand
Copy link
Copy Markdown
Collaborator

@joehand joehand commented Jun 16, 2016

General Changes

  • Uses .dat folder to resume links in the given directory (share & download)
    • Resuming a share only adds new files not in archive
    • Does not support updated files
  • Keep download connections open for both live & static (no option to close).
  • Updates tests
  • Use leveldb

API Changes

  • Updates API to use proposed RC2 version (see usage.txt)
  • Removes most options
  • Add --list option
  • Rename --static to --snapshot
  • Make live default

Output Changes

  • Update wording around dat link:
    screen shot 2016-06-16 at 10 02 30
  • Tell user when a Dat is resumed
  • Show download/share folder

@mafintosh
Copy link
Copy Markdown
Contributor

@joehand "Does not support updated files" - I need to fix this right?

@mafintosh
Copy link
Copy Markdown
Contributor

Why is there no flag to exit on content downloaded? That sounds very useful when scripting stuff.

@mafintosh
Copy link
Copy Markdown
Contributor

I actually like a separate cmd that fetches and exits more than a flag now that i think about it.

@joehand
Copy link
Copy Markdown
Collaborator Author

joehand commented Jun 16, 2016

"Does not support updated files" - I need to fix this right?

@mafintosh ya, we need to store the mtimes in hyperdrive for this. Once we have that, will be straightforward for me to check.

Why is there no flag to exit on content downloaded? That sounds very useful when scripting stuff.

Oh ya, didn't think about that use. I can add it.

@joehand
Copy link
Copy Markdown
Collaborator Author

joehand commented Jun 16, 2016

I actually like a separate cmd that fetches and exits more than a flag now that i think about it.

Ya I think that'd make sense - but do we want to support both of those? dat checkout <link>?

We could change dat get <link> to something more specific too. dat join <link>? Not sure what describes it properly (downloading, connecting, and remaining connected).

@mafintosh
Copy link
Copy Markdown
Contributor

mafintosh commented Jun 16, 2016

@joehand what about this?

  • dat share <link-or-folder> (similar to git clone / pull / push in terms or arguments). this shares the dat and keeps downloading/uploading data.
  • dat get <link-or-folder> is just for downloading. it'll fetch the data and exit. if you dat get <folder> it'll fetch updates and exit
  • dat <link-or-folder> is just a shortcut to share.

(for now share will require the 2nd destination argument as you describe above when using dat <link> but we can make the optional in the future like we've discussed)

var path = require('path')
var test = require('tape')
var rimraf = require('rimraf')
var mkdirp = require('mkdirp')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mkdirp is missing from devdeps

@joehand
Copy link
Copy Markdown
Collaborator Author

joehand commented Jun 16, 2016

  • dat share (similar to git clone / pull / push in terms or arguments). this shares the dat and keeps downloading/uploading data.
  • dat get is just for downloading. it'll fetch the data and exit. if you dat get it'll fetch updates and exit
  • dat is just a shortcut to share.

dat <link/folder> is good and like the idea. But dat share <link/folder> will be super counter-intuitive for downloads. Though I guess if we have dat get <link> then thats the easier option.

@mafintosh
Copy link
Copy Markdown
Contributor

@joehand if its easy to add again could you make it store the previously used port in level? like we did before.

@mafintosh
Copy link
Copy Markdown
Contributor

Tests are green. I'm happy. I think we should merge this into master and use it for a bit and see how it feels. @joehand before potentially merging this could you squash the commits?

@okdistribute
Copy link
Copy Markdown
Collaborator

Yeah I'm down for merging and in the next week getting some direct feedback and see where the pain points and bugs are

--port, -p set a specific inbound tcp port

dat get <dat-link> <directory>
dat <dat-link> <directory>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not dat <directory> [link] ?

@joehand
Copy link
Copy Markdown
Collaborator Author

joehand commented Jun 17, 2016

why not dat <directory> [link]?

@Karissa a few reasons we went with dat [link] <dir>:

  1. It's now dat <source> <destination> for both commands, keeping option to make destination optional in the future without breaking. Source will always be required.
  2. dat 4f36c088e9687ddf53d36f785ab84c65f4d24d8c4161950519b96a57d65ae08a joe/downloads will be much easier to share/copy command or change download directories.

@joehand
Copy link
Copy Markdown
Collaborator Author

joehand commented Jun 17, 2016

@maxogden updated with your output suggestions.

I'll smush commits and merge tomorrow (CC: @mafintosh, @Karissa).

@mafintosh
Copy link
Copy Markdown
Contributor

@joehand 🎉 LGTM 🎉

add .dat folder and use magic + share/get cmds

more dat folder work & updated tests

stop downloads after finishing

fix share with hash folder name

fix args

update list and fix download dir option

start updating tests

only add new files on resume

update cli output and better resumes

update with mafintosh comments

save port argument

remove errant log

update commands and exit on get

fix dependencies

use sync command

simplify output and update tests/readme
@joehand joehand merged commit 771569f into dat-ecosystem:master Jun 17, 2016
@joehand joehand deleted the dat-folder branch July 8, 2016 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants