From f695f246843b2d9efc29b9923e01e4add1b463a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20W=C3=BCrfl?= Date: Wed, 30 May 2018 17:24:36 +0200 Subject: [PATCH 1/4] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 17 ++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md 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. From 5619f5cb78ed414f79488f9124a31ec48e3abb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20W=C3=BCrfl?= Date: Wed, 30 May 2018 17:59:32 +0200 Subject: [PATCH 2/4] Don't print double slashes Fixes #32 --- interface.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/interface.py b/interface.py index e5b431a..296ea7f 100644 --- a/interface.py +++ b/interface.py @@ -84,7 +84,13 @@ def index(): files = music_library.get_files_recursively(folder) else: files = music_library.get_files(folder) - files = list(map(lambda file: ('file', folder + '/' + file), files)) + files = list(map( + lambda file: ( + 'file', + os.path.join(folder, file) + ), + files + )) print('Adding to playlist: ', files) var.playlist.extend(files) elif 'delete_music' in request.form: From 32c78544f908e51723915348a226d351c636c0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20W=C3=BCrfl?= Date: Wed, 30 May 2018 19:14:32 +0200 Subject: [PATCH 3/4] utils.py: Fix not adding files correctly in some edge cases --- util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util.py b/util.py index 20c3e61..4007d2b 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): @@ -66,7 +66,7 @@ class Dir(object): 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 From f8b2cc4529dd680ad03661a1c21d3c8be8edaff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20W=C3=BCrfl?= Date: Wed, 30 May 2018 19:17:17 +0200 Subject: [PATCH 4/4] utils.py: Remove unnecessary debugging print --- util.py | 1 - 1 file changed, 1 deletion(-) diff --git a/util.py b/util.py index 4007d2b..1c4d4ed 100644 --- a/util.py +++ b/util.py @@ -60,7 +60,6 @@ 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 = []