Made playlists load on click if they weren't.
Also set default for setting "load_on_start" to False because with this change, it feels a lot cleaner this way and uses less RAM.
This commit is contained in:
parent
4dc1caab6e
commit
3fd29bcf92
3 changed files with 7 additions and 2 deletions
|
@ -56,9 +56,11 @@ class Library:
|
||||||
playlist_view = PlaylistView(playlist, library_dock)
|
playlist_view = PlaylistView(playlist, library_dock)
|
||||||
playlist_tabs.addTab(playlist_view, playlist.title)
|
playlist_tabs.addTab(playlist_view, playlist.title)
|
||||||
|
|
||||||
if playlist.path == self.app.settings.latest_playlist: # start with latest playlist opened
|
if playlist.path == self.app.settings.latest_playlist: # start with latest playlist opened and loaded
|
||||||
playlist_tabs.setCurrentIndex(playlist_tabs.count() - 1)
|
playlist_tabs.setCurrentIndex(playlist_tabs.count() - 1)
|
||||||
|
|
||||||
|
playlist.load()
|
||||||
|
|
||||||
if self.app.settings.load_on_start:
|
if self.app.settings.load_on_start:
|
||||||
for playlist in self.playlists:
|
for playlist in self.playlists:
|
||||||
playlist.load()
|
playlist.load()
|
||||||
|
|
|
@ -10,5 +10,5 @@ class Settings:
|
||||||
library_path: str="~/.wobuzz"
|
library_path: str="~/.wobuzz"
|
||||||
clear_track_cache: bool=True
|
clear_track_cache: bool=True
|
||||||
latest_playlist: str=None
|
latest_playlist: str=None
|
||||||
load_on_start: bool=True
|
load_on_start: bool=False
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,9 @@ class PlaylistTabBar(QTabBar):
|
||||||
playlist_view = self.tab_widget.widget(index)
|
playlist_view = self.tab_widget.widget(index)
|
||||||
playlist = playlist_view.playlist
|
playlist = playlist_view.playlist
|
||||||
|
|
||||||
|
if not playlist.loaded:
|
||||||
|
playlist.load()
|
||||||
|
|
||||||
self.app.gui.clicked_playlist = playlist
|
self.app.gui.clicked_playlist = playlist
|
||||||
|
|
||||||
def on_doubleclick(self, index):
|
def on_doubleclick(self, index):
|
||||||
|
|
Loading…
Add table
Reference in a new issue