a1ex4 / ownfoil

Lightweight and customizable Tinfoil Shop manager, with automatic saves backup.
BSD 3-Clause "New" or "Revised" License
311 stars 32 forks source link

Saves Manager fails to backup files and attempts to reconnect indefinitely #41

Closed CortezSMz closed 9 months ago

CortezSMz commented 9 months ago

Saves Manager fails to backup files and attempts to reconnect indefinitely.

I've traced the issue to it assuming that all the save files are in a 1 level folder, where most of them - in my experience - are nested in other folders.

I'm already working on a PR to fix.

For example, the following save folder structure:

JKSV/
└── Bayonetta 3/
    ├── Profile1 - 2023.09.18 @ 16.26.21/
    │   ├── GameData.dat
    │   └── SlotData_0.dat
    └── Profile2 - 2023.09.18 @ 16.26.21/
        ├── GameData.dat
        └── SlotData_0.dat

Retrieves the following to my volume:

JKSV/
└── Bayonetta 3/
    └── Profile1 - 2023.09.18 @ 16.26.21      <-- this should be a folder, but it's a file

and then on the logs:

2023-09-20 16:54:22,577 - INFO apscheduler.executors.default: Running job "Backup saves (trigger: interval[0:10:00], next run at: 2023-09-20 16:54:22 UTC)" (scheduled at 2023-09-20 16:54:22.551818+00:00)
2023-09-20 16:54:22,620 - INFO save_manager: Successfully connected to Switch device on host 192.168.1.9.
2023-09-20 16:54:22,620 - INFO save_manager: Retrieving saves from /switch/DBI/saves to /games/Saves/Xance/DBI
2023-09-20 16:54:22,709 - INFO save_manager: Retrieving saves from /JKSV to /games/Saves/Xance/JKSV
2023-09-20 16:54:22,794 - INFO save_manager: Scanning /JKSV/Bayonetta 3
2023-09-20 16:54:22,886 - INFO save_manager: Lost connection, attempting reconnect in 10s...
2023-09-20 16:54:32,918 - INFO save_manager: Lost connection, attempting reconnect in 10s...
2023-09-20 16:54:42,950 - INFO save_manager: Lost connection, attempting reconnect in 10s...
2023-09-20 16:54:52,986 - INFO save_manager: Lost connection, attempting reconnect in 10s...

And for another example, this heavy nested folder structure:

JKSV/
└── Hades/
    └── Profile1/
        ├── Data Dumps/
        │   └── .
        ├── Data Records/
        │   └── .
        ├── Saved Games/
        │   └── Hades/
        │       ├── ActiveProfile
        │       ├── Profile1.ctrls
        │       ├── Profile1.sav
        │       ├── Profile1.sjson
        │       ├── Profile1.v.sav
        │       └── Profile1_Temp.sav
        ├── Screenshots/
        │   └── .
        └── Temp/
            └── .

Retrieves:

JKSV/
└── Hades/
    └── .     <-- empty folder

And on the logs:

2023-09-20 17:35:49,670 - INFO apscheduler.scheduler: Added job "Backup saves" to job store "default"
2023-09-20 17:35:49,670 - INFO apscheduler.scheduler: Scheduler started
2023-09-20 17:35:49,675 - INFO apscheduler.executors.default: Running job "Backup saves (trigger: interval[0:10:00], next run at: 2023-09-20 17:35:49 UTC)" (scheduled at 2023-09-20 17:35:49.657216+00:00)
2023-09-20 17:35:49,834 - INFO save_manager: Successfully connected to Switch device on host 192.168.1.9.
2023-09-20 17:35:49,834 - INFO save_manager: Retrieving saves from /JKSV/Hades to /games/Saves/Xance/JKSV/Hades
2023-09-20 17:35:49,926 - INFO apscheduler.executors.default: Job "Backup saves (trigger: interval[0:10:00], next run at: 2023-09-20 17:45:49 UTC)" executed successfully