removed dots from the beginning of files and paths tu unhide file system elements on linux/unix like systems

This commit is contained in:
Lars Noack 2022-11-11 07:57:56 +01:00
parent cc16c3f26e
commit a5c8e6f051

View File

@ -1,6 +1,16 @@
import os.path import os.path
import logging import logging
UNHIDE_CHAR = ','
def unhide(part: str):
if len(part) == 0:
return ""
if part[0] == ".":
part[0] = UNHIDE_CHAR
return part
class UrlPath: class UrlPath:
def __init__(self, database, logger: logging.Logger, genre: str): def __init__(self, database, logger: logging.Logger, genre: str):
@ -25,7 +35,7 @@ class UrlPath:
self.get_album(row)) self.get_album(row))
def escape_part(self, part: str): def escape_part(self, part: str):
return part.replace("/", " ") return unhide(part.replace("/", " "))
def get_genre(self): def get_genre(self):
return self.escape_part(self.genre) return self.escape_part(self.genre)