Compare commits
5 Commits
1dc0d470dd
...
main
Author | SHA1 | Date | |
---|---|---|---|
d26b1cfe46
|
|||
6e10a30c48
|
|||
ebff41e016
|
|||
c357cfb6a5
|
|||
945c69baf0
|
@ -48,8 +48,11 @@ def download(url, bitrate, portable, path):
|
||||
arl = f.readline().rstrip("\n").strip()
|
||||
if not dz.login_via_arl(arl): arl = requestValidArl()
|
||||
else: arl = requestValidArl()
|
||||
try:
|
||||
with open(configFolder / '.arl', 'w', encoding="utf-8") as f:
|
||||
f.write(arl)
|
||||
except:
|
||||
print(f"Error opening {configFolder / '.arl'}, continuing anyway.")
|
||||
|
||||
plugins = {}
|
||||
if Spotify:
|
||||
|
@ -51,7 +51,7 @@ DEFAULTS = {
|
||||
"localArtworkSize": 1400,
|
||||
"logErrors": True,
|
||||
"logSearched": False,
|
||||
"maxBitrate": str(TrackFormats.MP3_320),
|
||||
"maxBitrate": TrackFormats.MP3_320,
|
||||
"overwriteFile": OverwriteOption.DONT_OVERWRITE,
|
||||
"paddingSize": "0",
|
||||
"padTracks": True,
|
||||
@ -125,13 +125,17 @@ def load(configFolder=None):
|
||||
except Exception:
|
||||
settings = deepcopy(DEFAULTS)
|
||||
|
||||
if check(settings) > 0: save(settings, configFolder) # Check the settings and save them if something changed
|
||||
if check(settings) > 0:
|
||||
try:
|
||||
save(settings, configFolder) # Check the settings and save them if something changed
|
||||
except:
|
||||
print(f"Error saving config file {configFile.name}, continuing without saving.")
|
||||
return settings
|
||||
|
||||
def check(settings):
|
||||
changes = 0
|
||||
for i_set in DEFAULTS:
|
||||
if not i_set in settings or not isinstance(settings[i_set], type(DEFAULTS[i_set])):
|
||||
if not i_set in settings or not type(settings[i_set] is type(DEFAULTS[i_set])):
|
||||
settings[i_set] = DEFAULTS[i_set]
|
||||
changes += 1
|
||||
for i_set in DEFAULTS['tags']:
|
||||
|
21
shell.nix
Normal file
21
shell.nix
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
}:
|
||||
|
||||
pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.python312
|
||||
pkgs.python312Packages.virtualenv
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
if [ ! -d .venv ]; then
|
||||
virtualenv .venv
|
||||
. .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
pip install -e .
|
||||
else
|
||||
. .venv/bin/activate
|
||||
fi
|
||||
'';
|
||||
}
|
Reference in New Issue
Block a user