ivaano/NsxLibraryManager

Rename not working, weird path reference in the error message

Closed this issue · 2 comments

Full error log at the end of this post.

  • I'm running the v0.3.1 on an fully updated Windows 10, the app is runing from A:\NsxLibraryManager\NsxLibraryManager.exe.

  • The roms are located at R:\Nintendo - Switch, it's a mapped/mounted network share pointing to \\192.168.1.40\Roms\Nintendo - Switch, but I'm using R:\Nintendo - Switch in the app options and it can find the games and updates fine, I just can't rename.

  • I have DLCs, Updates and Games, in various formats, none can be renamed, they're not even listed

  • The path C:\Users\Ivan\ shown in the error log doesn't exist on my system, it has nothing to do with my set up for the app, as I mentioned, I'm running it from A:\NsxLibraryManager\. I think it's hard-coded somehow into the program source code, instead of actually using the .exe real path of origin/execution, here's the part of the error log that mentions the non existing path:

C:\Users\Ivan\RiderProjects\NsxLibraryManager\NsxLibraryManager.Core\Services\FileInfoService.cs:line 126
         at NsxLibraryManager.Core.Services.RenamerService.GetFilesToRenameAsync(String inputPath, Boolean recursive) in C:\Users\Ivan\RiderProjects\NsxLibraryManager\NsxLibraryManager.Core\Services\RenamerService.cs:line 97
         at NsxLibraryManager.Pages.Renamer.LoadFiles() in C:\Users\Ivan\RiderProjects\NsxLibraryManager\NsxLibraryManager\Pages\Renamer.razor.cs:line 77
         at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
         at Radzen.Blazor.RadzenButton.OnClick(MouseEventArgs args)
         at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
  • Here's the full error log:
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
      Unhandled exception rendering component: No contents found in the package
      System.Exception: No contents found in the package
         at NsxLibraryManager.Core.Services.FileInfoService.GetFileInfo(String filePath, Boolean detailed) in C:\Users\Ivan\**RiderProjects\NsxLibraryManager\NsxLibraryManager.Core\Services\FileInfoService.cs:line 126
         at NsxLibraryManager.Core.Services.RenamerService.GetFilesToRenameAsync(String inputPath, Boolean recursive) in C:\Users\Ivan\**RiderProjects\NsxLibraryManager\NsxLibraryManager.Core\Services\RenamerService.cs:line 97
         at NsxLibraryManager.Pages.Renamer.LoadFiles() in C:\Users\Ivan\RiderProjects\NsxLibraryManager\NsxLibraryManager\Pages\Renamer.razor.cs:line 77
         at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
         at Radzen.Blazor.RadzenButton.OnClick(MouseEventArgs args)
         at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
      Unhandled exception in circuit '-ztuttLEBIRpn3VOWDDu1piugP45up8HzICCCSWgaLs'.
      System.Exception: No contents found in the package
         at NsxLibraryManager.Core.Services.FileInfoService.GetFileInfo(String filePath, Boolean detailed) in C:\Users\Ivan\RiderProjects\NsxLibraryManager\NsxLibraryManager.Core\Services\FileInfoService.cs:line 126
         at NsxLibraryManager.Core.Services.RenamerService.GetFilesToRenameAsync(String inputPath, Boolean recursive) in C:\Users\Ivan\RiderProjects\NsxLibraryManager\NsxLibraryManager.Core\Services\RenamerService.cs:line 97
         at NsxLibraryManager.Pages.Renamer.LoadFiles() in C:\Users\Ivan\RiderProjects\NsxLibraryManager\NsxLibraryManager\Pages\Renamer.razor.cs:line 77
         at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
         at Radzen.Blazor.RadzenButton.OnClick(MouseEventArgs args)
         at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
  • config.json
{
  "NsxLibraryManager": {
    "TitleDatabase": "A:\\NsxLibraryManager\\NsxlibraryManager.db",
    "LibraryPath": "R:\\Nintendo - Switch",
    "Recursive": true,
    "ProdKeys": "A:\\NsxLibraryManager\\keys\\prod.keys",
    "DownloadSettings": {
      "TimeoutInSeconds": 100,
      "TitleDbPath": "A:\\NsxLibraryManager\\titledb",
      "RegionUrl": "https://raw.githubusercontent.com/blawar/titledb/master/US.en.json",
      "CnmtsUrl": "https://raw.githubusercontent.com/blawar/titledb/master/cnmts.json",
      "VersionsUrl": "https://raw.githubusercontent.com/blawar/titledb/master/versions.json",
      "Base": true,
      "Dlc": true,
      "Update": true,
      "Regions": [
        "US"
      ]
    }
  }
}

Just an update, if I move the files to .\library, I can list and rename the files without any problem. Looks like the problem only occurs when I use a remote folder or a mapped drive that points to a remote folder.

Ok, after further testing, there's no problem reading from or writing to a mounted drive that points to a SMB share. It was some incompatible (or corrupt) nsp files that were messing with the software workflow and there was any type of file verification to prevent that (not that it should, I don't even know what was wrong with these files). Great software, mate. Using it with NUT and it's being a breeze now that I overcome this problem. I'm going to test using SMB/HTTP and Tinfoil probably next week.

A suggestion for renaming files

Add a way to add characters and some strings to concatenate with Template Fields. Let's say I want to add a {TitleName}, but a DLC doesn't have one (and it happens an annoying amount of times), and if I want to rename using [DLC]{TitleName}.{AppName}.[{TitleID}].nsp, If the DLC don't have a Title Name, it would end up with a file named [DLC].Some Random Game.[010101010101].nsp, so if I want to keep file names clean, I believe it would be awesome to have a way to add a char or even a string before and after a Template Field. How to implement it in a simple way, I have no idea, I'll leave that to you guys that knows coding.