Skip to content

Commit 5da27d3

Browse files
committed
version bump
1 parent 55a5e6a commit 5da27d3

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.6.13
4+
- Only replace chars with _ when required
5+
- Added defaults to README
6+
37
## 0.6.12
48
- Dockerfile works again
59
- Fixed lrc file extension replacement

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = zotify
3-
version = 0.6.12
3+
version = 0.6.13
44
author = Zotify Contributors
55
description = A highly customizable music and podcast downloader
66
long_description = file: README.md

zotify/const.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292

9393
WINDOWS_SYSTEM = 'Windows'
9494

95+
LINUX_SYSTEM = 'Linux'
96+
9597
CODEC_MAP = {
9698
'aac': 'aac',
9799
'fdk_aac': 'libfdk_aac',

zotify/utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import requests
1313

1414
from zotify.const import ARTIST, GENRE, TRACKTITLE, ALBUM, YEAR, DISCNUMBER, TRACKNUMBER, ARTWORK, \
15-
WINDOWS_SYSTEM, ALBUMARTIST
15+
WINDOWS_SYSTEM, LINUX_SYSTEM, ALBUMARTIST
1616
from zotify.zotify import Zotify
1717

1818

@@ -258,7 +258,12 @@ def fix_filename(name):
258258
>>> all('_' == fix_filename(chr(i)) for i in list(range(32)))
259259
True
260260
"""
261-
return re.sub(r'[/\\:|<>"?*\0-\x1f]|^(AUX|COM[1-9]|CON|LPT[1-9]|NUL|PRN)(?![^.])|^\s|[\s.]$', "_", str(name), flags=re.IGNORECASE)
261+
if platform.system() == WINDOWS_SYSTEM:
262+
return re.sub(r'[/\\:|<>"?*\0-\x1f]|^(AUX|COM[1-9]|CON|LPT[1-9]|NUL|PRN)(?![^.])|^\s|[\s.]$', "_", str(name), flags=re.IGNORECASE)
263+
elif platform.system() == LINUX_SYSTEM:
264+
return re.sub(r'[/\0]', "_", str(name))
265+
else: # MacOS
266+
return re.sub(r'[/:\0]', "_", str(name))
262267

263268

264269
def fmt_seconds(secs: float) -> str:

0 commit comments

Comments
 (0)