-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
diff --git a/src/screens/media_library.cpp b/src/screens/media_library.cpp | ||
index 558458d..f873704 100644 | ||
--- a/src/screens/media_library.cpp | ||
+++ b/src/screens/media_library.cpp | ||
@@ -52,8 +52,8 @@ MediaLibrary *myLibrary; | ||
|
||
namespace { | ||
|
||
-bool hasTwoColumns; | ||
-bool isAlbumOnly; | ||
+bool hasTwoColumns = 1; | ||
+bool isAlbumOnly = 1; | ||
size_t itsLeftColStartX; | ||
size_t itsLeftColWidth; | ||
size_t itsMiddleColWidth; | ||
@@ -189,8 +189,8 @@ MediaLibrary::MediaLibrary() | ||
, m_window_timeout(Config.data_fetching_delay ? 250 : BaseScreen::defaultWindowTimeout) | ||
, m_fetching_delay(boost::posix_time::milliseconds(Config.data_fetching_delay ? 250 : -1)) | ||
{ | ||
- hasTwoColumns = 0; | ||
- isAlbumOnly = 0; | ||
+ hasTwoColumns = 1; | ||
+ isAlbumOnly = 1; | ||
itsLeftColWidth = COLS/3-1; | ||
itsMiddleColWidth = COLS/3; | ||
itsMiddleColStartX = itsLeftColWidth+1; | ||
@@ -232,6 +232,8 @@ MediaLibrary::MediaLibrary() | ||
)); | ||
|
||
w = &Tags; | ||
+ | ||
+ toggleColumnsMode(); | ||
} | ||
|
||
void MediaLibrary::resize() | ||
@@ -904,15 +906,8 @@ void MediaLibrary::updateTimer() | ||
|
||
void MediaLibrary::toggleColumnsMode() | ||
{ | ||
- if (isAlbumOnly) | ||
- { | ||
- hasTwoColumns = 0; | ||
- isAlbumOnly = 0; | ||
- } | ||
- else if (hasTwoColumns) | ||
- isAlbumOnly = 1; | ||
- else | ||
- hasTwoColumns = 1; | ||
+ hasTwoColumns = 1; | ||
+ isAlbumOnly = 1; | ||
|
||
Tags.clear(); | ||
Albums.clear(); | ||
diff --git a/src/settings.cpp b/src/settings.cpp | ||
index 80a2b4e..d86e26e 100644 | ||
--- a/src/settings.cpp | ||
+++ b/src/settings.cpp | ||
@@ -444,9 +444,11 @@ bool Configuration::read(const std::vector<std::string> &config_paths, bool igno | ||
p.add("user_interface", &design, "classic"); | ||
p.add("data_fetching_delay", &data_fetching_delay, "yes", yes_no); | ||
p.add("media_library_hide_album_dates", &media_lib_hide_album_dates, "no", yes_no); | ||
- p.add("media_library_primary_tag", &media_lib_primary_tag, "artist", [](std::string v) { | ||
+ p.add("media_library_primary_tag", &media_lib_primary_tag, "album", [](std::string v) { | ||
if (v == "artist") | ||
return MPD_TAG_ARTIST; | ||
+ else if (v == "album") | ||
+ return MPD_TAG_ALBUM; | ||
else if (v == "album_artist") | ||
return MPD_TAG_ALBUM_ARTIST; | ||
else if (v == "date") | ||
@@ -507,7 +509,7 @@ bool Configuration::read(const std::vector<std::string> &config_paths, bool igno | ||
}); | ||
} | ||
}); | ||
- p.add("startup_screen", &startup_screen_type, "playlist", [](std::string v) { | ||
+ p.add("startup_screen", &startup_screen_type, "media_library", [](std::string v) { | ||
auto screen = stringtoStartupScreenType(v); | ||
if (screen == ScreenType::Unknown) | ||
invalid_value(v); |