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

[Bug] Scanning does not remove deleted files from files.json #297

Closed
eskay993 opened this issue Mar 30, 2021 · 13 comments · Fixed by #327
Closed

[Bug] Scanning does not remove deleted files from files.json #297

eskay993 opened this issue Mar 30, 2021 · 13 comments · Fixed by #327
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@eskay993
Copy link

Describe the bug
If you remove or rename a file from your game path, it is not removed from files.json when you next scan.

To Reproduce

  1. Remove a file from your game path
  2. Run headless using python nut.py -S
  3. Perform a new scan using /api/scan or /api/search

Actual behaviour
Removed game still appears in the list when using tinfoil on Switch over LAN. Game still also remains in files.json.

Expected behaviour
Games removed from game path should be removed from files.json, and no longer appear in tinfoil Switch.

NUT version (or git hash):
3.1 release, and latest github src.

Additional context:
Honestyly, not sure if this is a bug or a feature request :) as there is a function to remove games from files.json. It's just never called from the scan function. Also noticed a watcher.py file so I imagine this is something you're working on.

I added this hacky and noobish code to Nsps.scan(base) to test functionality and it works great.

for file, items in list(files.items()):
  if (not os.path.isfile(file)):
    print('removed: ' + file)
    unregisterFile(file)

Is this functionality you are looking to add in in future? Or is unregisterFile still being tested and not ready for prime time?

Many thanks.

@eskay993 eskay993 added the bug Something isn't working label Mar 30, 2021
@introkun
Copy link
Collaborator

I fixed a similar issue in the past. Let me see

@introkun
Copy link
Collaborator

Fixed previously in #192

@introkun
Copy link
Collaborator

And here, but only for GUI df56fe4

@introkun introkun added the good first issue Good for newcomers label Apr 13, 2021
@JordsFalckh
Copy link

I have also been experiencing this issue on the GUI version 3.1. Scan won't remove old versions. I have to manually remove the NUT folders and restart from scratch to remove them.

@blawar
Copy link
Owner

blawar commented Jun 23, 2021

@JordsFalckh you can just delete files.json next time. Will investigate.

@JordsFalckh
Copy link

JordsFalckh commented Jun 24, 2021 via email

@ghost ghost closed this as completed Jul 15, 2021
@introkun
Copy link
Collaborator

It happens again. Latest commit in master is affected 23df047

@forrany
Copy link

forrany commented Mar 18, 2022

@JordsFalckh you can just delete files.json next time. Will investigate.

The same issue on latest version nut_gui

and can't find the files.json file

@baddog-11
Copy link

Its 2023 I still have this problem with Nuts 3.3

@madmax2
Copy link

madmax2 commented Sep 9, 2023

problem still occur on Nut 3.3

What is the solution?

@madmax2
Copy link

madmax2 commented Sep 9, 2023

the program should add a clear cache button that deletes that files.json file whenever this problem occurs.

@nogagreflex
Copy link

Did anyone figure out a resolution to this?

@madmax2
Copy link

madmax2 commented Oct 9, 2023

@nogagreflex no official solution, I suggested feature request = clear cache button
#476

Current workaround solution =
you need to manually delete files.json (or create a batch file to do this) in nut folder and rescan in nut program

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants