mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 15:07:22 -06:00
Fix folder name extraction functions
It should return empty string if there is no parent folder.
This commit is contained in:
@@ -70,7 +70,7 @@ window.qBittorrent.Filesystem = (function() {
|
||||
const folderName = function(filepath) {
|
||||
const slashIndex = filepath.lastIndexOf(PathSeparator);
|
||||
if (slashIndex === -1)
|
||||
return filepath;
|
||||
return '';
|
||||
return filepath.substring(0, slashIndex);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user