jpillora / media-sort

Automatically organise your movies and tv series
MIT License
120 stars 21 forks source link

allow to choose between copying, moving or linking the new files (hard and symlinks) #23

Closed rotsix closed 4 years ago

rotsix commented 4 years ago

See #17 for more informations.

jpillora commented 4 years ago

Oh and can you also re-run go run main.go --help and paste it into the README.md?

jpillora commented 4 years ago

Ah damn, I just realised we shouldn't change the existing API

https://godoc.org/github.com/jpillora/media-sort/sort#Config

Other apps might be using Hardlink, easy fix here is just to default to symlink. And also in future, they might want to set Action so we'll need to expose the enum types/consts

jpillora commented 4 years ago

Lastly, to maintain backward compatibility, Hardlink: true and Action: move (default) should automatically switch to link

rotsix commented 4 years ago

Action: move (default) should automatically switch to link

Yes, so the default behavior should be hardlinking right?

rotsix commented 4 years ago

From what I understand, to maintain backward compatibility:

This way, existing apps can use the same options.

jpillora commented 4 years ago

Yep that's right, you could also error if the user tries to set hardlink, and action to move/copy

On Sun, 7 Jun 2020 at 06:47, Victor Franzi notifications@github.com wrote:

From what I understand, to maintain backward compatibility:

  • --action defaults to move
  • --hardlink forces to link, bypassing the --action flag

This way, existing apps can use the same options.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jpillora/media-sort/pull/23#issuecomment-640116143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE2X452N4PAYPQ5Q42YKPDRVKTOZANCNFSM4NWBCOWQ .

jpillora commented 4 years ago

Cool looks good to me

rotsix commented 4 years ago

Thanks mate. That's a great tool, can't wait to use it to arrange my library.

rotsix commented 4 years ago

Note for later, Go standard library is available on Windows. I rewrote the move function to use pure stdlib and no extern calls, thus making the move, link and copy functions working on Windows too. As I don't have any Windows machine to test it, I won't regroup them, but that's worth a try.