Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Both options on importing save data do the same thing #16

Closed
drinfernoo opened this issue Aug 29, 2018 · 8 comments
Closed

Both options on importing save data do the same thing #16

drinfernoo opened this issue Aug 29, 2018 · 8 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@drinfernoo
Copy link
Collaborator

When importing save data, both options make you go through the list and choose for each one.

@drinfernoo drinfernoo self-assigned this Aug 29, 2018
@drinfernoo
Copy link
Collaborator Author

It appears that each option functions as intended, but if you choose "No Ask", files get replaced no matter what you choose.

@drinfernoo
Copy link
Collaborator Author

This is in the method manageSaveData on line 2097 in default.py.

@drinfernoo
Copy link
Collaborator Author

@irbyjm, any progress?

@irbyjm
Copy link

irbyjm commented Dec 21, 2018

@drinfernoo I might have had this fixed in an earlier commit but then dumped it because I misinterpreted what was supposed to happen. Can you validate my thought process?

Is it supposed to:

  • Ask if you want to overwrite
  • If yes, completely overwrite the file (then regex replace with traktIt('restore'))
  • If no, only regex replace?

I am still wrapping my head around default.py's

                shutil.copy(temp, old)
            traktit.importlist('all')
            traktit.traktIt('restore', 'all')

traktit.py's traktIt()

					if user == '' and do == 'update': continue
					updateTrakt(do, log)

and traktit.py's updateTrakt()

	elif do == 'restore':

Which looks like no matter what you choose for overwrite, traktIt() tells updateTrakt() to do a restore. But I've been doing a watch ls to look for file modification, not thinking about the scenario that the file doesn't get overwritten but a regex happens anyway (which causes mtime to change).

@drinfernoo
Copy link
Collaborator Author

I need to dig into it more as well, as I'm not exactly sure how it's supposed to work, but that's my understanding as well.

@drinfernoo
Copy link
Collaborator Author

drinfernoo commented Dec 22, 2018

This is the relevant code related to Trakt importing, from default.py.

https://github.com/drinfernoo/plugin.program.aftermath/blob/6001f3c5f069665c1013ca392974e2581567813c/default.py#L2124-L2139

It appears that what this does is: on line 2129, loops through all the files in the temp/trakt folder, and on line 2137, copies them in regardless of whether overwrite (from line 2124) is even set or not. Then, on lines 2137-2138, it imports all of the files into the wizard, and updates all of the saved data.

If we can fix this for Trakt, we can also fix it for debrid and login saving, since the code is identical.

@drinfernoo drinfernoo transferred this issue from another repository Mar 2, 2019
@drinfernoo drinfernoo added bug Something isn't working help wanted Extra attention is needed labels Mar 2, 2019
@drinfernoo drinfernoo added this to the 0.7.0 milestone Mar 2, 2019
@drinfernoo
Copy link
Collaborator Author

This will hopefully become simpler if modular add-on support is implemented, as mentioned in #32.

@drinfernoo
Copy link
Collaborator Author

Closed for inactivity. Much of this code is outdated and needs to be fixed up anyways.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants