added comment & TODO to recode SymlinkName one day

This commit is contained in:
2021-06-22 18:42:03 +10:00
parent 2d4f63212c
commit 9eb82bf1c3
2 changed files with 9 additions and 0 deletions

1
TODO
View File

@@ -20,6 +20,7 @@
* Dir can have date in the DB, so we can do Oldest/Newest dirs in Folder view * Dir can have date in the DB, so we can do Oldest/Newest dirs in Folder view
### BACKEND ### BACKEND
* revisit SymlinkName() and make it simpler (see comment in shared.py)
-- started on some basic optimisations (commit logs every 100 logs, not each log) -- started on some basic optimisations (commit logs every 100 logs, not each log)
- with debugs: import = 04:11, getfiledetails== 0:35:35 - with debugs: import = 04:11, getfiledetails== 0:35:35
- without debugs: import == 04:03, getfiledetails == 0:35:36 -- not a sig diff - without debugs: import == 04:03, getfiledetails == 0:35:36 -- not a sig diff

View File

@@ -53,6 +53,14 @@ def LocationIcon(obj):
# translate a path type, a full FS path and a file into the full FS path of the
# symlink on the file system. To note, this is used with file == path, when we
# want to just get the symlink to the path itself, otherwise file == <path/some_filename>
### FIXME: I think this is way over-complicated, want to revist one day, with
#what params are passed in, what we need to get out -- I think the overloaded
#file/oath use case, and why sometimes we trail with a / or not and then concat
#last_dir and bit before last_dir, etc. this feels a bit too complicated for
#what it does OR we comment this much better
def SymlinkName(ptype, path, file): def SymlinkName(ptype, path, file):
sig_bit=file.replace(path, "") sig_bit=file.replace(path, "")
last_dir=os.path.basename(path[0:-1]) last_dir=os.path.basename(path[0:-1])