jupiterbjy/CUIAudioPlayer

Player crashes when moving into directory while track is playing

jupiterbjy opened this issue · 2 comments

------------------------------------------------------------------------------------------------------------------------
FileWalker.py 112 index
return len(self.folder_list) + self.audio_file_list.index(target)

ValueError:
'E:\\github\\CUIAudioPlayer\\audio_files\\【wowaka】アンノウン・マザーグース/歌ってみた【花鋏キョウ&獅子神レオナ&流石乃ルキ&流石乃ロキ】.ogg' is not in list

------------------------------------------------------------------------------------------------------------------------
runpy.py 197 _run_module_as_main
return _run_code(code, main_globals, None,

runpy.py 87 _run_code
exec(code, run_globals)

__main__.py 53 <module>
main()

__main__.py 49 main
draw_player()

__main__.py 41 draw_player
root.start()

__init__.py 318 start
curses.wrapper(self._draw)

__init__.py 94 wrapper
return func(stdscr, *args, **kwds)

__init__.py 1568 _draw
self._handle_key_presses(key_pressed)

__init__.py 1447 _handle_key_presses
selected_widget._handle_key_press(key_pressed)

__init__.py 29 wrapper
old_func(*args, **kwargs)

widgets.py 437 _handle_key_press
super()._handle_key_press(key_pressed)

widgets.py 280 _handle_key_press
command()

PlayerLogic.py 125 _play_cb_enter
return self.player_state.on_audio_list_enter_press(self)

PlayerStates.py 155 on_audio_list_enter_press
audio_player._on_reload_click()

PlayerLogic.py 117 _on_reload_click
return self.player_state.on_reload_click(self)

PlayerStates.py 135 on_reload_click
audio_player._on_stop_click()

PlayerLogic.py 109 _on_stop_click
return self.player_state.on_stop_click(self)

PlayerStates.py 124 on_stop_click
audio_player.mark_as_stopped(audio_player.currently_playing)

PlayerStates.py 79 currently_playing
return self.path_wrapper.index(file_name)

FileWalker.py 116 index
return len(self.folder_list) + self.audio_file_list.index(path_converted)

ValueError:
WindowsPath('E:/github/CUIAudioPlayer/audio_files/【wowaka】アンノウン・マザーグース/歌ってみた【花鋏キョウ&獅子神レオナ&流石乃ルキ&流石乃ロキ】.ogg') is not in list

It was #15 that was fixed, not #17, opening again.

Not sure how I should fix this issue.

Saving reference of path context to audio object so it can keep playing sounds sound enough for me.