mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
fix: absolute config path not resolving
+ skip through empty directories in folder browser + handle timestamp table error in migration
This commit is contained in:
@@ -33,10 +33,9 @@ def create_hash(*args: str, decode=False, limit=10) -> str:
|
||||
|
||||
str_ = str_.encode("utf-8")
|
||||
str_ = hashlib.sha1(str_).hexdigest()
|
||||
# REVIEW Switched to sha1 hashlib.sha256(str_).hexdigest()
|
||||
|
||||
# REVIEW Take the first limit/2 and last limit/2 characters
|
||||
# This is to avoid collisions
|
||||
return str_[:limit // 2] + str_[-limit // 2:] if limit % 2 == 0 else str_[:limit // 2] + str_[-limit // 2 - 1:]
|
||||
|
||||
# return str_[-limit:]
|
||||
return (
|
||||
str_[: limit // 2] + str_[-limit // 2 :]
|
||||
if limit % 2 == 0
|
||||
else str_[: limit // 2] + str_[-limit // 2 - 1 :]
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
|
||||
|
||||
def get_xdg_config_dir():
|
||||
def get_xdg_config_dir() -> str:
|
||||
"""
|
||||
Returns the XDG_CONFIG_HOME environment variable if it exists, otherwise
|
||||
returns the default config directory. If none of those exist, returns the
|
||||
@@ -19,3 +19,6 @@ def get_xdg_config_dir():
|
||||
return alt_dir
|
||||
except TypeError:
|
||||
return os.path.expanduser("~")
|
||||
|
||||
# Fallback to current directory
|
||||
return os.path.abspath(".")
|
||||
|
||||
Reference in New Issue
Block a user