2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
9 #include "DirectoryNodeTop100.h"
12 #include "guilib/LocalizeStrings.h"
13 #include "utils/StringUtils.h"
15 using namespace XFILE::MUSICDATABASEDIRECTORY
;
17 Node Top100Children
[] = {
18 { NODE_TYPE_SONG_TOP100
, "songs", 10504 },
19 { NODE_TYPE_ALBUM_TOP100
, "albums", 10505 },
22 CDirectoryNodeTop100::CDirectoryNodeTop100(const std::string
& strName
, CDirectoryNode
* pParent
)
23 : CDirectoryNode(NODE_TYPE_TOP100
, strName
, pParent
)
28 NODE_TYPE
CDirectoryNodeTop100::GetChildType() const
30 for (const Node
& node
: Top100Children
)
31 if (GetName() == node
.id
)
34 return NODE_TYPE_NONE
;
37 std::string
CDirectoryNodeTop100::GetLocalizedName() const
39 for (const Node
& node
: Top100Children
)
40 if (GetName() == node
.id
)
41 return g_localizeStrings
.Get(node
.label
);
45 bool CDirectoryNodeTop100::GetContent(CFileItemList
& items
) const
47 for (const Node
& node
: Top100Children
)
49 CFileItemPtr
pItem(new CFileItem(g_localizeStrings
.Get(node
.label
)));
50 std::string strDir
= StringUtils::Format("{}/", node
.id
);
51 pItem
->SetPath(BuildPath() + strDir
);
52 pItem
->m_bIsFolder
= true;