ShokoAnime / ShokoServer

Repository for Shoko Server.
http://shokoanime.com/shoko-server/
MIT License
374 stars 74 forks source link

fix: import directory being deleted #1132

Closed Terrails closed 1 month ago

Terrails commented 1 month ago

Due to ReturnSpecialDirectories being set to true, the IEnumerable contained \\. and \\.. for current and all subdirectories. This resulted in the path with \\. at the end not being seen as equal as dropFolder.ImportFolderLocation in RecursiveDeleteEmptyDirectories. Simply setting this flag to false should resolve this and another issue like duplicate subdirectory entries. Also made the delete function run only when the IEnumerable is not empty.