-
Notifications
You must be signed in to change notification settings - Fork 0
Add boxsets ability #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
c72a781
309f255
c3aeea5
25cf63a
695921e
51b2d28
013c2b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7318,7 +7318,19 @@ msgctxt "#13521" | |
| msgid "Choose art type" | ||
| msgstr "" | ||
|
|
||
| #empty strings from id 13522 to 13549 | ||
| #. label of a setting that allows splitting of albums into component discs | ||
| #: system/settings/settings.xml | ||
| msgctxt "#13522" | ||
| msgid "Split albums into individual discs" | ||
| msgstr "" | ||
|
|
||
| #. Description of setting with label #13522 "Split albums into individual discs" | ||
| #: system/settings/settings.xml | ||
| msgctxt "#13523" | ||
| msgid "When enabled, opening a multi-disc album shows the discs as individual items instead of all the songs. Opening a disc then shows the songs on that disc." | ||
| msgstr "" | ||
|
|
||
| #empty strings from id 13524 to 13549 | ||
|
|
||
| #: system/settings/settings.xml | ||
| msgctxt "#13550" | ||
|
|
@@ -7786,6 +7798,7 @@ msgctxt "#14086" | |
| msgid "Playback" | ||
| msgstr "" | ||
|
|
||
| #: xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeOverview.cpp | ||
| #: system/settings/settings.xml | ||
| msgctxt "#14087" | ||
| msgid "Discs" | ||
|
|
@@ -8399,12 +8412,14 @@ msgstr "" | |
| #: xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeRcentlyAdded.cpp | ||
| #: xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeRcentlyPlayed.cpp | ||
| #: xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeYearAlbum.cpp | ||
| #: xbmc/music/windows/MusicFileItemListModifier.cpp | ||
| msgctxt "#15102" | ||
| msgid "* All albums" | ||
| msgstr "" | ||
|
|
||
| #: xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.cpp | ||
| #: xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeArtist.cpp | ||
| #: xbmc/music/windows/MusicFileItemListModifier.cpp | ||
| msgctxt "#15103" | ||
| msgid "* All artists" | ||
| msgstr "" | ||
|
|
@@ -12764,7 +12779,7 @@ msgctxt "#20340" | |
| msgid "Do you want to remove all items within this path from your library?" | ||
| msgstr "" | ||
|
|
||
| #empty string with id 20341 | ||
| #empty string with id #20341 | ||
|
|
||
| #: xbmc/dialogs/GUIDialogMediaFilter.cpp | ||
| #: xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp | ||
|
|
@@ -21145,8 +21160,24 @@ msgctxt "#38073" | |
| msgid "Do you want to refresh information for this item now?" | ||
| msgstr "" | ||
|
|
||
| #empty strings from id 38074 to 38099 | ||
| #strings 38074 to 38099 reserved for music library | ||
| #: system/library/music/musicroles/boxsets.xml | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My error system/library/music/boxsets.xml |
||
| msgctxt "#38074" | ||
| msgid "boxsets" | ||
| msgstr "" | ||
|
|
||
| #: xbmc/music/windows/MusicFileItemListModifier.cpp | ||
| #: xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeDisc.cpp | ||
| msgctxt "#38075" | ||
| msgid "* All discs" | ||
| msgstr "" | ||
|
|
||
| #: addons/skin.estuary/xml/Variables.xml | ||
| msgctxt "#38076" | ||
| msgid "Disc title" | ||
| msgstr "" | ||
|
|
||
| #empty strings from id 38077 to 38099 | ||
| #strings 38076 to 38099 reserved for music library | ||
|
|
||
| #. Description of section #14200 "Player"" | ||
| #: system/settings/settings.xml | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | ||
| <node order="99" type="folder" visible="Library.HasContent(Boxsets)"> | ||
| <label>38074</label> | ||
| <icon>DefaultSets.png</icon> | ||
| <path>musicdb://albums/?boxset=true</path> | ||
| </node> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,12 +65,16 @@ bool CLibraryDirectory::GetDirectory(const CURL& url, CFileItemList &items) | |
| } | ||
| else if (type == "folder") | ||
| { | ||
| std::string label; | ||
| if (XMLUtils::GetString(node, "label", label)) | ||
| label = CGUIControlFactory::FilterLabel(label); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All changes to CLibraryDirectory can be dropped, they are in PR 16626 |
||
| items.SetLabel(label); | ||
| std::string path; | ||
| XMLUtils::GetPath(node, "path", path); | ||
| if (!path.empty()) | ||
| { | ||
| URIUtils::AddSlashAtEnd(path); | ||
| return CDirectory::GetDirectory(path, items, m_strFileMask, m_flags); | ||
| return CDirectory::GetDirectory(path, items, m_strFileMask, m_flags); // Sets localized label based on node type | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,11 @@ | |
| #include "DirectoryNodeAlbum.h" | ||
|
|
||
| #include "QueryParams.h" | ||
| #include "ServiceBroker.h" | ||
| #include "guilib/LocalizeStrings.h" | ||
| #include "music/MusicDatabase.h" | ||
| #include "settings/Settings.h" | ||
| #include "settings/SettingsComponent.h" | ||
|
|
||
| using namespace XFILE::MUSICDATABASEDIRECTORY; | ||
|
|
||
|
|
@@ -22,13 +25,30 @@ CDirectoryNodeAlbum::CDirectoryNodeAlbum(const std::string& strName, CDirectoryN | |
|
|
||
| NODE_TYPE CDirectoryNodeAlbum::GetChildType() const | ||
| { | ||
| if (GetName() == "-1") | ||
| return NODE_TYPE_SONG; | ||
|
|
||
| //! @todo: This makes all multi-disc albums album > disc > song, make disc level optional | ||
| CMusicDatabase musicdatabase; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a new music lib setting to enable(default)/disable navigation from multi-disc albums to discs rather than directly to songs, and use it here to allow albums > discs navigation to be optional. That way we can give users original behaviour if they want it. A search for
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I'll give it a go.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done that. Default is false and navigation is as it was. Toggling it on enables disc type navigation. Incidentally, extraart still works in original navigation if you have set any up, so the covers change as you scroll up and down the tracks between the discs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Users won't see the new grouping as discs feature that way around. Make default having a "discs" level, and they can change the setting to get old behaviour back
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. Not 100% sure that it should be turned off for boxsets at all, given that's where we started with all this, but as I can't see a particularly clean way of doing that I'll go with it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Humm, yes when viewing boxed sets you do always want album > disc... |
||
| if (!CServiceBroker::GetSettingsComponent()->GetSettings()->GetBool(CSettings::SETTING_MUSICLIBRARY_SHOWDISCS)) | ||
| return NODE_TYPE_SONG; | ||
| if (musicdatabase.Open()) | ||
| { | ||
| int iDiscTotal = -1; | ||
| iDiscTotal = musicdatabase.GetAlbumDiscCount(GetID()); | ||
| musicdatabase.Close(); | ||
| if (iDiscTotal > 1) | ||
| return NODE_TYPE_DISC; | ||
| } | ||
|
|
||
| return NODE_TYPE_SONG; | ||
| } | ||
|
|
||
| std::string CDirectoryNodeAlbum::GetLocalizedName() const | ||
| { | ||
| if (GetID() == -1) | ||
| return g_localizeStrings.Get(15102); // All Albums | ||
|
|
||
| CMusicDatabase db; | ||
| if (db.Open()) | ||
| return db.GetAlbumById(GetID()); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /* | ||
| * Copyright (C) 2005-2019 Team Kodi | ||
| * This file is part of Kodi - https://kodi.tv | ||
| * | ||
| * SPDX-License-Identifier: GPL-2.0-or-later | ||
| * See LICENSES/README.md for more information. | ||
| */ | ||
|
|
||
| #include "DirectoryNodeDiscs.h" | ||
|
|
||
| #include "QueryParams.h" | ||
| #include "guilib/LocalizeStrings.h" | ||
| #include "music/MusicDatabase.h" | ||
|
|
||
| using namespace XFILE::MUSICDATABASEDIRECTORY; | ||
|
|
||
| CDirectoryNodeDiscs::CDirectoryNodeDiscs(const std::string& strName, | ||
| CDirectoryNode* pParent) | ||
| : CDirectoryNode(NODE_TYPE_DISC, strName, pParent) | ||
| { | ||
| } | ||
|
|
||
| NODE_TYPE CDirectoryNodeDiscs::GetChildType() const | ||
| { | ||
| return NODE_TYPE_SONG; | ||
| } | ||
|
|
||
| std::string CDirectoryNodeDiscs::GetLocalizedName() const | ||
| { | ||
|
|
||
| if (GetID() == -1) | ||
| return g_localizeStrings.Get(38075); // "All discs" | ||
|
|
||
| // ! @todo: Find better approach, use the label of the item we click? | ||
| CQueryParams params; | ||
| CollectQueryParams(params); | ||
| CMusicDatabase db; | ||
| if (db.Open()) | ||
| return db.GetBoxsetDiscById(params.GetAlbumId(), params.GetDisc()); | ||
| return ""; | ||
| } | ||
|
|
||
| bool CDirectoryNodeDiscs::GetContent(CFileItemList& items) const | ||
| { | ||
| CMusicDatabase musicdatabase; | ||
| if (!musicdatabase.Open()) | ||
| return false; | ||
|
|
||
| CQueryParams params; | ||
| CollectQueryParams(params); | ||
|
|
||
| bool bSuccess = musicdatabase.GetDiscsByWhere(BuildPath(), items, params.GetAlbumId()); | ||
|
|
||
| musicdatabase.Close(); | ||
|
|
||
| return bSuccess; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * Copyright (C) 2005-2019 Team Kodi | ||
| * This file is part of Kodi - https://kodi.tv | ||
| * | ||
| * SPDX-License-Identifier: GPL-2.0-or-later | ||
| * See LICENSES/README.md for more information. | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "DirectoryNode.h" | ||
|
|
||
| namespace XFILE | ||
| { | ||
| namespace MUSICDATABASEDIRECTORY | ||
| { | ||
| class CDirectoryNodeDiscs : public CDirectoryNode | ||
| { | ||
| public: | ||
| CDirectoryNodeDiscs(const std::string& strName, CDirectoryNode* pParent); | ||
| protected: | ||
| NODE_TYPE GetChildType() const override; | ||
| bool GetContent(CFileItemList& items) const override; | ||
| std::string GetLocalizedName() const override; | ||
| }; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary change