diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..80c49db --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**Affected version** +The exact version you're using (git commit id). You should **always** only report bugs which you can reproduce on the latest version (`uif` branch), however **always** state the current commit id here (in case there are new commits between your report and us looking at it) + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..066b2d9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/interface.py b/interface.py index 1610f6b..98e82a2 100644 --- a/interface.py +++ b/interface.py @@ -85,7 +85,7 @@ def index(): files = music_library.get_files_recursively(folder) else: files = music_library.get_files(folder) - files = list(map(lambda file: ('file', folder + '/' + file, datetime.now().timestamp()), files)) + files = list(map(lambda file: ('file', os.path.join(folder, file), datetime.now().timestamp()), files)) print('Adding to playlist: ', files) var.playlist.extend(files) elif 'delete_music' in request.form: diff --git a/util.py b/util.py index 20c3e61..1c4d4ed 100644 --- a/util.py +++ b/util.py @@ -9,7 +9,7 @@ import zipfile def get_recursive_filelist_sorted(path): filelist = [] for root, dirs, files in os.walk(path): - relroot = root.replace(path, '') + relroot = root.replace(path, '', 1) if relroot != '' and relroot in var.config.get('bot', 'ignored_folders'): continue if len(relroot): @@ -60,13 +60,12 @@ class Dir(object): def __init__(self, path): self.name = os.path.basename(path.strip('/')) self.fullpath = path - print(self.name, self.fullpath) self.subdirs = {} self.files = [] def add_file(self, file): if file.startswith(self.name + '/'): - file = file.replace(self.name + '/', '') + file = file.replace(self.name + '/', '', 1) if '/' in file: # This file is in a subdir