-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Added support for moving games between disks #532
base: master
Are you sure you want to change the base?
Conversation
Used `[shutil.move()](https://docs.python.org/3/library/shutil.html#shutil.move)` instead of `os.rename()` to add support for moving games to different disks.
This is a helper function for implementing a progress indication in the moving games between disks functionality
Moving between disks can take a long time and before there was no progress indication so the user might think that the program was stuck but I have added it now
legendary/cli.py
Outdated
choice = get_boolean_choice(f'Moving files to another drive can cause errors when running the game, ' | ||
f'however, it is unlikely to happen. Do you still wish to continue? (default=no)', default=False) | ||
if not choice: | ||
logger.info(f'To move it without a risk move the folder manually to {new_path} ' | ||
f'and run "legendary move {app_name} "{args.new_path}" --skip-move"') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels somewhat vague. What exactly are those errors/risks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I don't know. I thought that because this was not done before there must be a reason for it. On python docs I found that this function may or may not copy the metadata so I thought that must've been the reason but I've had 0 problems after trying it with 3-4 games so I'm sure it can be removed.
I think I'm done with this PR for now so we can discuss anything further (if needed) or it could be merged. |
This seems like a genuinely useful addition
I don't think there are going to any errors/risks with moving most games since they most likely use relative paths |
And cleaned up the code a bit
I worked on making moving games resumable and cleaned up the code. |
Thanks but I don't think I want to add more features at this time. There's a lot of refactoring that needs to be done and it'll break all PRs anyway. But I'll leave it open for now. |
I'd support this PR. Relatively small change, and hard to see any major risk. The code to track progress looks pretty complicated however. Can't just use something like tqdm?And what about a comparison of files after the copy to be sure. Perhaps using something like the below.
|
Was just looking for this feature to move a game and found this ticket. Is this going to be implemented? If not, how to I go about moving my game? Should I just copy the game folder to another drive and then import into legendary again? |
I wrote something quick and dirty which serves my needs (https://github.com/buswedg/epic-library-manager), including being able to move to a mounted network location. Did the same for Amazon Games and Steam as well. I've got a todo to look at the sync functionality on legendary and nile at some point, to see how its config (and the launchers manifest) can be updated post-move. But I've got a lot on at the moment, so not sure when I'll be able to get this done. |
Used
shutil.move()
instead ofos.rename()
to add support for moving games to different disks. May or may not copy metadata but it should be fine since file metadata isn't really necessary as far as I am aware.