Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Commit

Permalink
Update 0.8.8
Browse files Browse the repository at this point in the history
Changelog:
+Removed old stuff
~Improved search function
  • Loading branch information
MateuszPerczak committed May 29, 2022
1 parent 71ee7d0 commit 34c0c07
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 69 deletions.
4 changes: 0 additions & 4 deletions src/.dockerignore

This file was deleted.

5 changes: 0 additions & 5 deletions src/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions src/Dockerfile.dev

This file was deleted.

50 changes: 50 additions & 0 deletions src/Resources/Dumps/sounder_dump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,53 @@ Traceback (most recent call last):
File "e:/Python/New Projects/Sounder5/Sounder5.py", line 1720, in mixer_play
mixer.music.play(start=start)
pygame.error: Position not implemented for music type
ERROR:root:can't multiply sequence by non-int of type 'float'
Traceback (most recent call last):
File "e:/Python/New Projects/Sounder5/Sounder5.py", line 1456, in sort_panels
print(song, score, score * "-")
TypeError: can't multiply sequence by non-int of type 'float'
ERROR:root:can't multiply sequence by non-int of type 'float'
Traceback (most recent call last):
File "e:/Python/New Projects/Sounder5/Sounder5.py", line 1456, in sort_panels
print(song, score, score * "-")
TypeError: can't multiply sequence by non-int of type 'float'
ERROR:root:can't multiply sequence by non-int of type 'float'
Traceback (most recent call last):
File "e:/Python/New Projects/Sounder5/Sounder5.py", line 1456, in sort_panels
print(song, score, score * "-")
TypeError: can't multiply sequence by non-int of type 'float'
ERROR:root:can't multiply sequence by non-int of type 'float'
Traceback (most recent call last):
File "e:/Python/New Projects/Sounder5/Sounder5.py", line 1456, in sort_panels
print(song, score, score * "-")
TypeError: can't multiply sequence by non-int of type 'float'
ERROR:root:local variable 'sensitivity' referenced before assignment
Traceback (most recent call last):
File "e:/Python/New Projects/Sounder5/Sounder5.py", line 1449, in sort_panels
if score > sensitivity:
UnboundLocalError: local variable 'sensitivity' referenced before assignment
ERROR:root:local variable 'sensitivity' referenced before assignment
Traceback (most recent call last):
File "e:/Python/New Projects/Sounder5/Sounder5.py", line 1449, in sort_panels
if score > sensitivity:
UnboundLocalError: local variable 'sensitivity' referenced before assignment
ERROR:root:local variable 'sensitivity' referenced before assignment
Traceback (most recent call last):
File "e:/Python/New Projects/Sounder5/Sounder5.py", line 1449, in sort_panels
if score > sensitivity:
UnboundLocalError: local variable 'sensitivity' referenced before assignment
ERROR:root:local variable 'sensitivity' referenced before assignment
Traceback (most recent call last):
File "e:/Python/New Projects/Sounder5/Sounder5.py", line 1449, in sort_panels
if score > sensitivity:
UnboundLocalError: local variable 'sensitivity' referenced before assignment
ERROR:root:local variable 'sensitivity' referenced before assignment
Traceback (most recent call last):
File "e:/Python/New Projects/Sounder5/Sounder5.py", line 1449, in sort_panels
if score > sensitivity:
UnboundLocalError: local variable 'sensitivity' referenced before assignment
ERROR:root:local variable 'tokens' referenced before assignment
Traceback (most recent call last):
File "e:/Python/New Projects/Sounder5/Sounder5.py", line 1434, in sort_panels
self.settings['search_compensation'] * (tokens - 1))
UnboundLocalError: local variable 'tokens' referenced before assignment
63 changes: 23 additions & 40 deletions src/Sounder5.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from typing import Union
import ctypes
from time import sleep
from autocorrect import Speller
except ImportError as err:
exit(err)

Expand Down Expand Up @@ -124,10 +123,10 @@ def init_notifications(self: Tk) -> None:
def init_settings(self: Tk) -> None:
try:
# variables
default_settings: dict = {'search_correction': True, 'played_percent': 2, 'menu_position': 'left', 'search_compensation': 0.7, 'delete_missing': False, 'follow': 1, 'crossfade': 100, 'shuffle': False, 'start_playback': False, 'playlist': 'Library', 'repeat': 'None', 'buffer': 'Normal', 'last_song': '',
default_settings: dict = {'played_percent': 2, 'menu_position': 'left', 'search_compensation': 0.7, 'delete_missing': False, 'follow': 1, 'crossfade': 100, 'shuffle': False, 'start_playback': False, 'playlist': 'Library', 'repeat': 'None', 'buffer': 'Normal', 'last_song': '',
'volume': 0.5, 'sort_by': 'A-Z', 'scan_subfolders': False, 'geometry': '800x500', 'wheel_acceleration': 1.0, 'updates': True, 'folders': [], 'use_system_theme': True, 'theme': 'Light', 'page': 'Library', 'playlists': {'Favorites': {'Name': 'Favorites', 'Songs': []}}}
self.settings: dict = {}
self.version: tuple = ('0.8.7', '270522')
self.version: tuple = ('0.8.8', '300522')
# load settings
if isfile(r'Resources\\Settings\\Settings.json'):
with open(r'Resources\\Settings\\Settings.json', 'r') as data:
Expand Down Expand Up @@ -334,7 +333,6 @@ def load_icons(self: Tk) -> None:
'navigation': PhotoImage(file=fr'Resources\\Icons\\{self.settings["theme"]}\\navigation.png'),
'passed': PhotoImage(file=fr'Resources\\Icons\\{self.settings["theme"]}\\passed_time.png'),
'bug': PhotoImage(file=fr'Resources\\Icons\\{self.settings["theme"]}\\bug.png'),
'spell': PhotoImage(file=fr'Resources\\Icons\\{self.settings["theme"]}\\spell.png'),
}
self.iconbitmap(
fr'Resources\\Icons\\{self.settings["theme"]}\\icon.ico')
Expand Down Expand Up @@ -363,9 +361,6 @@ def init_ui(self: Tk) -> None:
# search compensation
self.search_compensation: DoubleVar = DoubleVar(
value=self.settings['search_compensation'])
# search correction
self.search_correction: BooleanVar = BooleanVar(
value=self.settings['search_correction'])
# scan subfolders
self.scan_subfolders: BooleanVar = BooleanVar(
value=self.settings['scan_subfolders'])
Expand Down Expand Up @@ -682,28 +677,15 @@ def init_ui(self: Tk) -> None:
# search tolerance
settings_tolerance: ttk.Frame = ttk.Frame(
self.player_content, style='second.TFrame')
tolerance_panel: ttk.Frame = ttk.Frame(
settings_tolerance, style='second.TFrame')
ttk.Label(tolerance_panel, image=self.icons['search'], text='Search spelling compensation', compound='left').pack(
side='left', anchor='center', fill='y')
ttk.Label(tolerance_panel, text='Perfection').pack(
side='right', anchor='center', fill='y', padx=10)
ttk.Scale(tolerance_panel, from_=0.1, to=1, variable=self.search_compensation,
command=self.change_compensation).pack(side='right', anchor='center', fill='x', ipadx=40)
ttk.Label(tolerance_panel, text='Ignore all').pack(
side='right', anchor='center', fill='y', padx=10)
tolerance_panel.pack(side='top', fill='x', pady=10, padx=10)
spell_panel: ttk.Frame = ttk.Frame(
settings_tolerance, style='second.TFrame')
ttk.Label(spell_panel, image=self.icons['spell'], text='Search spelling correction', compound='left').pack(
side='left', anchor='center', fill='y')
ttk.Radiobutton(spell_panel, text='Off', style='second.TRadiobutton', value=False,
variable=self.search_correction, command=self.change_correction).pack(side='right', anchor='center', padx=(0, 10))
ttk.Radiobutton(spell_panel, text='On', style='second.TRadiobutton', value=True,
variable=self.search_correction, command=self.change_correction).pack(side='right', anchor='center', padx=(0, 10))
spell_panel.pack(side='top', fill='x', padx=10, pady=(0, 10))
ttk.Label(settings_tolerance, image=self.icons['info'], text='Note: Sounder will ignore all spelling mistakes if set to lowest (not recomended)!', compound='left').pack(
side='top', fill='x', padx=10, pady=(0, 10))

ttk.Label(settings_tolerance, image=self.icons['search'], text='Search spelling compensation', compound='left').pack(
side='left', anchor='center', fill='y', pady=10, padx=(10, 0))
ttk.Label(settings_tolerance, text='Perfection').pack(
side='right', anchor='center', fill='y', padx=10, pady=10)
ttk.Scale(settings_tolerance, from_=0.4, to=0.8, variable=self.search_compensation,
command=self.change_compensation).pack(side='right', anchor='center', fill='x', ipadx=40, pady=10)
ttk.Label(settings_tolerance, text='Normal').pack(
side='right', anchor='center', fill='y', padx=10, pady=10)
# menu positions
settings_menu: ttk.Frame = ttk.Frame(
self.player_content, style='second.TFrame')
Expand Down Expand Up @@ -838,7 +820,6 @@ def init_player(self: Tk) -> None:
self.after_job: Union[str, None] = None
self.songs_queue: list = []
self.offset: float = 0
self.speller: Speller = Speller()
# set last song
self.song: str = self.settings['last_song']
# init mixer
Expand Down Expand Up @@ -1392,9 +1373,6 @@ def change_compensation(self: Tk, _: Event) -> None:
self.settings['search_compensation'] = round(
self.search_compensation.get(), 1)

def change_correction(self: Tk) -> None:
self.settings['search_correction'] = self.search_correction.get()

def update_thread(self: Tk) -> None:
Thread(target=self.check_update, daemon=True).start()

Expand Down Expand Up @@ -1429,19 +1407,24 @@ def search(self: Tk, _: Event = None) -> None:
def sort_panels(self: Tk, search_word: str, songs: list, refresh_panels: bool = False) -> None:
try:
temp_songs: list = []
score: float = 0.0
ratio: float = 2.0
# apply search
if search_word:
search_word_length: int = len(search_word)
if self.settings['search_correction']:
search_word = self.speller(search_word)
for song in songs:
score = 0.0
tokens: int = len(self.songs_cache[song]['search_tokens'])
ratio = (
self.settings['search_compensation'] * (tokens - 1))
for token in self.songs_cache[song]['search_tokens']:
if song in temp_songs:
continue
if SequenceMatcher(a=token, b=search_word).quick_ratio() >= self.settings['search_compensation']:
temp_songs.append(song)
elif search_word == token[:search_word_length]:
temp_songs.append(song)
if search_word in token or search_word == token:
score += 1.0
score += SequenceMatcher(a=token,
b=search_word).quick_ratio()
if score >= ratio:
temp_songs.append(song)
else:
temp_songs = songs.copy()
# apply sort
Expand Down
12 changes: 0 additions & 12 deletions src/docker-compose.yml

This file was deleted.

3 changes: 2 additions & 1 deletion updates/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Changelog:
+Added support for wav files
+Removed old stuff
~Improved search function
2 changes: 1 addition & 1 deletion updates/hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c99eba6f342213c7df2beb79bb8ff1b49141537a9592503e87ce0afd5d0af00d
23d4693e4634f7ea7c0714c6f8d408200cdaa5d19dfd803098967c38ba758d06
Binary file modified updates/package.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion updates/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.7
0.8.8

0 comments on commit 34c0c07

Please sign in to comment.