From 1e08c3973b4f316e269c380b13c26162d7cbc161 Mon Sep 17 00:00:00 2001 From: DaveTBlake Date: Sat, 10 Oct 2015 19:24:07 +0100 Subject: Undoing effects of PR8011 on file view display of extracted tag data. Make view type Media Info available. Add sort by various tag data criteria e.g. artist, title etc. as well as file name, size etc. Sorting and display of "Listeners" has been removed as this data has been deprecated. Adjust for removal of TRACKFORMATRIGHT setting by PR8159 --- xbmc/music/GUIViewStateMusic.cpp | 22 +++++++++++++++++++--- xbmc/music/windows/GUIWindowMusicNav.cpp | 4 ++++ xbmc/windows/GUIMediaWindow.cpp | 2 +- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/xbmc/music/GUIViewStateMusic.cpp b/xbmc/music/GUIViewStateMusic.cpp index aa786d820e..4682effac5 100644 --- a/xbmc/music/GUIViewStateMusic.cpp +++ b/xbmc/music/GUIViewStateMusic.cpp @@ -160,7 +160,7 @@ CGUIViewStateMusicDatabase::CGUIViewStateMusicDatabase(const CFileItemList& item case NODE_TYPE_YEAR_ALBUM: { // album - AddSortMethod(SortByAlbum, sortAttribute, 558, LABEL_MASKS("%F", "", strAlbum, "%B")); // Filename, empty | Userdefined, Album + AddSortMethod(SortByAlbum, sortAttribute, 558, LABEL_MASKS("%F", "", strAlbum, "%A")); // Filename, empty | Userdefined (default=%B), Artist // artist AddSortMethod(SortByArtist, sortAttribute, 557, LABEL_MASKS("%F", "", strAlbum, "%A")); // Filename, empty | Userdefined, Artist // artist / year @@ -447,14 +447,30 @@ CGUIViewStateWindowMusicNav::CGUIViewStateWindowMusicNav(const CFileItemList& it } else { - AddSortMethod(SortByLabel, 551, LABEL_MASKS("%F", "%D", "%L", "")); // Filename, Duration | Foldername, empty + //In navigation of music files tag data is scanned whenever present and can be used as sort criteria + //hence sort methods available are similar to song node (not the same as only tag data) + //Unfortunately anything here appears at all levels of file navigation even if no song files there. + std::string strTrackLeft = CSettings::GetInstance().GetString(CSettings::SETTING_MUSICFILES_LIBRARYTRACKFORMAT); + if (strTrackLeft.empty()) + strTrackLeft = CSettings::GetInstance().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT); + AddSortMethod(SortByLabel, 551, LABEL_MASKS(strTrackLeft, "%D", "%L", ""), // Userdefined, Duration | FolderName, empty + CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone); AddSortMethod(SortBySize, 553, LABEL_MASKS("%F", "%I", "%L", "%I")); // Filename, Size | Foldername, Size AddSortMethod(SortByDate, 552, LABEL_MASKS("%F", "%J", "%L", "%J")); // Filename, Date | Foldername, Date AddSortMethod(SortByFile, 561, LABEL_MASKS("%F", "%I", "%L", "")); // Filename, Size | Label, empty + AddSortMethod(SortByTrackNumber, 554, LABEL_MASKS(strTrackLeft, "%D")); // Userdefined, Duration| empty, empty + AddSortMethod(SortByTitle, sortAttribute, 556, LABEL_MASKS("%T - %A", "%D")); // Title, Artist, Duration| empty, empty + AddSortMethod(SortByAlbum, sortAttribute, 558, LABEL_MASKS("%B - %T - %A", "%D")); // Album, Title, Artist, Duration| empty, empty + AddSortMethod(SortByArtist, sortAttribute, 557, LABEL_MASKS("%A - %T", "%D")); // Artist, Title, Duration| empty, empty + AddSortMethod(SortByArtistThenYear, sortAttribute, 578, LABEL_MASKS("%A(%Y) - %T", "%D")); // Artist(year), Title, Duration| empty, empty + AddSortMethod(SortByTime, 180, LABEL_MASKS("%T - %A", "%D")); // Titel, Artist, Duration| empty, empty + AddSortMethod(SortByYear, 562, LABEL_MASKS("%T - %A", "%Y")); // Title, Artist, Year SetSortMethod(SortByLabel); } - SetViewAsControl(DEFAULT_VIEW_LIST); + const CViewState *viewState = CViewStateSettings::GetInstance().Get("musicnavsongs"); + SetViewAsControl(viewState->m_viewMode); + SetSortOrder(viewState->m_sortDescription.sortOrder); SetSortOrder(SortOrderAscending); } diff --git a/xbmc/music/windows/GUIWindowMusicNav.cpp b/xbmc/music/windows/GUIWindowMusicNav.cpp index cee7a23413..fba5e7e186 100644 --- a/xbmc/music/windows/GUIWindowMusicNav.cpp +++ b/xbmc/music/windows/GUIWindowMusicNav.cpp @@ -287,6 +287,10 @@ bool CGUIWindowMusicNav::GetDirectory(const std::string &strDirectory, CFileItem OnRetrieveMusicInfo(items); } + //Navigating music files so default content to "songs" unless in sources folder. + //This content allows view type to include media info so that file tag data can be displayed + if (!URIUtils::IsSourcesPath(strDirectory)) + items.SetContent("songs"); // update our content in the info manager if (StringUtils::StartsWithNoCase(strDirectory, "videodb://") || items.IsVideoDb()) { diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp index db718e9261..b7b357767b 100644 --- a/xbmc/windows/GUIMediaWindow.cpp +++ b/xbmc/windows/GUIMediaWindow.cpp @@ -690,7 +690,7 @@ bool CGUIMediaWindow::GetDirectory(const std::string &strDirectory, CFileItemLis // TODO: Do we want to limit the directories we apply the video ones to? if (iWindow == WINDOW_VIDEO_NAV) regexps = g_advancedSettings.m_videoExcludeFromListingRegExps; - if (iWindow == WINDOW_MUSIC_FILES) + if (iWindow == WINDOW_MUSIC_FILES || iWindow == WINDOW_MUSIC_NAV) regexps = g_advancedSettings.m_audioExcludeFromListingRegExps; if (iWindow == WINDOW_PICTURES) regexps = g_advancedSettings.m_pictureExcludeFromListingRegExps; -- cgit v1.2.3