@@ -363,15 +363,23 @@ public Task<List<int>> GetFolderExistsList(Dictionary<int, int> hashNumDictionar
363
363
} ) ;
364
364
}
365
365
366
+ public async Task < bool > FileExists ( string fullPath )
367
+ {
368
+ var dataFile = IOUtil . GetDataFileFromPath ( fullPath ) ;
366
369
367
- /// <summary>
368
- /// Determines whether the given file path exists
369
- /// </summary>
370
- /// <param name="fileHash">The hashed file</param>
371
- /// <param name="folderHash">The hashed folder</param>
372
- /// <param name="dataFile">The data file</param>
373
- /// <returns>True if it exists, False otherwise</returns>
374
- public async Task < bool > FileExists ( int fileHash , int folderHash , XivDataFile dataFile )
370
+ var pathHash = HashGenerator . GetHash ( fullPath . Substring ( 0 , fullPath . LastIndexOf ( "/" , StringComparison . Ordinal ) ) ) ;
371
+ var fileHash = HashGenerator . GetHash ( Path . GetFileName ( fullPath ) ) ;
372
+ return await FileExists ( fileHash , pathHash , dataFile ) ;
373
+ }
374
+
375
+ /// <summary>
376
+ /// Determines whether the given file path exists
377
+ /// </summary>
378
+ /// <param name="fileHash">The hashed file</param>
379
+ /// <param name="folderHash">The hashed folder</param>
380
+ /// <param name="dataFile">The data file</param>
381
+ /// <returns>True if it exists, False otherwise</returns>
382
+ public async Task < bool > FileExists ( int fileHash , int folderHash , XivDataFile dataFile )
375
383
{
376
384
var indexPath = Path . Combine ( _gameDirectory . FullName , $ "{ dataFile . GetDataFileName ( ) } { IndexExtension } ") ;
377
385
0 commit comments